Examples of UPNPDevice


Examples of org.osgi.service.upnp.UPnPDevice

        throws ServletException
    {
        String deviceUdn = require("udn", request); //$NON-NLS-1$
        String serviceUrn = require("urn", request); //$NON-NLS-1$

        UPnPDevice device = getDevice(deviceUdn);
        return getService(device, serviceUrn);
    }
View Full Code Here

Examples of org.osgi.service.upnp.UPnPDevice

        return getService(device, serviceUrn);
    }

    private final JSONObject deviceTreeToJSON(ServiceReference ref) throws JSONException
    {
        UPnPDevice device = (UPnPDevice) tracker.getService(ref);
        Object[] refs = tracker.getServiceReferences();

        Object parentUdn = ref.getProperty(UPnPDevice.UDN);
        if (parentUdn == null)
        {
View Full Code Here

Examples of org.osgi.service.upnp.UPnPDevice

    /**
     * @see org.osgi.util.tracker.ServiceTrackerCustomizer#addingService(org.osgi.framework.ServiceReference)
     */
    public final Object addingService(ServiceReference ref)
    {
        UPnPDevice device = (UPnPDevice) bc.getService(ref);

        UPnPIcon[] _icons = device.getIcons(null);
        if (_icons != null && _icons.length > 0)
        {
            icons.put(ref.getProperty(UPnPDevice.UDN), _icons[0]);
        }

View Full Code Here

Examples of org.osgi.service.upnp.UPnPDevice

    super(obj);
   
    if (obj.isRoot()) category = ROOT_DEVICE;
    else category = DEVICE;
   
    UPnPDevice device = (UPnPDevice)ctx.getService(obj.getReference());
    UPnPService[] services = device.getServices();
   
    Collection nodeChildren = obj.getChildren();
    if (nodeChildren != null){   
      Iterator list = nodeChildren.iterator();
      while (list.hasNext()){
View Full Code Here

Examples of org.osgi.service.upnp.UPnPDevice

        final UPnPService service = m_control.createMock(UPnPService.class);
        EasyMock.expect(service.getAction("GetLocation")).andReturn(action1).anyTimes();
        EasyMock.expect(service.getAction("GetServerType")).andReturn(action2).anyTimes();

        UPnPDevice device = m_control.createMock(UPnPDevice.class);
        EasyMock.expect(device.getService(EasyMock.isA(String.class))).andReturn(service).anyTimes();

        return device;
    }
View Full Code Here

Examples of org.osgi.service.upnp.UPnPDevice

    @Test(groups = {UNIT})
    public void simpleDiscoverySingleUPnPDevice() throws Exception {

        m_control.reset();

        UPnPDevice device = expectDeviceAdditionForURL(VALID_URL, "RelayServer");
        ServiceReference ref = m_control.createMock(ServiceReference.class);

        m_control.replay();

        m_discovery.added(ref, device);
View Full Code Here

Examples of org.osgi.service.upnp.UPnPDevice

     */
    @Test(groups = {UNIT})
    public void simpleDiscoveryMultipleUPnPDevices() throws Exception {
        m_control.reset();

        UPnPDevice device1 = expectDeviceAdditionForURL(VALID_URL, "RelayServer");
        UPnPDevice device2 = expectDeviceAdditionForURL(INVALID_URL, "RelayServer");

        ServiceReference ref = m_control.createMock(ServiceReference.class);

        m_control.replay();

View Full Code Here

Examples of org.osgi.service.upnp.UPnPDevice

        }
        return 100;
    }

    private UPnPAction getAction(String name) {
        UPnPDevice device = null;

        //zero-order implementation
        if ( m_devices.size() > 0 ) {
            device = (UPnPDevice)m_devices.iterator().next();
        }

        if (device != null) {
                UPnPService svc = device.getService(SERVICE_ID);
                if (svc != null) {
                    return svc.getAction(name);
                }
        }
        return null;
View Full Code Here

Examples of org.osgi.service.upnp.UPnPDevice

        }
        return 100;
    }

    private UPnPAction getAction(String name) {
        UPnPDevice device = null;

        //zero-order implementation
        if ( m_devices.size() > 0 ) {
            device = (UPnPDevice)m_devices.iterator().next();
        }

        if (device != null) {
                UPnPService svc = device.getService(SERVICE_ID);
                if (svc != null) {
                    return svc.getAction(name);
                }
        }
        return null;
View Full Code Here

Examples of org.osgi.service.upnp.UPnPDevice

    } catch (InvalidSyntaxException e) {
      e.printStackTrace();
    }
    if (refs != null) {
      for (int i = 0; i < refs.length; i++) {
        UPnPDevice dev = (UPnPDevice) context.getService(refs[i]);
        Dictionary dic = dev.getDescriptions(null);
        if (((String) dic.get(UPnPDevice.UDN)).equals(udn)) {
          return;
        }
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.