Package org.simplestructruedata.entities

Examples of org.simplestructruedata.entities.SSDObjectNode


    public String getServiceName() {
        return HPIDialogueConstants.LOGOFF_SERVICE;
    }

    public SSDObjectNode getSSDParameters() {
        SSDObjectNode parameters = new SSDObjectNode(HPIDialogueConstants.PARAMETERS);
        parameters.addAttribute(new SSDObjectLeaf(HPIDialogueConstants.SESSION_ID, this.getSessionId()));
        return parameters;
    }
View Full Code Here


    public String getServiceName() {
        return HPIDialogueConstants.LOGIN_SERVICE;
    }

    public SSDObjectNode getSSDParameters() {
        SSDObjectNode parameters = new SSDObjectNode(HPIDialogueConstants.PARAMETERS);
        parameters.addAttribute(new SSDObjectLeaf(HPIDialogueConstants.NICKNAME, this.getUser().getNickname()));
        parameters.addAttribute(new SSDObjectLeaf(HPIDialogueConstants.PASSPHRASE, this.getUser().getPassphrase()));
        return parameters;
    }
View Full Code Here

  public String getServiceName() {
            return HPIDialogueConstants.DESCRIBE_INVOKER_SERVICE;
  }
 
  public SSDObjectNode getSSDParameters() {
            SSDObjectNode parameters = new SSDObjectNode(HPIDialogueConstants.PARAMETERS);
            parameters.addAttribute(new SSDObjectLeaf(HPIDialogueConstants.SESSION_ID, this.getSessionId()));
            parameters.addAttribute(new SSDObjectLeaf(HPIDialogueConstants.INVOKER_ID, this.getInvokeId()));
            return parameters;
  }
View Full Code Here

   
    try {
      // load users to Factory Manager
      SSDObjectArray ssdUsers = ssdSettingsData.getArray(HPIConstants.CONFIGURATIONS_USERS);
      for (int i = 0; i < ssdUsers.getSize(); i++) {
        SSDObjectNode ssdUser = ssdUsers.getNode(i);
        String passphrase = ssdUser.getLeaf(HPIConstants.CONFIGURATIONS_USERS_PASSPHRASE).getValue();
        String nickname = ssdUser.getLeaf(HPIConstants.CONFIGURATIONS_USERS_NICKNAME).getValue();
        this.addUser(new User(nickname, passphrase));
      }
     
      // instantiate the data watcher object, because afeter it will be started to watch some directory(ies)
      DataWatcher dataWatcher = new DataWatcher();
     
      // first load to invokers SSD files
      SSDObjectArray ssdMappedFolders = ssdSettingsData.getArray(HPIConstants.CONFIGURATIONS_MAPPED_FOLDER);
      for (int i = 0; i < ssdMappedFolders.getSize(); i++) {
        SSDObjectNode ssdMappedFolder = ssdMappedFolders.getNode(i);
        File mappedFolder = null;
        if (ssdMappedFolder.get(HPIConstants.CONFIGURATIONS_RELATIVE_SERVER) != null) {
          mappedFolder = new File(System.getProperty(HPIConstants.ENV_HPI_BASE),
              System.getProperty("file.separator") +
              ssdMappedFolder.getLeaf(HPIConstants.CONFIGURATIONS_RELATIVE_SERVER).getValue());
        } else if (ssdMappedFolder.get(HPIConstants.CONFIGURATIONS_CANONICAL_PATH) != null) {
          mappedFolder = new File(ssdMappedFolder.getLeaf(HPIConstants.CONFIGURATIONS_CANONICAL_PATH).getValue());
        } else throw new IllegalStateException("There's some wrong thing in the " + HPIConstants.CONFIGURATIONS_MAPPED_FOLDER);
       
        for (File invokerFile : mappedFolder.listFiles(new FolderFilter())) {
          this.addInvokerFile(invokerFile);
        }
View Full Code Here

 
  public void turnup(SSDRootObject ssdSettingsData) throws InterruptedException, IOException {
    log.info("Turning the ServerBridge UP.");
   
    // first load to invokers SSD files
    SSDObjectNode ssdConfiguration = ssdSettingsData.getNode(HPIConstants.CONFIGURATIONS_CONFIG_SERVER);
   
    // instantiating and loading the server socket to new thread manager
    int portNumber = Integer.parseInt(ssdConfiguration.getLeaf(HPIConstants.CONFIGURATIONS_PORT_NUMBER).getValue());
    if (portNumber <= 0) {
      throw new IllegalStateException("The port number must be a valid number greater than 0.");
    }
    ServerSocket serverSocket = new ServerSocket(portNumber);
    ServerSocketManager serverSocketManager = new ServerSocketManager(serverSocket);
View Full Code Here

     
      log.info( "Shutdown looking for data settings at: " + settingsFile.getCanonicalPath());
      SSDContextManager ssdCtx = SSDContextManager.build(settingsFile);
      SSDRootObject ssdSettingsData = ssdCtx.getRootObject();

      SSDObjectNode ssdConfiguration = ssdSettingsData.getNode(HPIConstants.CONFIGURATIONS_CONFIG_SERVER);
      int portNumber = Integer.parseInt(ssdConfiguration.getLeaf(HPIConstants.CONFIGURATIONS_PORT_NUMBER).getValue());
      HPIClientProtocol clientProtocol = new HPIClientProtocol("127.0.0.1", portNumber);
      ServerShutdownResponse shutdownResponse = clientProtocol.serverShutdown();
     
      log.info(shutdownResponse.getMessage());
    } catch (Exception e) {
View Full Code Here

    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);
    }
   
View Full Code Here

    return HPIDialogueConstants.SERVER_SHUTDOWN_SERVICE;
  }
 
  @Override
  public SSDObjectNode getSSDParameters() {
    return new SSDObjectNode(HPIDialogueConstants.PARAMETERS);
  }
View Full Code Here

    return HPIDialogueConstants.EXECUTE_INVOKER_SERVICE;
  }
 
  @Override
  public SSDObjectNode getSSDParameters() {
    SSDObjectNode parameters = new SSDObjectNode(HPIDialogueConstants.PARAMETERS);
    parameters.addAttribute(new SSDObjectLeaf(HPIDialogueConstants.SESSION_ID, this.getSessionId()));
    parameters.addAttribute(new SSDObjectLeaf(HPIDialogueConstants.INVOKER_ID, this.getInvokeId()));
    return parameters;
  }
View Full Code Here

  }

  @Override
  public SSDContextManager getSSDServiceMessage() {
    SSDContextManager ssdCtx = SSDContextManager.build();
    SSDObjectNode hpiMessage = new SSDObjectNode(HPIDialogueConstants.HPI_MESSAGE);
    hpiMessage.addAttribute(new SSDObjectLeaf(HPIDialogueConstants.SERVICE_TYPE, this.getServiceType()));
    hpiMessage.addAttribute(new SSDObjectLeaf(HPIDialogueConstants.SERVICE_NAME, this.getServiceName()));
    hpiMessage.addAttribute(this.getSSDParameters());
    ssdCtx.getRootObject().addAttribute(hpiMessage);
    return ssdCtx;
  }
View Full Code Here

TOP

Related Classes of org.simplestructruedata.entities.SSDObjectNode

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.