Examples of UPnPAction


Examples of org.osgi.service.upnp.UPnPAction

  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

Examples of org.osgi.service.upnp.UPnPAction

                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

Examples of org.osgi.service.upnp.UPnPAction

                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

Examples of org.osgi.service.upnp.UPnPAction

    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

Examples of org.osgi.service.upnp.UPnPAction

    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

Examples of org.osgi.service.upnp.UPnPAction

  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

Examples of org.osgi.service.upnp.UPnPAction

        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

Examples of org.osgi.service.upnp.UPnPAction

        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

Examples of org.osgi.service.upnp.UPnPAction

        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

Examples of org.osgi.service.upnp.UPnPAction

        catch (Exception e) {}
        return "Unknown";
    }

    private int getLoad() {
        UPnPAction action = getAction(ACTION_GET_LOAD);
        try {
            Dictionary dict = action.invoke(null);
            Integer val = (Integer)dict.get(action.getOutputArgumentNames()[0]);
            return val.intValue();
        }
        catch (Exception e) {
            //ignore, just report worst case
        }
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.