org.cybergarage.upnp.Device.getDeviceList()方法的使用及代码示例

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

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

Device.getDeviceList介绍

暂无

代码示例

代码示例来源:origin: i2p/i2p.i2p

private void listSubDev(String prefix, Device dev, StringBuilder sb){
      if (prefix == null)
    sb.append("<p>").append(_t("Found Device")).append(": ");
  else
    sb.append("<li>").append(_t("Subdevice")).append(": ");
  sb.append(DataHelper.escapeHTML(dev.getFriendlyName()));
      if (prefix == null) {
    String ip = getIP(dev);
    if (ip != null)
      sb.append("<br>IP: ").append(ip);
    String udn = dev.getUDN();
    if (udn != null)
      sb.append("<br>UDN: ").append(DataHelper.escapeHTML(udn));
  }
  sb.append("</p>");
  listSubServices(dev, sb);
  
  DeviceList dl = dev.getDeviceList();
  if (dl.isEmpty())
    return;
  sb.append("<ul>\n");
  for(int j=0; j<dl.size(); j++) {
    Device subDev = dl.getDevice(j);
    if(subDev == null) continue;
    listSubDev(dev.getFriendlyName(), subDev, sb);
  }
  sb.append("</ul>\n");
}

代码示例来源:origin: i2p/i2p.i2p

public void setQueryListener(QueryListener listener,
    boolean includeSubDevices) {
  setQueryListener(listener);
  if (includeSubDevices == true) {
    DeviceList devList = getDeviceList();
    int devCnt = devList.size();
    for (int n = 0; n < devCnt; n++) {
      Device dev = devList.getDevice(n);
      dev.setQueryListener(listener, true);
    }
  }
}

代码示例来源:origin: i2p/i2p.i2p

public void setActionListener(ActionListener listener,
    boolean includeSubDevices) {
  setActionListener(listener);
  if (includeSubDevices == true) {
    DeviceList devList = getDeviceList();
    int devCnt = devList.size();
    for (int n = 0; n < devCnt; n++) {
      Device dev = devList.getDevice(n);
      dev.setActionListener(listener, true);
    }
  }
}

代码示例来源:origin: i2p/i2p.i2p

public Device getDevice(String name) {
  DeviceList devList = getDeviceList();
  int devCnt = devList.size();
  for (int n = 0; n < devCnt; n++) {
    Device dev = devList.getDevice(n);
    if (dev.isDevice(name) == true)
      return dev;
    Device cdev = dev.getDevice(name);
    if (cdev != null)
      return cdev;
  }
  return null;
}

代码示例来源:origin: i2p/i2p.i2p

public Device getDeviceByDescriptionURI(String uri) {
  DeviceList devList = getDeviceList();
  int devCnt = devList.size();
  for (int n = 0; n < devCnt; n++) {
    Device dev = devList.getDevice(n);
    if (dev.isDescriptionURI(uri) == true)
      return dev;
    Device cdev = dev.getDeviceByDescriptionURI(uri);
    if (cdev != null)
      return cdev;
  }
  return null;
}

代码示例来源:origin: i2p/i2p.i2p

