Exemple #1
0
 public boolean postControlAction() {
   // Thanks for Giordano Sassaroli <*****@*****.**> (08/30/03)
   ArgumentList actionArgList = getArgumentList();
   ArgumentList actionInputArgList = getInputArgumentList();
   ActionRequest ctrlReq = new ActionRequest();
   ctrlReq.setRequest(this, actionInputArgList);
   if (Debug.isOn() == true) ctrlReq.print();
   ActionResponse ctrlRes = ctrlReq.post();
   if (Debug.isOn() == true) ctrlRes.print();
   setControlResponse(ctrlRes);
   // Thanks for Dimas <*****@*****.**> and Stefano Lenzi
   // <*****@*****.**> (07/09/04)
   int statCode = ctrlRes.getStatusCode();
   setStatus(statCode);
   if (ctrlRes.isSuccessful() == false) return false;
   ArgumentList outArgList = ctrlRes.getResponse();
   try {
     actionArgList.setResArgs(outArgList);
   } catch (IllegalArgumentException ex) {
     setStatus(
         UPnPStatus.INVALID_ARGS, "Action succesfully delivered but invalid arguments returned.");
     return false;
   }
   return true;
 }
Exemple #2
0
 public boolean performActionListener(ActionRequest actionReq) {
   ActionListener listener = (ActionListener) getActionListener();
   if (listener == null) return false;
   ActionResponse actionRes = new ActionResponse();
   setStatus(UPnPStatus.INVALID_ACTION);
   clearOutputAgumentValues();
   if (listener.actionControlReceived(this) == true) {
     actionRes.setResponse(this);
   } else {
     UPnPStatus upnpStatus = getStatus();
     actionRes.setFaultResponse(upnpStatus.getCode(), upnpStatus.getDescription());
   }
   if (Debug.isOn() == true) actionRes.print();
   actionReq.post(actionRes);
   return true;
 }