Package org.osgi.service.upnp

Examples of org.osgi.service.upnp.UPnPService


      DeviceNode device = (DeviceNode) node.getUserObject();
      UPnPDevice upnpDevice = device.getDevice(Activator.context);
      makeProperties(upnpDevice);
    }
    else if (node.category.equals(UPnPDeviceTreeNode.SERVICE)){
      UPnPService service = (UPnPService) node.getUserObject();     
      makeProperties(service);
    }
    else if (node.category.equals(UPnPDeviceTreeNode.ACTION)){
      UPnPAction action = (UPnPAction) node.getUserObject();
      makeProperties(action);
View Full Code Here


                    UPnPDeviceTreeNode parent =  (UPnPDeviceTreeNode)selectedNode.getParent();
                    while (parent.category!=UPnPDeviceTreeNode.ROOT_DEVICE)
                         parent =  (UPnPDeviceTreeNode)parent.getParent();
                    DeviceNode device =  (DeviceNode) parent.getUserObject();
                    String udn = (String)device.getReference().getProperty(UPnPDevice.UDN);
                    UPnPService service =  (UPnPService) selectedNode.getUserObject();
                    url = Mediator.getDriverProxy().getServiceDescriptionURI(udn,service.getId());
                }                   
                Util.openUrl(url);  
            }
        })).setText("Show Description");
        addPopupMenuListener(this);
View Full Code Here

        UPnPDevice dev = (UPnPDevice) tracker.getService(ref);
        if (null == dev)
            return;

        UPnPService services[] = dev.getServices();
        if (null != services && services.length > 0)
        {
            pw.println("  Services:");
            for (int i = 0; i < services.length; i++)
            {
View Full Code Here

                    }
                }
            }
            else if ("serviceDetails".equals(method)) //$NON-NLS-1$
            {
                UPnPService service = requireService(request);
                SessionObject session = getSession(request)//
                .subscribe(require("udn", request), service.getId()); //$NON-NLS-1$

                json = Serializer.serviceToJSON(service, session);
            }
            else if ("invokeAction".equals(method)) //$NON-NLS-1$
            {
                UPnPService service = requireService(request);
                UPnPAction action = service.getAction(require("actionID", request)); //$NON-NLS-1$

                json = invoke(action, //
                    request.getParameterValues("names"), //$NON-NLS-1$
                    request.getParameterValues("vals")); //$NON-NLS-1$
            }
View Full Code Here

                    }
                }
            }
            else if ("serviceDetails".equals(method)) //$NON-NLS-1$
            {
                UPnPService service = requireService(request);
                SessionObject session = getSession(request)//
                .subscribe(require("udn", request), service.getId()); //$NON-NLS-1$

                json = serviceToJSON(service, session);
            }
            else if ("invokeAction".equals(method)) //$NON-NLS-1$
            {
                UPnPService service = requireService(request);
                UPnPAction action = service.getAction(require("actionID", request)); //$NON-NLS-1$

                json = invoke(action, //
                    request.getParameterValues("names"), //$NON-NLS-1$
                    request.getParameterValues("vals")); //$NON-NLS-1$
            }
View Full Code Here

    if (category.equals(DEVICE)||category.equals(ROOT_DEVICE)){
      DeviceNode node =  (DeviceNode) getUserObject();
      return node.toString();
    }
    else if (category.equals(SERVICE)){
      UPnPService node =  (UPnPService) getUserObject();
      return node.getType();
    }
    else if (category.equals(ACTION)){
      UPnPAction node =  (UPnPAction) getUserObject();
      return node.getName();
    }
    else if (category.equals(STATE) ||category.equals(EVENTED_STATE)||category.equals(SUBSCRIBED_STATE)){
      UPnPStateVariable node =  (UPnPStateVariable) getUserObject();
      return node.getName();
    }
    else
      return getUserObject().toString();
  }
View Full Code Here

        final UPnPAction action2 = m_control.createMock(UPnPAction.class);
        EasyMock.expect(action2.getOutputArgumentNames()).andReturn(new String[]{returnType}).anyTimes();
        EasyMock.expect(action2.invoke(null)).andReturn(p).anyTimes();

        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

        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

        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

  /**
   * @see org.cybergarage.upnp.control.ActionListener#actionControlReceived(org.cybergarage.upnp.Action)
   */
  public synchronized boolean actionControlReceived(Action upnpAct) {
    if(!open) return false;     
    UPnPService osgiServ=null;
    try{
      osgiServ=((UPnPDevice) Activator.bc.getService(dev)).getService(id)
    }catch(Exception ignored){}
   
    if(osgiServ==null)
      return exiting(false);
   
    UPnPAction osgiAct = osgiServ.getAction(upnpAct.getName());
    Properties inArgs = null;
    ArgumentList alIn = upnpAct.getInputArgumentList();
    ArgumentList alOut = upnpAct.getOutputArgumentList();
    String[] inArg = osgiAct.getInputArgumentNames();
    boolean invalidAction=false;
View Full Code Here

TOP

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

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.