Package org.teleal.cling.model.action

Examples of org.teleal.cling.model.action.ActionInvocation


  public boolean updateZoneInfo() {
    if(stateMap != null && isConfigured()) {
      Service service = device.findService(new UDAServiceId("DeviceProperties"));
      Action action = service.getAction("GetZoneInfo");
      ActionInvocation invocation = new ActionInvocation(action);

      executeActionInvocation(invocation);

      Service anotherservice = device.findService(new UDAServiceId("DeviceProperties"));
      Action anotheraction = service.getAction("GetZoneAttributes");
      ActionInvocation anotherinvocation = new ActionInvocation(anotheraction);

      executeActionInvocation(anotherinvocation);


      //       anotherservice = device.findService(new UDAServiceId("ZoneGroupTopology"));
View Full Code Here


    if(string != null && isConfigured()) {

      Service service = device.findService(new UDAServiceId("DeviceProperties"));
      Action action = service.getAction("SetLEDState");
      ActionInvocation invocation = new ActionInvocation(action);

      try {
        if(string.equals("ON") || string.equals("OPEN") || string.equals("UP") ) {
          invocation.setInput("DesiredLEDState", "On");             
        } else

          if(string.equals("OFF") || string.equals("CLOSED") || string.equals("DOWN") ) {
            invocation.setInput("DesiredLEDState", "Off");             
          } else {
            return false;
          }
      } catch (InvalidValueException ex) {
        logger.error("Action Invalid Value Exception {}",ex.getMessage());
View Full Code Here

    if(isConfigured()) {

      Service service = device.findService(new UDAServiceId("DeviceProperties"));
      Action action = service.getAction("GetLEDState");
      ActionInvocation invocation = new ActionInvocation(action);

      executeActionInvocation(invocation);

      return true
    }
View Full Code Here

    if(isConfigured()) {

      Service service = device.findService(new UDAServiceId("DeviceProperties"));
      Action action = service.getAction("GetZoneAttributes");
      ActionInvocation invocation = new ActionInvocation(action);

      executeActionInvocation(invocation);

      return true
    }
View Full Code Here

    if(isConfigured()) {

      Service service = device.findService(new UDAServiceId("AVTransport"));
      Action action = service.getAction("GetPositionInfo");
      ActionInvocation invocation = new ActionInvocation(action);

      executeActionInvocation(invocation);

      return true
    }
View Full Code Here

  protected boolean seek(String unit, String target) {
    if(isConfigured() && unit != null && target != null) {
      Service service = device.findService(new UDAServiceId("AVTransport"));
      Action action = service.getAction("Seek");
      ActionInvocation invocation = new ActionInvocation(action);

      try {
        invocation.setInput("InstanceID","0");
        invocation.setInput("Unit", unit);
        invocation.setInput("Target", target);
      } catch (InvalidValueException ex) {
        logger.error("Action Invalid Value Exception {}",ex.getMessage());
      } catch (NumberFormatException ex) {
        logger.error("Action Invalid Value Format Exception {}",ex.getMessage())
      }
View Full Code Here

    if(isConfigured() && URI != null && meta != null) {

      Service service = device.findService(new UDAServiceId("AVTransport"));
      Action action = service.getAction("AddURIToQueue");
      ActionInvocation invocation = new ActionInvocation(action);

      try {
        invocation.setInput("InstanceID","0");
        invocation.setInput("EnqueuedURI",URI);
        invocation.setInput("EnqueuedURIMetaData",meta);
        invocation.setInput("DesiredFirstTrackNumberEnqueued",new UnsignedIntegerFourBytes(desiredFirstTrack));
        invocation.setInput("EnqueueAsNext",enqueueAsNext);

      } catch (InvalidValueException ex) {
        logger.error("Action Invalid Value Exception {}",ex.getMessage());
      } catch (NumberFormatException ex) {
        logger.error("Action Invalid Value Format Exception {}",ex.getMessage())
View Full Code Here

    if(isConfigured()) {

      Service service = device.findService(new UDAServiceId("AVTransport"));
      Action action = service.getAction("GetMediaInfo");
      ActionInvocation invocation = new ActionInvocation(action);

      try {
        invocation.setInput("InstanceID","0");
      } catch (InvalidValueException ex) {
        logger.error("Action Invalid Value Exception {}",ex.getMessage());
      } catch (NumberFormatException ex) {
        logger.error("Action Invalid Value Format Exception {}",ex.getMessage())
      }
View Full Code Here

  public boolean setCurrentURI(String URI, String URIMetaData ) {
    if(URI != null && URIMetaData != null && isConfigured()) {

      Service service = device.findService(new UDAServiceId("AVTransport"));
      Action action = service.getAction("SetAVTransportURI");
      ActionInvocation invocation = new ActionInvocation(action);

      try {
        invocation.setInput("InstanceID","0");
        invocation.setInput("CurrentURI",URI);
        invocation.setInput("CurrentURIMetaData", URIMetaData);
      } catch (InvalidValueException ex) {
        logger.error("Action Invalid Value Exception {}",ex.getMessage());
      } catch (NumberFormatException ex) {
        logger.error("Action Invalid Value Format Exception {}",ex.getMessage())
      }
View Full Code Here

      long startAt = 0;

      Service service = device.findService(new UDAServiceId("ContentDirectory"));
      Action action = service.getAction("Browse");
      ActionInvocation invocation = new ActionInvocation(action);
      try {
        invocation.setInput("ObjectID",type);
        invocation.setInput("BrowseFlag","BrowseDirectChildren");
        invocation.setInput("Filter", filter);
        invocation.setInput("StartingIndex",new UnsignedIntegerFourBytes(startAt));
        invocation.setInput("RequestedCount",new UnsignedIntegerFourBytes( 200));
        invocation.setInput("SortCriteria","");
      } catch (InvalidValueException ex) {
        logger.error("Action Invalid Value Exception {}",ex.getMessage());
      } catch (NumberFormatException ex) {
        logger.error("Action Invalid Value Format Exception {}",ex.getMessage())
      }
      // Execute this action synchronously
      new ActionCallback.Default(invocation, upnpService.getControlPoint()).run();

      Long totalMatches  = ((UnsignedIntegerFourBytes) invocation.getOutput("TotalMatches").getValue()).getValue();
      Long initialNumberReturned  = ((UnsignedIntegerFourBytes) invocation.getOutput("NumberReturned").getValue()).getValue();
      String initialResult = (String) invocation.getOutput("Result").getValue();

      try {
        resultList = SonosXMLParser.getEntriesFromString(initialResult);
      } catch (SAXException e) {
        logger.error("Could not parse Entries from String {}",initialResult);
      }

      startAt = startAt + initialNumberReturned;

      while(startAt<totalMatches){
        invocation = new ActionInvocation(action);
        try {
          invocation.setInput("ObjectID",type);
          invocation.setInput("BrowseFlag","BrowseDirectChildren");
          invocation.setInput("Filter", filter);
          invocation.setInput("StartingIndex",new UnsignedIntegerFourBytes(startAt));
          invocation.setInput("RequestedCount",new UnsignedIntegerFourBytes( 200));
          invocation.setInput("SortCriteria","");
        } catch (InvalidValueException ex) {
          logger.error("Action Invalid Value Exception {}",ex.getMessage());
        } catch (NumberFormatException ex) {
          logger.error("Action Invalid Value Format Exception {}",ex.getMessage())
        }
        // Execute this action synchronously
        new ActionCallback.Default(invocation, upnpService.getControlPoint()).run();
        String result = (String) invocation.getOutput("Result").getValue();
        int numberReturned  = (Integer) invocation.getOutput("NumberReturned").getValue();

        try {
          resultList.addAll(SonosXMLParser.getEntriesFromString(result));
        } catch (SAXException e) {
          logger.error("Could not parse Entries from String {}",result);
View Full Code Here

TOP

Related Classes of org.teleal.cling.model.action.ActionInvocation

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.