for (Device current : _router.getDeviceList()) {
  String type = current.getDeviceType();
  if (!(WAN_DEVICE.equals(type) || WAN_DEVICE_2.equals(type)))
    continue;
  DeviceList l = current.getDeviceList();
  for (int i=0;i<current.getDeviceList().size();i++) {
    Device current2 = l.getDevice(i);
    type = current2.getDeviceType();

代码示例来源:origin: i2p/i2p.i2p

public Service getSubscriberService(String uuid) {
  ServiceList serviceList = getServiceList();
  int serviceCnt = serviceList.size();
  for (int n = 0; n < serviceCnt; n++) {
    Service service = serviceList.getService(n);
    String sid = service.getSID();
    if (uuid.equals(sid) == true)
      return service;
  }
  DeviceList devList = getDeviceList();
  int devCnt = devList.size();
  for (int n = 0; n < devCnt; n++) {
    Device dev = devList.getDevice(n);
    Service service = dev.getSubscriberService(uuid);
    if (service != null)
      return service;
  }
  return null;
}

代码示例来源:origin: i2p/i2p.i2p

public StateVariable getStateVariable(String serviceType, String name) {
  if (serviceType == null && name == null)
    return null;
  ServiceList serviceList = getServiceList();
  int serviceCnt = serviceList.size();
  for (int n = 0; n < serviceCnt; n++) {
    Service service = serviceList.getService(n);
    // Thanks for Theo Beisch (11/09/04)
    if (serviceType != null) {
      if (service.getServiceType().equals(serviceType) == false)
        continue;
    }
    StateVariable stateVar = service.getStateVariable(name);
    if (stateVar != null)
      return stateVar;
  }
  DeviceList devList = getDeviceList();
  int devCnt = devList.size();
  for (int n = 0; n < devCnt; n++) {
    Device dev = devList.getDevice(n);
    StateVariable stateVar = dev.getStateVariable(serviceType, name);
    if (stateVar != null)
      return stateVar;
  }
  return null;
}

代码示例来源:origin: i2p/i2p.i2p

public Service getServiceBySCPDURL(String searchUrl) {
  ServiceList serviceList = getServiceList();
  int serviceCnt = serviceList.size();
  for (int n = 0; n < serviceCnt; n++) {
    Service service = serviceList.getService(n);
    if (service.isSCPDURL(searchUrl) == true)
      return service;
  }
  DeviceList devList = getDeviceList();
  int devCnt = devList.size();
  for (int n = 0; n < devCnt; n++) {
    Device dev = devList.getDevice(n);
    Service service = dev.getServiceBySCPDURL(searchUrl);
    if (service != null)
      return service;
  }
  return null;
}

代码示例来源:origin: i2p/i2p.i2p

public Service getService(String name) {
  ServiceList serviceList = getServiceList();
  int serviceCnt = serviceList.size();
  for (int n = 0; n < serviceCnt; n++) {
    Service service = serviceList.getService(n);
    if (service.isService(name) == true)
      return service;
  }
  DeviceList devList = getDeviceList();
  int devCnt = devList.size();
  for (int n = 0; n < devCnt; n++) {
    Device dev = devList.getDevice(n);
    Service service = dev.getService(name);
    if (service != null)
      return service;
  }
  return null;
}

代码示例来源:origin: i2p/i2p.i2p

public Service getServiceByControlURL(String searchUrl) {
  ServiceList serviceList = getServiceList();
  int serviceCnt = serviceList.size();
  for (int n = 0; n < serviceCnt; n++) {
    Service service = serviceList.getService(n);
    if (service.isControlURL(searchUrl) == true)
      return service;
  }
  DeviceList devList = getDeviceList();
  int devCnt = devList.size();
  for (int n = 0; n < devCnt; n++) {
    Device dev = devList.getDevice(n);
    Service service = dev.getServiceByControlURL(searchUrl);
    if (service != null)
      return service;
  }
  return null;
}

代码示例来源:origin: i2p/i2p.i2p

public Service getServiceByEventSubURL(String searchUrl) {
  ServiceList serviceList = getServiceList();
  int serviceCnt = serviceList.size();
  for (int n = 0; n < serviceCnt; n++) {
    Service service = serviceList.getService(n);
    if (service.isEventSubURL(searchUrl) == true)
      return service;
  }
  DeviceList devList = getDeviceList();
  int devCnt = devList.size();
  for (int n = 0; n < devCnt; n++) {
    Device dev = devList.getDevice(n);
    Service service = dev.getServiceByEventSubURL(searchUrl);
    if (service != null)
      return service;
  }
  return null;
}

代码示例来源:origin: i2p/i2p.i2p

public void unsubscribe(Device device)
{
  ServiceList serviceList = device.getServiceList();
  int serviceCnt = serviceList.size();
  for (int n=0; n<serviceCnt; n++) {
    Service service = serviceList.getService(n);
    if (service.hasSID() == true)
      unsubscribe(service);
  }
  DeviceList childDevList = device.getDeviceList();
  int childDevCnt = childDevList.size();
  for (int n=0; n<childDevCnt; n++) {
    Device cdev = childDevList.getDevice(n);
    unsubscribe(cdev);
  }        
}

代码示例来源:origin: i2p/i2p.i2p

public Action getAction(String name) {
  ServiceList serviceList = getServiceList();
  int serviceCnt = serviceList.size();
  for (int n = 0; n < serviceCnt; n++) {
    Service service = serviceList.getService(n);
    ActionList actionList = service.getActionList();
    int actionCnt = actionList.size();
    for (int i = 0; i < actionCnt; i++) {
      Action action = (Action) actionList.getAction(i);
      String actionName = action.getName();
      if (actionName == null)
        continue;
      if (actionName.equals(name) == true)
        return action;
    }
  }
  DeviceList devList = getDeviceList();
  int devCnt = devList.size();
  for (int n = 0; n < devCnt; n++) {
    Device dev = devList.getDevice(n);
    Action action = dev.getAction(name);
    if (action != null)
      return action;
  }
  return null;
}

代码示例来源:origin: i2p/i2p.i2p

public void renewSubscriberService(Device dev, long timeout)
{
  ServiceList serviceList = dev.getServiceList();
  int serviceCnt = serviceList.size();
  for (int n=0; n<serviceCnt; n++) {
    Service service = serviceList.getService(n);
    if (service.isSubscribed() == false)
      continue;
    String sid = service.getSID();
    boolean isRenewed = subscribe(service, sid, timeout);
    if (isRenewed == false)
      subscribe(service, timeout);
  }
  
  DeviceList cdevList = dev.getDeviceList();
  int cdevCnt = cdevList.size();
  for (int n=0; n<cdevCnt; n++) {
    Device cdev = cdevList.getDevice(n);
    renewSubscriberService(cdev, timeout);
  }
}

代码示例来源:origin: i2p/i2p.i2p

private void updateConfigId(Device dev) {
  int configId = 0;
  DeviceList cdevList = dev.getDeviceList();
  int cdevCnt = cdevList.size();
  for (int n = 0; n < cdevCnt; n++) {
    Device cdev = cdevList.getDevice(n);
    updateConfigId(cdev);
    configId += cdev.getConfigId();
    configId &= UPnP.CONFIGID_UPNP_ORG_MAX;
  }
  ServiceList serviceList = dev.getServiceList();
  int serviceCnt = serviceList.size();
  for (int n = 0; n < serviceCnt; n++) {
    Service service = serviceList.getService(n);
    service.updateConfigId();
    configId += service.getConfigId();
    configId &= UPnP.CONFIGID_UPNP_ORG_MAX;
  }
  Node devNode = getDeviceNode();
  if (devNode == null)
    return;
  String devDescXml = devNode.toString();
  configId += UPnP.caluculateConfigId(devDescXml);
  configId &= UPnP.CONFIGID_UPNP_ORG_MAX;
  devNode.setAttribute(CONFIG_ID, configId);
}

代码示例来源:origin: i2p/i2p.i2p

DeviceList childDeviceList = getDeviceList();
int childDeviceCnt = childDeviceList.size();
for (int n = 0; n < childDeviceCnt; n++) {

代码示例来源:origin: i2p/i2p.i2p

DeviceList childDeviceList = getDeviceList();
int childDeviceCnt = childDeviceList.size();
for (int n = 0; n < childDeviceCnt; n++) {

代码示例来源:origin: cybergarage/cybergarage-upnp

public void setActionListener(ActionListener listener,
    boolean includeSubDevices) {
  setActionListener(listener);
  if (includeSubDevices == true) {
    DeviceList devList = getDeviceList();
    int devCnt = devList.size();
    for (int n = 0; n < devCnt; n++) {
      Device dev = devList.getDevice(n);
      dev.setActionListener(listener, true);
    }
  }
}

代码示例来源:origin: i2p/i2p.i2p

DeviceList childDeviceList = getDeviceList();
int childDeviceCnt = childDeviceList.size();
for (int n = 0; n < childDeviceCnt; n++) {

相关文章

Device类方法