HCL Workload Automation, Version 9.4

Connect to HCL Workload Automation

Describes how to connect to HCL Workload Automation from an event management plug-in.

Connect to HCL Workload Automation with the following code:

private Subject getSubject(String serverName, 
                           String serverPort, 
                           String uid, 
                           String pwd){
 Subject subject = null;
 try {
   LoginContext lc = null;
   Hashtable env = new Hashtable();
   final InitialContext initialContext = new InitialContext(env);
   Object obj = initialContext.lookup("");

lc = new LoginContext(JAAS_MODULE, new WSCallbackHandlerImpl(uid,pwd));
   subject = lc.getSubject();
 }   catch(javax.naming.NoPermissionException exc) {
   System.err.println("[TWSConn] - Login Error: "+exc);
 }   catch(Exception exc) {
   System.err.println("[TWSConn] - Error: "+exc);
   return subject;

The following user input data is required: