Package org.cybergarage.upnp

Examples of org.cybergarage.upnp.DeviceList


   *
   * @see org.cybergarage.upnp.ControlPoint#removeExpiredDevices()
  
   */
  public void removeExpiredDevices() {
    DeviceList devList = getDeviceList();
    int devCnt = devList.size();
    for (int n = 0; n < devCnt; n++) {
      Device dev = devList.getDevice(n);
      if (dev.isExpired() == true) {
                Activator.logger.DEBUG("[Importer] Expired device:"+ dev.getFriendlyName());
        removeDevice(dev);
        removeOSGiExpireDevice(dev);
      }
View Full Code Here


  public Device findDeviceCtrl(ControlPoint ctrl, String udn) {
    /*
     * this return the device looking in all the struct
     */
   
    DeviceList devList = getDeviceList();
    Device dev = null;
    int i = 0;
    while (i < devList.size() && (dev == null)) {
      if (devList.getDevice(i).getUDN().equals(udn)) {
        dev = devList.getDevice(i);
        return dev;
      }
      dev = findDevice(udn, devList.getDevice(i));
      i++; 
    }
    return dev;
  }
View Full Code Here

  public Device findDevice(String udn, Device dev) {
    /*
     * look for the device if it exist, starting from the root on
     * cyberlink struct
     */
    DeviceList devList = dev.getDeviceList();
    Device aux = null;
    for (int i = 0; i < devList.size(); i++) {
      if (devList.getDevice(i).getUDN().equals(udn)) {
        return devList.getDevice(i);
      } else {
        if((aux = findDevice(udn, devList.getDevice(i))) != null)
          return aux;
      }
    }
    return null;
  }
View Full Code Here

    for (Iterator iter = _router.getDeviceList().iterator();iter.hasNext();) {
      Device current = (Device)iter.next();
      if (!current.getDeviceType().equals(WAN_DEVICE))
        continue;

      DeviceList l = current.getDeviceList();
        _logger.info("found "+current.getDeviceType()+", size: "+l.size() + ", on: " + current.getFriendlyName());

      for (int i=0;i<current.getDeviceList().size();i++) {
        Device current2 = l.getDevice(i);

        if (!current2.getDeviceType().equals(WANCON_DEVICE))
          continue;

          _logger.info("found "+current2.getDeviceType() + ", on: " + current2.getFriendlyName());
View Full Code Here

      return false;
    MediaController controller = dmp.getController();
    if (controller == null)
      return false;

    DeviceList devList = controller.getDeviceList();
    int devCnt = devList.size();
    for (int n=0; n<devCnt; n++) {
      Device dev = devList.getDevice(n);
      if (dev.isDeviceType(MediaServer.DEVICE_TYPE) == false)
        continue;
      System.out.println("[" + n +  "] " + dev.getFriendlyName() + ", " + dev.getLeaseTime() + ", " + dev.getElapsedTime());
    }   
View Full Code Here

public class DeviceSetup {

  public static void deviceSetup(Dictionary properties, Device dev,Vector icons,Hashtable services) {
    //TODO if I don't have any device, the size of devlist is 0
    DeviceList devList = dev.getDeviceList();
    /* childrenUDN property */
    if (devList.size() > 0) {
      String[] childrenUDN = new String[devList.size()];
      for (int i = 0; i < devList.size(); i++) {
        childrenUDN[i] = devList.getDevice(i).getUDN();
      }
      properties.put(UPnPDevice.CHILDREN_UDN, childrenUDN);
    }
    /* DEVICE CATEGORY */
    properties.put(
 
View Full Code Here

    if((childs==null)&&(childsUDN==null)){
      return true;     
    }else if((childs==null)||(childsUDN==null)){
      return false;
    }else if(childs.length==childsUDN.length){
            DeviceList dl = d.getDeviceList();
            for (int i = 0; i < childs.length; i++) {
                Device dev = (Device)dl.elementAt(i);
                if(!bindInvokes(dev,childs[i]))
                    return false;
            }

      return true;
View Full Code Here

    v.add(d);
    Device current;
    while (v.size() != 0) {
      current = (Device) v.elementAt(0);
      v.remove(0);
      DeviceList dl = current.getDeviceList();
      for (int i = 0; i < dl.size(); i++) {
        v.add(dl.elementAt(i));
      }
      sb.append("(").append(UPnPDevice.ID).append("=").append(
          current.getUDN()).append(")");
    }
    sb.append(")");
View Full Code Here

   *
   * @see org.cybergarage.upnp.ControlPoint#removeExpiredDevices()
  
   */
  public void removeExpiredDevices() {
    DeviceList devList = getDeviceList();
    int devCnt = devList.size();
    for (int n = 0; n < devCnt; n++) {
      Device dev = devList.getDevice(n);
      if (dev.isExpired() == true) {
                Activator.logger.DEBUG("[Importer] Expired device:"+ dev.getFriendlyName());
        removeDevice(dev);
        removeOSGiExpireDevice(dev);
      }
View Full Code Here

  public Device findDeviceCtrl(ControlPoint ctrl, String udn) {
    /*
     * this return the device looking in all the struct
     */
   
    DeviceList devList = getDeviceList();
    Device dev = null;
    int i = 0;
    while (i < devList.size() && (dev == null)) {
      if (devList.getDevice(i).getUDN().equals(udn)) {
        dev = devList.getDevice(i);
        return dev;
      }
      dev = findDevice(udn, devList.getDevice(i));
      i++; 
    }
    return dev;
  }
View Full Code Here

TOP

Related Classes of org.cybergarage.upnp.DeviceList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.