A.2 Creating an SDK Client

Use the following procedure to create an SDK client in conjunction with the sample Java code (see Interface ClientAgent):

  1. Create ClientAgent instance:

      // example zos server host is "myserver"
    
      ClientAgent clientAgent = ClientAgentFactory.newClientAgent("myserver");
    
  2. Use the following user and password example to log in to the Orchestrate Server (see Walkthrough: Logging In to the PlateSpin Orchestrate Server in the PlateSpin Orchestrate 2.5 Installation and Configuration Guide):

      Credential credential = CredentialFactory.newPasswordCredential(username,password);
    
      clientAgent.login(credential);
    
  3. Run the server operations. In this case, it is the quickie.jdl example job (which must have been previously deployed) with no job arguments:

      String jobID = clientAgent.runJob("quickie",null)
    
  4. (Optional) Listen for server events using the AgentListener interface:

      clientAgent.addAgentListener(this);
    
    1. Register with the PlateSpin Orchestrate Server to receive job events for the job you started.

      clientAgent.getMessages(jobID);
      
  5. Log out of the server:

       clientAgent.logout()