Sun Identity Manager 8.1 Resources Reference

Mainframe Examples

The ACF2, RACF, and Top Secret adapters require login and logoff resource actions. The login action negotiates an authenticated session with the mainframe. The logoff action disconnects when that session is no longer required.

A thin client host access 3270 emulator is provided to the context of the resource action by the resource adapter to simplify execution of commands in the scripted session. The emulator is defined in the com.waveset.object.HostAccess class. Refer to the JavaDoc for the HostAccess class for details about the methods available on hostAccess object passed to the resource action.

Resource Action Context

Several global variables may be expected within the context of the scripted action.

Object

Description

hostAccess 

TN3270 emulator; an instance of com.waveset.adapter.HostAccess. It is used for sending and receiving keystrokes and commands to/from the mainframe.

hostAccessLogin 

Instance of a class that implements the com.waveset.adapter.HostAccessLogin interface. It is mainly provided because it implements the logoff() method that may be required in the event of a failure during the login process.

identity 

A string that contains the accountId for the user on the resource. 

user 

Contains the name of the administrative user that should be logged on. 

userAttrs 

An instance of java.util.Map containing values for each of the Resource User Attributes needed by the action

password 

Encrypted object which stores the password of the mainframe user; use password.decryptToString() to convert to plain text. 

system 

mainframe system name 

out 

Instance of java.io.PrintStream. If the Javascript writes to this stream (for example, out.print(“Hello”) ), the contents will be traced, and will be shown in the UI results displayed for resource actions.

err 

An instance of java.io.PrintStream. If the Javascript writes to this stream (for example, err.print(“Error”)), the contents will be traced, and will be shown in the UI results displayed for resource actions.

Mnemonic Keywords for the sendKeys Method

The following table describes the special functions that can be executed through the 3270 emulator to simulate keying the non-alphanumeric values.

Function

Mnemonic Keyword

Function

Mnemonic Keyword

Attention 

[attn] 

F1 

[pf1] 

Backspace 

[backspace] 

F2 

[pf2] 

Backtab 

[backtab] 

F3 

[pf3] 

Beginning of Field 

[bof] 

F4 

[pf4] 

Clear 

[clear] 

F5 

[pf5] 

Cursor Down 

[down] 

F6 

[pf6] 

Cursor Left 

[left] 

F7 

[pf7] 

Cursor Right 

[right] 

F8 

[pf8] 

Cursor Select 

[cursel] 

F9 

[pf9] 

Cursor Up 

[up] 

F10 

[pf10] 

Delete Character 

[delete] 

F11 

[pf11] 

DUP Field 

[dup] 

F12 

[pf12] 

Enter 

[enter] 

F13 

[pf13] 

End of Field 

[eof] 

F14 

[pf14] 

Erase EOF 

[eraseeof] 

F15 

[pf15] 

Erase Field 

[erasefld] 

F16 

[pf16] 

Erase Input 

[erinp] 

F17 

[pf17] 

Field Mark 

[fieldmark] 

F18 

[pf18] 

Home 

[home] 

F19 

[pf19] 

Insert 

[insert] 

F20 

[pf20] 

New Line 

[newline] 

F21 

[pf21] 

PA1 

[pa1] 

F22 

[pf22] 

PA2 

[pa2] 

F23 

[pf23] 

PA3 

[pa3] 

F24 

[pf24] 

Page Up 

[pageup] 

   

Page Down 

[pagedn] 

   

Reset 

[reset] 

   

System Request 

[sysreq] 

   

Tab Field 

[tab] 

   

Sample Resource Actions

The following code samples illustrate actions that are commonly performed on mainframe resources:

Login Action

The following code is a complete sample of login and logoff resource actions. The sample is tailored to a specific customer’s environment using a Top Secret resource. As such, the text of commands, prompt, and command sequences will most likely differ across deployments. Note that the resource actions wrap Javascript inside of XML.

<ResourceAction name=’ACME Login Action’>
   <ResTypeAction restype=’TopSecret’>
      <act>
         var TSO_MORE = " ***";
         var TSO_PROMPT = " READY";
          var TS_PROMPT = " ?";
         hostAccess.waitForString("ENTER YOUR APPLICATION NAME");
         hostAccess.sendKeys("tso[enter]");
          hostAccess.waitForString("ENTER USERID– ");
         hostAccess.sendKeys(user + "[enter]");
         hostAccess.waitForString("TSO/E LOGON");
         hostAccess.sendKeys(password);
         hostAccess.sendKeys("[enter]");
         var pos = hostAccess.searchText("  -Nomail", false);
         if (pos != 0) {
            hostAccess.setCursorPos(pos);
            hostAccess.sendKeys("S");
         }
         pos = hostAccess.searchText("  -Nonotice", false);
         if (pos != 0) {
            hostAccess.setCursorPos(pos);
            hostAccess.sendKeys("S");
         }
         hostAccess.sendKeys("[enter]");
         hostAccess.waitForStringAndInput(TSO_MORE);
         hostAccess.sendKeys("[enter]");
         hostAccess.waitForStringAndInput(TSO_MORE);
         hostAccess.sendKeys("[enter]");
         hostAccess.waitForStringAndInput("ISPF");
         hostAccess.sendKeys("=x[enter]");
         hostAccess.waitForString(TSO_PROMPT);
         var resp =hostAccess.doCmd("PROFILE NOPROMPT MSGID NOINTERCOM 
NOPAUSE NOWTPMSG PLANGUAGE(ENU) SLANGUAGE(ENU) NOPREFIX[enter]", 
TSO_PROMPT, TSO_MORE);
         hostAccess.waitForStringAndInput("ENTER LOGON:");
         hostAccess.sendKeys(system + "[enter]");
         hostAccess.waitForStringAndInput("USER-ID.....");
         hostAccess.sendKeys(user + "[tab]" + password);
         hostAccess.sendKeys("[enter]");
         var stringsToHide = new java.util.ArrayList();
         stringsToHide.add(password.decryptToString());
         hostAccess.waitForString("==>", stringsToHide);
         hostAccess.waitForInput();
         hostAccess.sendKeys("[pf6]");
         hostAccess.waitForInput();
      </act>
   </ResTypeAction>
</ResourceAction>

Logoff Action

<ResourceAction name=’ACME Logoff Action’>
   <ResTypeAction restype=’TopSecret’>
      <act>
         var TSO_PROMPT = " READY";
         hostAccess.sendKeys("[clear]end[enter]");
         hostAccess.waitForString(TSO_PROMPT);
         hostAccess.sendKeys("logoff[enter]");
       </act>
   </ResTypeAction>
</ResourceAction>

RACF Dataset Rule Action

If the Create and Delete DataSet Rules parameter on the RACF resource parameter page is selected, Identity Manager directly administers dataset rules. To configure your own dataset rules, define an action similar to the following.

<ResourceAction name=’create after action’>
   <ResTypeAction restype=’RACF’>
      <act>
         var TSO_PROMPT = " READY";
         var TSO_MORE = " ***";
         var cmd1 = "addsd ’"+identity+".test1.**’ owner(’"+identity+"’)[enter]";
         var result1 = hostAccess.doCmd(cmd1, TSO_PROMPT, TSO_MORE);
      </act>
   </ResTypeAction>
</ResourceAction>