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 Orchestration Server (see Launching the Orchestration Console and Logging in to the Orchestration Server in the NetIQ Cloud Manager 2.1 Orchestration Installation 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 Orchestration Server to receive job events for the job you started.

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

       clientAgent.logout()