Package org.osgi.service.upnp

Examples of org.osgi.service.upnp.UPnPAction


    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);
      Mediator.getPropertiesViewer().setAction(action);
    }
    else if (node.category.equals(UPnPDeviceTreeNode.STATE)
            ||node.category.equals(UPnPDeviceTreeNode.EVENTED_STATE)
View Full Code Here


  public TimerService(){
    time = new TimeStateVariable();
    result = new ResultStateVariable();
    this.states = new UPnPStateVariable[]{time,result};
   
    UPnPAction setTime= new SetTimeAction(time,result);
    UPnPAction getTime = new GetTimeAction((TimeStateVariable)time);
    actions.put(setTime.getName(),setTime);
    actions.put(getTime.getName(),getTime);
   
  }
View Full Code Here

                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

                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

    this.model = model;
    status = new StatusStateVariable(model);
    target = new TargetStateVariable();
    this.states = new UPnPStateVariable[]{status,target};
   
    UPnPAction setTarget = new SetTargetAction(model,target);
    UPnPAction getTarget = new GetTargetAction(model,target);
    UPnPAction getStatus = new GetStatusAction(model,status);
    actions.put(setTarget.getName(),setTarget);
    actions.put(getTarget.getName(),getTarget);
    actions.put(getStatus.getName(),getStatus);
   
  }
View Full Code Here

    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

  public PowerService(){
    power = new PowerStateVariable();
    result = new ResultStateVariable();
    this.states = new UPnPStateVariable[]{power,result};
   
    UPnPAction setPower= new SetPowerAction(power,result);
    UPnPAction getPower = new GetPowerAction(power);
    actions.put(setPower.getName(),setPower);
    actions.put(getPower.getName(),getPower);
   
  }
View Full Code Here

        p.put(returnLocation, url);
        p.put(returnType, type);

        m_control.checkOrder(false);

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

        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();
View Full Code Here

        return null;
    }

    private URL getLocation() {
        UPnPAction action = getAction(ACTION_GET_LOCATION);
        try {
            Dictionary dict = action.invoke(null);
            String location = (String)dict.get(action.getOutputArgumentNames()[0]);
            return new URL(location);
        }
        catch (Exception e) {}
        return null;
    }
View Full Code Here

        catch (Exception e) {}
        return null;
    }

    private String getType() {
        UPnPAction action = getAction(ACTION_GET_TYPE);
        try {
            Dictionary dict = action.invoke(null);
            return (String)dict.get(action.getOutputArgumentNames()[0]);
        }
        catch (Exception e) {}
        return "Unknown";
    }
View Full Code Here

TOP

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

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.