Package org.osgi.service.upnp

Examples of org.osgi.service.upnp.UPnPDevice


        }
    }

    private final UPnPDevice getDevice(String udn)
    {
        final UPnPDevice device;
        synchronized (cacheLock)
        {
          fillCache();
          device = (UPnPDevice) devices.get(udn);
        }
View Full Code Here


        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

        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

    /**
     * @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

    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

        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

    @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

     */
    @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

        }
        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

        }
        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

TOP

Related Classes of org.osgi.service.upnp.UPnPDevice

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.