org.fourthline.cling.model.meta.Device.findServices()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.fourthline.cling.model.meta.Device.findServices()方法的一些代码示例,展示了Device.findServices()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.findServices()方法的具体详情如下:
包路径:org.fourthline.cling.model.meta.Device
类名称:Device
方法名:findServices

Device.findServices介绍

暂无

代码示例

代码示例来源:origin: 4thline/cling

public S findService(ServiceId serviceId) {
  Collection<S> services = findServices(null, serviceId, (D) this);
  return services.size() == 1 ? services.iterator().next() : null;
}

代码示例来源:origin: 4thline/cling

public S findService(ServiceType serviceType) {
  Collection<S> services = findServices(serviceType, null, (D) this);
  return services.size() > 0 ? services.iterator().next() : null;
}

代码示例来源:origin: 4thline/cling

public boolean isFullyHydrated() {
  S[] services = findServices();
  for (S service : services) {
    if (service.hasStateVariables()) return true;
  }
  return false;
}

代码示例来源:origin: 4thline/cling

public ServiceType[] findServiceTypes() {
  Collection<S> services = findServices(null, null, (D) this);
  Collection<ServiceType> col = new HashSet<>();
  for (S service : services) {
    col.add(service.getServiceType());
  }
  return col.toArray(new ServiceType[col.size()]);
}

代码示例来源:origin: 4thline/cling

protected Collection<D> find(ServiceType serviceType, D current) {
  Collection<S> services = findServices(serviceType, null, current);
  Collection<D> devices = new HashSet<>();
  for (Service service : services) {
    devices.add((D) service.getDevice());
  }
  return devices;
}

代码示例来源:origin: 4thline/cling

@Override
synchronized public void deviceRemoved(Registry registry, Device device) {
  for (Service service : device.findServices()) {
    Iterator<Map.Entry<Service, List<PortMapping>>> it = activePortMappings.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry<Service, List<PortMapping>> activeEntry = it.next();
      if (!activeEntry.getKey().equals(service)) continue;
      if (activeEntry.getValue().size() > 0)
        handleFailureMessage("Device disappeared, couldn't delete port mappings: " + activeEntry.getValue().size());
      it.remove();
    }
  }
}

代码示例来源:origin: 4thline/cling

public S[] findServices(ServiceType serviceType) {
  return toServiceArray(findServices(serviceType, null, (D) this));
}

代码示例来源:origin: 4thline/cling

public S[] findServices() {
  return toServiceArray(findServices(null, null, (D) this));
}

代码示例来源:origin: kingthy/TVRemoteIME

public S findService(ServiceType serviceType) {
  Collection<S> services = findServices(serviceType, null, (D) this);
  return services.size() > 0 ? services.iterator().next() : null;
}

代码示例来源:origin: kingthy/TVRemoteIME

public S findService(ServiceId serviceId) {
  Collection<S> services = findServices(null, serviceId, (D) this);
  return services.size() == 1 ? services.iterator().next() : null;
}

代码示例来源:origin: kingthy/TVRemoteIME

protected Collection<D> find(ServiceType serviceType, D current) {
  Collection<S> services = findServices(serviceType, null, current);
  Collection<D> devices = new HashSet();
  for (Service service : services) {
    devices.add((D) service.getDevice());
  }
  return devices;
}

代码示例来源:origin: kingthy/TVRemoteIME

public ServiceType[] findServiceTypes() {
  Collection<S> services = findServices(null, null, (D) this);
  Collection<ServiceType> col = new HashSet();
  for (S service : services) {
    col.add(service.getServiceType());
  }
  return col.toArray(new ServiceType[col.size()]);
}

代码示例来源:origin: kingthy/TVRemoteIME

public boolean isFullyHydrated() {
  S[] services = findServices();
  for (S service : services) {
    if (service.hasStateVariables()) return true;
  }
  return false;
}

代码示例来源:origin: kingthy/TVRemoteIME

@Override
synchronized public void deviceRemoved(Registry registry, Device device) {
  for (Service service : device.findServices()) {
    Iterator<Map.Entry<Service, List<PortMapping>>> it = activePortMappings.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry<Service, List<PortMapping>> activeEntry = it.next();
      if (!activeEntry.getKey().equals(service)) continue;
      if (activeEntry.getValue().size() > 0)
        handleFailureMessage("Device disappeared, couldn't delete port mappings: " + activeEntry.getValue().size());
      it.remove();
    }
  }
}

代码示例来源:origin: kingthy/TVRemoteIME

public S[] findServices(ServiceType serviceType) {
  return toServiceArray(findServices(serviceType, null, (D) this));
}

代码示例来源:origin: kingthy/TVRemoteIME

public S[] findServices() {
  return toServiceArray(findServices(null, null, (D) this));
}

代码示例来源:origin: org.fourthline.cling/cling-core

public ServiceType[] findServiceTypes() {
  Collection<S> services = findServices(null, null, (D) this);
  Collection<ServiceType> col = new HashSet<>();
  for (S service : services) {
    col.add(service.getServiceType());
  }
  return col.toArray(new ServiceType[col.size()]);
}

代码示例来源:origin: org.fourthline.cling/cling-core

protected Collection<D> find(ServiceType serviceType, D current) {
  Collection<S> services = findServices(serviceType, null, current);
  Collection<D> devices = new HashSet<>();
  for (Service service : services) {
    devices.add((D) service.getDevice());
  }
  return devices;
}

代码示例来源:origin: org.fourthline.cling/cling-core

public boolean isFullyHydrated() {
  S[] services = findServices();
  for (S service : services) {
    if (service.hasStateVariables()) return true;
  }
  return false;
}

代码示例来源:origin: fire3/sailorcast

@Override
public void printService()
{
  Service[] services = device.findServices();
  for (Service service : services)
  {
    Log.i(TAG, "\t Service : " + service);
    for (Action a : service.getActions())
    {
      Log.i(TAG, "\t\t Action : " + a);
    }
  }
}

相关文章