Package org.hpi.dialogue.protocol.entities

Examples of org.hpi.dialogue.protocol.entities.Invoker


    public SSDObjectNode getSSDParameters() {
        SSDObjectNode parameters = new SSDObjectNode(HPIDialogueConstants.PARAMETERS);
        SSDObjectArray listInvokers = new SSDObjectArray(HPIDialogueConstants.LIST_INVOKERS);
        if (this.listInvokers != null && this.listInvokers.size() > 0) {
            for (int i = 0; i < this.listInvokers.size(); i++) {
                Invoker invoker = (Invoker) this.listInvokers.elementAt(i);
                SSDObjectNode ssdInvoker = new SSDObjectNode(HPIDialogueConstants.INVOKER);
                ssdInvoker.addAttribute(new SSDObjectLeaf(HPIDialogueConstants.ID, invoker.getId()));
                ssdInvoker.addAttribute(new SSDObjectLeaf(HPIDialogueConstants.DESCRIPTION, invoker.getDescription()));

                SSDObjectArray ssdExecutables = new SSDObjectArray(HPIDialogueConstants.EXECUTABLES);
                if (invoker.getExecutables() != null && invoker.getExecutables().size() > 0) {
                    for (int e = 0; e < invoker.getExecutables().size(); e++) {
                        Executable executable = (Executable) invoker.getExecutables().elementAt(e);
                        SSDObjectNode ssdExecutable = new SSDObjectNode(HPIDialogueConstants.EXECUTABLE);
                        ssdExecutable.addAttribute(new SSDObjectLeaf(HPIDialogueConstants.CANONICAL_PATH, executable.getCanonicalPath()));

                        SSDObjectArray ssdParemeters = new SSDObjectArray(HPIDialogueConstants.PARAMETERS);
                        if (executable.getParameters() != null && executable.getParameters().size() > 0) {
View Full Code Here


        List<Invoker> listInvokers = new ArrayList<Invoker>();
       
        SSDObjectArray ssdListInvokers = parameters.getArray(HPIDialogueConstants.LIST_INVOKERS);
        for (int i = 0; i < ssdListInvokers.getSize(); i ++) {
          SSDObjectNode ssdInvoker = ssdListInvokers.getNode(i);
          Invoker invoker = new Invoker();
          invoker.setId(ssdInvoker.getLeaf(HPIDialogueConstants.ID).getValue());
          invoker.setDescription(ssdInvoker.getLeaf(HPIDialogueConstants.DESCRIPTION).getValue());
         
          SSDObjectArray ssdExecutables = ssdInvoker.getArray(HPIDialogueConstants.EXECUTABLES);
          for (int e = 0; e < ssdExecutables.getSize(); e ++) {
            SSDObjectNode ssdExecutable = ssdExecutables.getNode(e);
            Executable executable = new Executable();
            executable.setCanonicalPath(ssdExecutable.getLeaf(HPIDialogueConstants.CANONICAL_PATH).getValue());
           
            SSDObjectArray ssdParameters = ssdExecutable.getArray(HPIDialogueConstants.PARAMETERS);
            for (int p = 0; p < ssdParameters.getSize(); p ++) {
              SSDObjectNode ssdParameter = ssdParameters.getNode(p);
              Parameter parameter = new Parameter();
              parameter.setKey(ssdParameter.getLeaf(HPIDialogueConstants.KEY).getValue());
              parameter.setValue(ssdParameter.getLeaf(HPIDialogueConstants.VALUE).getValue());
             
              executable.getParameters().add(parameter);
            }
           
            invoker.getExecutables().add(executable);
          }
         
          listInvokers.add(invoker);
        }
       
        return new ListInvokersResponse(listInvokers, responseMessage, responseStatus);
      } else if (serviceName.equals(HPIDialogueConstants.DESCRIBE_INVOKER_SERVICE)) {
        SSDObjectNode ssdInvoker = parameters.getNode(HPIDialogueConstants.INVOKER);
        Invoker invoker = new Invoker();
        invoker.setId(ssdInvoker.getLeaf(HPIDialogueConstants.ID).getValue());
        invoker.setDescription(ssdInvoker.getLeaf(HPIDialogueConstants.DESCRIPTION).getValue());
       
        SSDObjectArray ssdExecutables = ssdInvoker.getArray(HPIDialogueConstants.EXECUTABLES);
        for (int e = 0; e < ssdExecutables.getSize(); e ++) {
          SSDObjectNode ssdExecutable = ssdExecutables.getNode(e);
          Executable executable = new Executable();
          executable.setCanonicalPath(ssdExecutable.getLeaf(HPIDialogueConstants.CANONICAL_PATH).getValue());
         
          SSDObjectArray ssdParameters = ssdExecutable.getArray(HPIDialogueConstants.PARAMETERS);
          for (int p = 0; p < ssdParameters.getSize(); p ++) {
            SSDObjectNode ssdParameter = ssdParameters.getNode(p);
            Parameter parameter = new Parameter();
            parameter.setKey(ssdParameter.getLeaf(HPIDialogueConstants.KEY).getValue());
            parameter.setValue(ssdParameter.getLeaf(HPIDialogueConstants.VALUE).getValue());
           
            executable.getParameters().add(parameter);
          }
         
          invoker.getExecutables().add(executable);
        }
       
        return new DescribeInvokerResponse(invoker, responseMessage, responseStatus);
      } else if (serviceName.equals(HPIDialogueConstants.LOGOFF_SERVICE)) {
        return new LogoffResponse(responseMessage, responseStatus);
View Full Code Here

                if (listSize == 0) {
                    idsInvokers = new String[]{"The server has not found no invoker."};
                } else {
                    idsInvokers = new String[listSize];
                    for (int i = 0; i < listSize; i++) {
                        Invoker invoker = (Invoker) listInvokersResponse.getListInvokers().elementAt(i);
                        idsInvokers[i] = invoker.getId();
                    }
                }
               
                Image[] imageArray = null;
               
View Full Code Here

        Vector listInvokers = new Vector();
       
        SSDObjectArray ssdListInvokers = parameters.getArray(HPIDialogueConstants.LIST_INVOKERS);
        for (int i = 0; i < ssdListInvokers.getSize(); i ++) {
          SSDObjectNode ssdInvoker = ssdListInvokers.getNode(i);
          Invoker invoker = new Invoker();
          invoker.setId(ssdInvoker.getLeaf(HPIDialogueConstants.ID).getValue());
          invoker.setDescription(ssdInvoker.getLeaf(HPIDialogueConstants.DESCRIPTION).getValue());
         
          SSDObjectArray ssdExecutables = ssdInvoker.getArray(HPIDialogueConstants.EXECUTABLES);
          for (int e = 0; e < ssdExecutables.getSize(); e ++) {
            SSDObjectNode ssdExecutable = ssdExecutables.getNode(e);
            Executable executable = new Executable();
            executable.setCanonicalPath(ssdExecutable.getLeaf(HPIDialogueConstants.CANONICAL_PATH).getValue());
           
            SSDObjectArray ssdParameters = ssdExecutable.getArray(HPIDialogueConstants.PARAMETERS);
            for (int p = 0; p < ssdParameters.getSize(); p ++) {
              SSDObjectNode ssdParameter = ssdParameters.getNode(p);
              Parameter parameter = new Parameter();
              parameter.setKey(ssdParameter.getLeaf(HPIDialogueConstants.KEY).getValue());
              parameter.setValue(ssdParameter.getLeaf(HPIDialogueConstants.VALUE).getValue());
             
              executable.getParameters().addElement(parameter);
            }
           
            invoker.getExecutables().addElement(executable);
          }
         
          listInvokers.addElement(invoker);
        }
       
        return new ListInvokersResponse(listInvokers, responseMessage, responseStatus);
      } else if (serviceName.equals(HPIDialogueConstants.DESCRIBE_INVOKER_SERVICE)) {
        SSDObjectNode ssdInvoker = parameters.getNode(HPIDialogueConstants.INVOKER);
        Invoker invoker = new Invoker();
        invoker.setId(ssdInvoker.getLeaf(HPIDialogueConstants.ID).getValue());
        invoker.setDescription(ssdInvoker.getLeaf(HPIDialogueConstants.DESCRIPTION).getValue());
       
        SSDObjectArray ssdExecutables = ssdInvoker.getArray(HPIDialogueConstants.EXECUTABLES);
        for (int e = 0; e < ssdExecutables.getSize(); e ++) {
          SSDObjectNode ssdExecutable = ssdExecutables.getNode(e);
          Executable executable = new Executable();
          executable.setCanonicalPath(ssdExecutable.getLeaf(HPIDialogueConstants.CANONICAL_PATH).getValue());
         
          SSDObjectArray ssdParameters = ssdExecutable.getArray(HPIDialogueConstants.PARAMETERS);
          for (int p = 0; p < ssdParameters.getSize(); p ++) {
            SSDObjectNode ssdParameter = ssdParameters.getNode(p);
            Parameter parameter = new Parameter();
            parameter.setKey(ssdParameter.getLeaf(HPIDialogueConstants.KEY).getValue());
            parameter.setValue(ssdParameter.getLeaf(HPIDialogueConstants.VALUE).getValue());
           
            executable.getParameters().addElement(parameter);
          }
         
          invoker.getExecutables().addElement(executable);
        }
       
        return new DescribeInvokerResponse(invoker, responseMessage, responseStatus);
      } else if (serviceName.equals(HPIDialogueConstants.LOGOFF_SERVICE)) {
        return new LogoffResponse(responseMessage, responseStatus);
View Full Code Here

            this.invokerId = this.parent.getFormList().getString(this.parent.getFormList().getSelectedIndex());
            HPIClientProtocol clientProtocol = this.parent.getParent().getHPIClientProtocol();
           
            DescribeInvokerResponse describeInvokerResponse = clientProtocol.describeInvoker(loginResponse.getSessionId(), invokerId);
            if (describeInvokerResponse.getStatus().equals(Response.Status.SUCCESS)) {
                Invoker invoker = describeInvokerResponse.getInvoker();
               
                this.lblInvokerId = new StringItem("Invoker Id: ",  invoker.getId());
                this.lblInvokerDescription = new StringItem("Invoker Description: ",  invoker.getDescription());
               
                this.cmdBack = new Command("Back", Command.EXIT, 1);
                this.cmdExecuteInvoker = new Command("Execute Invoker", Command.ITEM, 1);
               
                this.getForm().append(this.lblInvokerId);
View Full Code Here

    try {
      HPISessionManager sessionManager = HPISessionManager.getInstance();
      sessionManager.updateSession(clientRequest.getSessionId());
     
      HPIDataFactory dataFactory = HPIDataFactory.getInstance();
      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);
View Full Code Here

   *
   * @param clientRequest
   * @return
   */
  private Response describeInvoker(DescribeInvokerRequest clientRequest) {
    Invoker invoker = null;
    try {
      HPISessionManager sessionManager = HPISessionManager.getInstance();
      sessionManager.updateSession(clientRequest.getSessionId());
      HPIDataFactory dataFactory = HPIDataFactory.getInstance();
      invoker = dataFactory.getInvoker(clientRequest.getInvokeId());
View Full Code Here

    log.info("Adding a new invokerFile: " + invokerFile.getName());
   
    SSDContextManager ssdCtx = SSDContextManager.build(invokerFile);
    SSDRootObject root = ssdCtx.getRootObject();
   
    Invoker invoker = new Invoker(FileHelper.removeExtension(invokerFile.getName()));
    invoker.setDescription(root.getLeaf(HPIConstants.DESCRIPTION_INVOKER_FILE).getValue());
   
    SSDObjectArray ssdExecutables = root.getArray(HPIConstants.EXECUTABLES_INVOKER_FILE);
    for (int i = 0; i < ssdExecutables.getSize(); i++) {
      SSDObjectNode ssdExecutable = ssdExecutables.getNode(i);;
      Executable executable = new Executable();
      executable.setCanonicalPath(ssdExecutable.getLeaf(HPIConstants.CANONICAL_PATH_INVOKER_FILE).getValue());
     
      SSDObjectArray ssdParameters = ssdExecutable.getArray(HPIConstants.PARAMETERS_INVOKER_FILE);
      for (int j = 0; j < ssdParameters.getSize(); j++) {
        SSDObjectNode ssdParameter = ssdParameters.getNode(j);
        Parameter parameter = new Parameter();
        parameter.setKey(ssdParameter.getLeaf(HPIConstants.KEY_INVOKER_FILE).getValue());
        parameter.setValue(ssdParameter.getLeaf(HPIConstants.VALUE_INVOKER_FILE).getValue());
        executable.getParameters().add(parameter);
      }
      invoker.getExecutables().add(executable);
    }
   
    HPIDataFactory.getInstance().addInvoker(invoker);
  }
View Full Code Here

TOP

Related Classes of org.hpi.dialogue.protocol.entities.Invoker

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.