Package org.hpi.dialogue.protocol.response

Examples of org.hpi.dialogue.protocol.response.ExecuteInvokerResponse


  }
 
  @Override
  public String execute(HPIClientProtocol clientProtocol) {
    // execute invoker
    ExecuteInvokerResponse executeResponse = clientProtocol.executeInvoker(this.getSessionId(), this.invoker);
    if (executeResponse.getStatus().equals(Response.Status.SUCCESS)) {
      return executeResponse.getMessage();
    } else if (executeResponse.getStatus().equals(Response.Status.FAIL)) {
      return executeResponse.getMessage();
    } else throw new IllegalStateException("Unkonw the server's status code response");
  }
View Full Code Here


       
        return new DescribeInvokerResponse(invoker, responseMessage, responseStatus);
      } else if (serviceName.equals(HPIDialogueConstants.LOGOFF_SERVICE)) {
        return new LogoffResponse(responseMessage, responseStatus);
      } else if (serviceName.equals(HPIDialogueConstants.EXECUTE_INVOKER_SERVICE)) {
        return new ExecuteInvokerResponse(responseMessage, responseStatus);
      } else throw new RuntimeException("Unknow value to " + HPIDialogueConstants.SERVICE_NAME + ", the value is: " + serviceName);
    } else if (serviceType.equals(HPIDialogueConstants.REQUEST_SERVICE)) {
      if (serviceName.equals(HPIDialogueConstants.LOGIN_SERVICE)) {
        return new LoginRequest(
          new User(
View Full Code Here

        Alert a = null;
        try {
            HPIClientProtocol hpiClientProtocol = this.parent.getParent().getParent().getHPIClientProtocol();
            LoginResponse loginResponse = this.parent.getParent().getParent().getLoginResponse();
           
            ExecuteInvokerResponse executeInvokerResponse = hpiClientProtocol.executeInvoker(loginResponse.getSessionId(), this.parent.getInvokerId());
            if (executeInvokerResponse.getStatus().equals(Response.Status.SUCCESS)) {
                HPIUiAlert.show("Execution Invoker Response", executeInvokerResponse.getMessage(), "Ok", this.parent.getForm());
            } else {
                HPIUiAlert.show("Error on execution Invoker", executeInvokerResponse.getMessage(), "Ok", this.parent.getForm());
            }
        } catch (Exception e) {
            HPIUiAlert.show("Server Message", e.getMessage(), "Done", this.parent.getForm());
        }
    }
View Full Code Here

       
        return new DescribeInvokerResponse(invoker, responseMessage, responseStatus);
      } else if (serviceName.equals(HPIDialogueConstants.LOGOFF_SERVICE)) {
        return new LogoffResponse(responseMessage, responseStatus);
      } else if (serviceName.equals(HPIDialogueConstants.EXECUTE_INVOKER_SERVICE)) {
        return new ExecuteInvokerResponse(responseMessage, responseStatus);
      } else throw new RuntimeException("Unknow value to " + HPIDialogueConstants.SERVICE_NAME + ", the value is: " + serviceName);
    } else if (serviceType.equals(HPIDialogueConstants.REQUEST_SERVICE)) {
      if (serviceName.equals(HPIDialogueConstants.LOGIN_SERVICE)) {
        return new LoginRequest(
          new User(
View Full Code Here

      Invoker invoker = dataFactory.getInvoker(clientRequest.getInvokeId());
     
      if (invoker != null) {
        ExecuteInvoker service = new ExecuteInvoker(invoker);
        String executionResult = service.runExecutables();
        return new ExecuteInvokerResponse(executionResult, Response.Status.SUCCESS);
      } else {
        return new ExecuteInvokerResponse("No invoker was found for the id: " + clientRequest.getInvokeId(), Response.Status.FAIL);
      }
    } catch (HPISessionException e) {
      return new ExecuteInvokerResponse("The session is not valid. " + e.getMessage(), Response.Status.FAIL);
    } catch (HPIExecuteInvokerException e) {
      return new ExecuteInvokerResponse("Error executing invoker. " + e.getMessage(), Response.Status.FAIL);
    }
  }
View Full Code Here

TOP

Related Classes of org.hpi.dialogue.protocol.response.ExecuteInvokerResponse

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.