com.waveset.adapter
Class HostAccess

java.lang.Object
  extended bycom.waveset.adapter.HostAccess
All Implemented Interfaces:
com.ibm.eNetwork.ECL.ECLCommNotify, com.ibm.eNetwork.ECL.event.ECLPSListener

public class HostAccess
extends java.lang.Object
implements com.ibm.eNetwork.ECL.event.ECLPSListener, com.ibm.eNetwork.ECL.ECLCommNotify

HostAccess layers the IBM Host On Demand library to provide 3270 emulation access to a mainframe.

There are two principal uses of this class:


Field Summary
protected static Trace _trace
           
static java.lang.String code_id
           
static java.lang.String RA_PROPS
           
static java.lang.String RA_TN3270E
           
static java.lang.String WAIT_FOR_INPUT
           
 
Constructor Summary
HostAccess(HostAccessLogin haLogin)
          Constructor.
 
Method Summary
 void close()
          Abruptly terminate communications with the host.
 void connect()
          Initiate communication with the host.
 void connectAndLogin()
          Initiate communication with the host, and ask the adapter to execute its custom login script.
 int convertRowColToPos(int row, int col)
          The ConvertRowColToPos method converts a row and column coordinate to its corresponding linear position.
 java.lang.String doCmd(java.lang.String cmd, java.lang.String prompt, java.lang.String morePrompt)
          Send a command to the host.
 java.lang.String doCmd(java.lang.String cmd, java.lang.String prompt, java.lang.String morePrompt, int timeout)
          Send a command to the host.
 java.lang.String doCmd(java.lang.String cmd, java.lang.String prompt, java.lang.String morePrompt, int timeout, ScreenNotifier notifier)
          Send a command to the host.
 java.lang.String doCmd(java.lang.String cmd, java.lang.String prompt, java.lang.String morePrompt, java.lang.String displayCmd, java.util.List stringsToHide, int timeout, ScreenNotifier notifier)
          Send a command to the host.
 ServerAffinity getAffinity()
          Returns the ServerAffinity
 int getCmdTimeouts()
          Returns the number of timeouts which have occurred.
 java.lang.String getContainerPoolKey()
          Returns the container's pool key
 int getCursorPos()
          Returns the linear cursor position.
protected static java.lang.String getDisplayableCommand(java.lang.String command, java.util.List stringsToHide)
          Transform the command into a string which can be safely displayed.
 java.lang.String getHost()
          Returns the name of the host or TN server.
 int getIdleTimeout()
          Returns the time (in milliseconds) after which the connection should be considered idle.
 java.lang.String getKey()
          Returns the pool key for this object
 long getLastUse()
          Returns the timestamp when this object was last used
 java.lang.String getLine(int line)
          Returns a string containing all the characters for the specified line in the text plane associated with the presentation space.
 int getNumCols()
          Returns the total number of columns in the presentation space.
 int getNumRows()
          Returns the total number of rows in the presentation space.
 java.lang.String getPort()
          Returns the port of the host or TN server
 java.util.Properties getProperties()
          Returns the Properties used to configure the ECLSession
 int getRequiredString(java.lang.String s)
          Searches for a given text string within the presentation space.
 int getRequiredString(java.lang.String s, java.util.ArrayList stringsToHide)
          Searches for a given text string within the presentation space.
 java.lang.String getScreen()
          Returns a string containing all the characters in the text plane associated with the presentation space.
 java.lang.String getScreen(int plane)
          Returns a string containing all the characters in the specified plane associated with the presentation space.
 java.lang.String getScreenRect(int startRow, int startCol, int endRow, int endCol)
          Returns a string containing all the characters in the specified rectangle within the text plane associated with the presentation space.
 java.lang.String hideFields(java.lang.String screen, java.util.ArrayList stringsToHide)
          Returns a string with any fields that should be hidden blanked out.
 boolean isBogus()
          Returns the value of the corrupted connection flag set by setBogus(boolean)
 void logoffAndClose()
          Logoff from the host (using a logoff script configured for the resource), and close the connection.
 void NotifyError(com.ibm.eNetwork.ECL.ECLConnection connection, com.ibm.eNetwork.ECL.ECLErr e)
          Outputs the error message text to the trace log if level 3 tracing is enabled on the "NotifyError" method of this class.
 void NotifyEvent(com.ibm.eNetwork.ECL.ECLConnection connection, boolean connected)
          Outputs the connection state to the trace log if level 3 tracing is enabled on the "NotifyEvent" method of this class.
 void NotifyStop(com.ibm.eNetwork.ECL.ECLConnection connection, int reason)
          Outputs the stop reason to the trace log if level 3 tracing is enabled on the "NotifyStop" method of this class.
 void PSNotifyError(com.ibm.eNetwork.ECL.ECLPS ps, com.ibm.eNetwork.ECL.ECLErr err)
          Outputs the error message text in err to the trace log if level 3 tracing is enabled on the "PSNotifyError" method of this class.
 void PSNotifyEvent(com.ibm.eNetwork.ECL.event.ECLPSEvent evt)
          Core logic of processing host responses.
 void PSNotifyStop(com.ibm.eNetwork.ECL.ECLPS ps, int reason)
          Outputs the stop reason to the trace log if level 3 tracing is enabled on the "PSNotifyStop" method of this class.
static java.util.Properties retrieveProperties(Resource resource)
          Get the ECLSession properties from the "standard" set of resource attributes.
protected  int searchBackwards(com.ibm.eNetwork.ECL.ECLPS ps, java.lang.String str)
          Searches for the last occurrence of a string within a presentation space.
 int searchText(java.lang.String string, boolean forward)
          The searchText method searches for a given text string within the presentation space.
 void sendKeys(java.lang.String s)
          The SendKeys method sends a string of keys to the host.
 void sendKeysAndWait(java.lang.String s, java.lang.String errMsg)
          Calls sendKeys(s) and then waitForInput().
 void setAffinity(ServerAffinity affinity)
          Set the ServerAffinity.
 void setBogus(boolean isBogus)
          Set the flag indicating that this host connection can or cannot be trusted.
 void setContainerPoolKey(java.lang.String containerPoolKey)
          Set the the pool key of this object's container (internal).
 void setCursorPos(int pos)
          Sets the cursor position to the specified row and column.
 void setHost(java.lang.String host)
          Set the name of the host or TN server
 void setIdleTimeout(int to)
          Sets the time (in milliseconds) after which the connection should be considered idle.
 void setKey(java.lang.String key)
          Sets the pool key for this object
 void setPort(java.lang.String port)
          Set the port of the host or TN server
 void setProperties(java.util.Properties props)
          Set additional Properties to configure the host ECLSession.
protected  void trace(java.lang.String s)
          Outputs a string to the trace log if level 4 tracing is enabled on the "trace" method of this class.
 void traceString(java.lang.String s)
          Outputs a string to the trace log if level 4 tracing is enabled on the "trace" method of this class.
 boolean waitForInput()
          Synchronously waits indefinitely until the operator information area (OIA) input is not inhibited.
 void waitForString(java.lang.String s)
          Waits until the given text string is in the presentation space, or until a timeout occurs.
 void waitForString(java.lang.String s, java.util.ArrayList stringsToHide)
          Waits until the given text string is in the presentation space, or until a timeout occurs.
 void waitForStringAndInput(java.lang.String s)
          Equivalent to calling waitForString(String) followed by waitForInput()
 void waitForStringAndInput(java.lang.String s, java.util.ArrayList stringsToHide)
          Equivalent to calling #waitForString(String, String) followed by waitForInput()
 boolean waitForStringFound(java.lang.String s)
          Waits until the given text string is in the presentation space, or until a timeout occurs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

_trace

protected static Trace _trace

WAIT_FOR_INPUT

public static java.lang.String WAIT_FOR_INPUT

RA_TN3270E

public static final java.lang.String RA_TN3270E
See Also:
Constant Field Values

RA_PROPS

public static final java.lang.String RA_PROPS
See Also:
Constant Field Values
Constructor Detail

HostAccess

public HostAccess(HostAccessLogin haLogin)
           throws java.lang.Exception
Constructor.

Parameters:
haLogin - the instance of HostAccessLogin from which this object will be configured. This method is typically called from the pool which is responsible for caching/creating HostAccess objects.
Throws:
java.lang.Exception - an incorrectly configured HostAccessLogin object
Method Detail

getHost

public java.lang.String getHost()
Returns the name of the host or TN server.

Returns:
the name of the host or TN server

setHost

public void setHost(java.lang.String host)
Set the name of the host or TN server

Parameters:
host - the name of the host or TN server

getContainerPoolKey

public java.lang.String getContainerPoolKey()
Returns the container's pool key

Returns:
the container's pool key

setContainerPoolKey

public void setContainerPoolKey(java.lang.String containerPoolKey)
Set the the pool key of this object's container (internal).

Parameters:
containerPoolKey - container's pool key

getPort

public java.lang.String getPort()
Returns the port of the host or TN server

Returns:
the port of the host or TN server

setPort

public void setPort(java.lang.String port)
Set the port of the host or TN server

Parameters:
port - the port of the host or TN server

getAffinity

public ServerAffinity getAffinity()
Returns the ServerAffinity

Returns:
the ServerAffinity

setAffinity

public void setAffinity(ServerAffinity affinity)
Set the ServerAffinity. The ServerAffinity

Parameters:
affinity - the ServerAffinity

getProperties

public java.util.Properties getProperties()
Returns the Properties used to configure the ECLSession

Returns:
the Properties used to configure the ECLSession

setProperties

public void setProperties(java.util.Properties props)
Set additional Properties to configure the host ECLSession.

This is usually called with the set of properties returned from HostAccessLogin.getProperties()

Parameters:
props - additional Properties to configure the host ECLSession
See Also:
retrieveProperties(com.waveset.object.Resource)

getNumRows

public int getNumRows()
Returns the total number of rows in the presentation space.

NOTE: There have been some issues with the underlying libraries not returning the correct number of rows.

Returns:
The number of rows in the presentation space.

getNumCols

public int getNumCols()
Returns the total number of columns in the presentation space.

Note: There have been some issues with the underlying libraries not returning the correct number of columns.

Returns:
The number of columns in the presentation space.

getIdleTimeout

public int getIdleTimeout()
Returns the time (in milliseconds) after which the connection should be considered idle.

The idle timeout defaults to 200,000 milliseconds, but can be adjusted by changing the 'Idle Timeout' resource attribute.


setIdleTimeout

public void setIdleTimeout(int to)
Sets the time (in milliseconds) after which the connection should be considered idle.


getLastUse

public long getLastUse()
Returns the timestamp when this object was last used

Returns:
the timestamp when this object was last used

getCmdTimeouts

public int getCmdTimeouts()
Returns the number of timeouts which have occurred.

Returns:
the number of timeouts which have occurred.

getKey

public java.lang.String getKey()
Returns the pool key for this object

Returns:
the pool key for this object

setKey

public void setKey(java.lang.String key)
Sets the pool key for this object

Parameters:
key - the pool key for this object

isBogus

public boolean isBogus()
Returns the value of the corrupted connection flag set by setBogus(boolean)


setBogus

public void setBogus(boolean isBogus)
Set the flag indicating that this host connection can or cannot be trusted. If set to true, then this HostAccess object will not be pooled or used again.

Parameters:
isBogus - new value for corruption flag

connect

public void connect()
             throws java.lang.Exception
Initiate communication with the host. After successfully calling this method, we have access to a presentation space and an operator information area.

Throws:
java.lang.Exception - Thrown if communication could not be established with the host

connectAndLogin

public void connectAndLogin()
                     throws java.lang.Exception
Initiate communication with the host, and ask the adapter to execute its custom login script.

Throws:
java.lang.Exception - Thrown if communication could not be established with the host, or login was unsuccessful

close

public void close()
Abruptly terminate communications with the host.


logoffAndClose

public void logoffAndClose()
Logoff from the host (using a logoff script configured for the resource), and close the connection.


convertRowColToPos

public int convertRowColToPos(int row,
                              int col)
                       throws java.lang.Exception
The ConvertRowColToPos method converts a row and column coordinate to its corresponding linear position.

Parameters:
row - The row of the coordinate.
col - The column of the coordinate.
Returns:
The linear position which corresponds to the coordinate given.
Throws:
java.lang.Exception - Thrown if the coordinates are not within the presentation space boundaries.

waitForInput

public boolean waitForInput()
Synchronously waits indefinitely until the operator information area (OIA) input is not inhibited.


sendKeys

public void sendKeys(java.lang.String s)
              throws java.lang.Exception
The SendKeys method sends a string of keys to the host. The string can be thought of as keystrokes from the keyboard which can contain both text characters and special keystrokes, like the Enter key, the Tab key, or the Page Up key. These special keys are represented by keywords which are delimited by square brackets and called mnemonics. For example, the mnemonic keyword for the Enter key is [enter].

The text string can contain any number or combination of characters and mnemonics. For example, the following string, "userID[tab]password[enter]", can be used to send a user's ID, tab to the next field, send the user's password, and then send the Enter key to logon to a host.

To send a left or right square bracket, the character must be doubled. To send a left square bracket use "[[". To send a right square bracket use "]]".

Parameters:
s - The string of characters and aid key mnemonics to be sent.
Throws:
java.lang.Exception - Thrown on mnemonic error.

sendKeysAndWait

public void sendKeysAndWait(java.lang.String s,
                            java.lang.String errMsg)
                     throws java.lang.Exception
Calls sendKeys(s) and then waitForInput().

Parameters:
s - The string of characters and aid key mnemonics to be sent.
errMsg - the string to prepend to the exception message if waitForInput() fails
Throws:
java.lang.Exception - if waitForInput() returns false. The thrown exception will be prepended with the errMsg string.

hideFields

public java.lang.String hideFields(java.lang.String screen,
                                   java.util.ArrayList stringsToHide)
                            throws java.lang.Exception
Returns a string with any fields that should be hidden blanked out. Also, blanks out any of the strings that are in stringsToHide.

Parameters:
screen - original string
stringsToHide - list of Strings which, if present in the screen, will be blanked out.
Returns:
the screen after blanking out specified fields
Throws:
java.lang.Exception - internal error

getRequiredString

public int getRequiredString(java.lang.String s)
                      throws java.lang.Exception
Searches for a given text string within the presentation space.

Parameters:
s - the string to search for
Returns:
The linear position of the given string
Throws:
java.lang.Exception - if the string is not found

getRequiredString

public int getRequiredString(java.lang.String s,
                             java.util.ArrayList stringsToHide)
                      throws java.lang.Exception
Searches for a given text string within the presentation space.

Parameters:
s - the string to search for
stringsToHide - currently unused
Returns:
The linear position of the given string
Throws:
java.lang.Exception - if the string is not found

waitForString

public void waitForString(java.lang.String s)
                   throws java.lang.Exception
Waits until the given text string is in the presentation space, or until a timeout occurs. The timeout defaults to 60,000 milliseconds, but can be adjusted by changing the 'Request Timeout' resource attribute.

If string is not seen before timeout, then exception is thrown.

Parameters:
s - the string to wait for
Throws:
java.lang.Exception - if string was not found before timeout, or an interruption occurred

waitForStringAndInput

public void waitForStringAndInput(java.lang.String s)
                           throws java.lang.Exception
Equivalent to calling waitForString(String) followed by waitForInput()

Throws:
java.lang.Exception

waitForStringAndInput

public void waitForStringAndInput(java.lang.String s,
                                  java.util.ArrayList stringsToHide)
                           throws java.lang.Exception
Equivalent to calling #waitForString(String, String) followed by waitForInput()

Throws:
java.lang.Exception

waitForString

public void waitForString(java.lang.String s,
                          java.util.ArrayList stringsToHide)
                   throws java.lang.Exception
Waits until the given text string is in the presentation space, or until a timeout occurs. The timeout defaults to 60,000 milliseconds, but can be adjusted by changing the 'Request Timeout' resource attribute.

If string is not seen before timeout, then exception is thrown.

Parameters:
s - the string to wait for
stringsToHide - list of strings to blank out in the exception message, which includes a dump of the current presentation space text.
Throws:
java.lang.Exception - if string was not found before timeout, or an interruption occurred

waitForStringFound

public boolean waitForStringFound(java.lang.String s)
                           throws java.lang.Exception
Waits until the given text string is in the presentation space, or until a timeout occurs. The timeout defaults to 60,000 milliseconds, but can be adjusted by changing the 'Request Timeout' resource attribute.

Parameters:
s - the string to wait for
Returns:
true if the string was found. false if not found before timing out.
Throws:
java.lang.Exception - an interruption occurred

searchText

public int searchText(java.lang.String string,
                      boolean forward)
The searchText method searches for a given text string within the presentation space. The method allows both forward and backward searches. If a forward search is specified, the search starts at the beginning of the presentation space. If a backward search is specified, the search starts at the end of the presentation space.

Parameters:
string - the string to search for
forward - If true, search forward. Otherwise, search backward.
Returns:
The linear position of the given string, or zero if not found.

getCursorPos

public int getCursorPos()
                 throws java.lang.Exception
Returns the linear cursor position. The linear cursor position is determined by assuming the presentation space is mapped to a one-dimensional array. Two-dimensional array coordinates can be mapped to a one-dimensional array using the following formula: (y - 1) * numCol + x. Therefore, the linear position of a cursor at 10, 15 on a 24 x 80 presentation space would be 9*80+15=735.

Note: The cursor positioning system is 1-based rather than 0-based. The valid cursor positions for a 24 x 80 presentation space are between 1 and 1920 inclusive.

Returns:
Throws:
java.lang.Exception

setCursorPos

public void setCursorPos(int pos)
                  throws java.lang.Exception
Sets the cursor position to the specified row and column.

Parameters:
pos - The new linear cursor position. This number must be between 1 and the size of the presentation space inclusive.
Throws:
java.lang.Exception - Thrown when the given position is out of range.

getLine

public java.lang.String getLine(int line)
                         throws java.lang.Exception
Returns a string containing all the characters for the specified line in the text plane associated with the presentation space.

Parameters:
line - The line of text which is wanted. A value of 1 indicates the first line.
Throws:
java.lang.Exception - if line is out of range

getScreenRect

public java.lang.String getScreenRect(int startRow,
                                      int startCol,
                                      int endRow,
                                      int endCol)
                               throws java.lang.Exception
Returns a string containing all the characters in the specified rectangle within the text plane associated with the presentation space.

Parameters:
startRow - starting row of the rectangle
startCol - starting column of the rectangle
endRow - ending row of the rectangle
endCol - ending column of the rectangle
Throws:
java.lang.Exception - if either of the positions specified is not within the plane.

getScreen

public java.lang.String getScreen()
                           throws java.lang.Exception
Returns a string containing all the characters in the text plane associated with the presentation space. Fields which are hidden and unprotected will be returned as blanked out (not applicable if plane is FIELD_PLANE).

Throws:
java.lang.Exception - internal error. Unlikely to occur.

getScreen

public java.lang.String getScreen(int plane)
                           throws java.lang.Exception
Returns a string containing all the characters in the specified plane associated with the presentation space. Fields which are hidden and unprotected will be returned as blanked out.

Parameters:
plane - the plane to return. Valid values are:
com.ibm.eNetwork.ECL.ECLConstants.TEXT_PLANE - The character contents of the field. The text plane contains no null or non-displayable characters.
com.ibm.eNetwork.ECL.ECLConstants.FIELD_PLANE - The field attributes for each field in the plane.
com.ibm.eNetwork.ECL.ECLConstants.COLOR_PLANE - The color attributes for each character in the plane.
com.ibm.eNetwork.ECL.ECLConstants.EXFIELD_PLANE - The extended field attributes for each character in the plane.
com.ibm.eNetwork.ECL.ECLConstants.DBCS_PLANE - The double byte character set (DBCS) character and field attribute data.
com.ibm.eNetwork.ECL.ECLConstants.GRID_PLANE - The DBCS grid information.
Throws:
java.lang.Exception - if the plane parameter is incorrect

doCmd

public java.lang.String doCmd(java.lang.String cmd,
                              java.lang.String prompt,
                              java.lang.String morePrompt)
                       throws java.lang.Exception
Send a command to the host. The command may result in a multi-page response from the host.

Before the command is sent sent to the host, a [clear] key is first sent.

Parameters:
cmd - the command to send. Note that cmd must contain the [enter] mnemonic.
prompt - the string in the command response which indicates the final end of the response (e.g. " ?")
morePrompt - the string expected in the command response which indicates the end of a page (e.g. " ***")
Returns:
the command response as a single string. If the response appeared over several pages, the prompts are removed and the response pages are concatenated into a single string. Note that this can cause excessive memory usage for responses with a large number of pages.
Throws:
java.lang.Exception - if cmd was not completed before timeout, or an interruption occurred. The timeout defaults to 60,000 milliseconds, but can be adjusted by changing the 'Request Timeout' resource attribute.

doCmd

public java.lang.String doCmd(java.lang.String cmd,
                              java.lang.String prompt,
                              java.lang.String morePrompt,
                              int timeout)
                       throws java.lang.Exception
Send a command to the host. The command may result in a multi-page response from the host.

Before the command is sent sent to the host, a [clear] key is first sent.

Parameters:
cmd - the command to send. Note that cmd must contain the [enter] mnemonic.
prompt - the string in the command response which indicates the final end of the response (e.g. " ?")
morePrompt - the string expected in the command response which indicates the end of a page (e.g. " ***")
timeout - the number of milliseconds to wait for the command to complete. If timeout < 0, then the timeout defaults to 60,000 milliseconds, but can be adjusted by changing the 'Request Timeout' resource attribute.
Returns:
the command response as a single string. If the response appeared over several pages, the prompts are removed and the response pages are concatenated into a single string. Note that this can cause excessive memory usage for responses with a large number of pages.
Throws:
java.lang.Exception - if cmd was not completed before timeout, or an interruption occurred

doCmd

public java.lang.String doCmd(java.lang.String cmd,
                              java.lang.String prompt,
                              java.lang.String morePrompt,
                              int timeout,
                              ScreenNotifier notifier)
                       throws java.lang.Exception
Send a command to the host. The command may result in a multi-page response from the host.

Before the command is sent sent to the host, a [clear] key is first sent.

Parameters:
cmd - the command to send. Note that cmd must contain the [enter] mnemonic.
prompt - the string in the command response which indicates the final end of the response (e.g. " ?")
morePrompt - the string expected in the command response which indicates the end of a page (e.g. " ***")
timeout - the number of milliseconds to wait for the command to complete. If timeout < 0, then the timeout defaults to 60,000 milliseconds, but can be adjusted by changing the 'Request Timeout' resource attribute.
notifier - if not null, the notifier will be called asynchronously with the contents of each page returned by the host in response to the command.
Returns:
If notifier argument is null, returns the command response as a single string. If the response appeared over several pages, the prompts are removed and the response pages are concatenated into a single string. Note that this can cause excessive memory usage for responses with a large number of pages. If notifier is not null, then returns null.
Throws:
java.lang.Exception - if cmd was not completed before timeout, or an interruption occurred

doCmd

public java.lang.String doCmd(java.lang.String cmd,
                              java.lang.String prompt,
                              java.lang.String morePrompt,
                              java.lang.String displayCmd,
                              java.util.List stringsToHide,
                              int timeout,
                              ScreenNotifier notifier)
                       throws java.lang.Exception
Send a command to the host. The command may result in a multi-page response from the host.

Before the command is sent sent to the host, a [clear] key is first sent.

Parameters:
cmd - the command to send. Note that cmd must contain the [enter] mnemonic.
prompt - the string in the command response which indicates the final end of the response (e.g. " ?")
morePrompt - the string expected in the command response which indicates the end of a page (e.g. " ***")
displayCmd - If not null, this is command that will be sent to logs and/or exceptions. If not null, make sure no passwords are embedded in this string.
stringsToHide - if displayCmd is null, then displayCmd is calculated by calling getDisplayableCommand(cmd, stringsToHide). If displayCmd argument is not null, then this argument is ignored.
timeout - the number of milliseconds to wait for the command to complete. If timeout < 0, then the timeout defaults to 60,000 milliseconds, but can be adjusted by changing the 'Request Timeout' resource attribute.
notifier - if not null, the notifier will be called asynchronously with the contents of each page returned by the host in response to the command.
Returns:
If notifier argument is null, returns the command response as a single string. If the response appeared over several pages, the prompts are removed and the response pages are concatenated into a single string. Note that this can cause excessive memory usage for responses with a large number of pages. If notifier is not null, then returns null.
Throws:
java.lang.Exception - if cmd was not completed before timeout, or an interruption occurred

PSNotifyError

public void PSNotifyError(com.ibm.eNetwork.ECL.ECLPS ps,
                          com.ibm.eNetwork.ECL.ECLErr err)
Outputs the error message text in err to the trace log if level 3 tracing is enabled on the "PSNotifyError" method of this class.

Specified by:
PSNotifyError in interface com.ibm.eNetwork.ECL.event.ECLPSListener

searchBackwards

protected int searchBackwards(com.ibm.eNetwork.ECL.ECLPS ps,
                              java.lang.String str)
                       throws com.ibm.eNetwork.ECL.ECLErr
Searches for the last occurrence of a string within a presentation space.

Parameters:
ps - host presentation space to search
str - the string to search for
Returns:
0 if str not found. Otherwise, returns the 1-based offset of the beginning of the str.
Throws:
com.ibm.eNetwork.ECL.ECLErr

PSNotifyEvent

public void PSNotifyEvent(com.ibm.eNetwork.ECL.event.ECLPSEvent evt)
Core logic of processing host responses.

Specified by:
PSNotifyEvent in interface com.ibm.eNetwork.ECL.event.ECLPSListener

PSNotifyStop

public void PSNotifyStop(com.ibm.eNetwork.ECL.ECLPS ps,
                         int reason)
Outputs the stop reason to the trace log if level 3 tracing is enabled on the "PSNotifyStop" method of this class.

Specified by:
PSNotifyStop in interface com.ibm.eNetwork.ECL.event.ECLPSListener

NotifyEvent

public void NotifyEvent(com.ibm.eNetwork.ECL.ECLConnection connection,
                        boolean connected)
Outputs the connection state to the trace log if level 3 tracing is enabled on the "NotifyEvent" method of this class.

Specified by:
NotifyEvent in interface com.ibm.eNetwork.ECL.ECLCommNotify

NotifyStop

public void NotifyStop(com.ibm.eNetwork.ECL.ECLConnection connection,
                       int reason)
Outputs the stop reason to the trace log if level 3 tracing is enabled on the "NotifyStop" method of this class.

Specified by:
NotifyStop in interface com.ibm.eNetwork.ECL.ECLCommNotify

NotifyError

public void NotifyError(com.ibm.eNetwork.ECL.ECLConnection connection,
                        com.ibm.eNetwork.ECL.ECLErr e)
Outputs the error message text to the trace log if level 3 tracing is enabled on the "NotifyError" method of this class.

Specified by:
NotifyError in interface com.ibm.eNetwork.ECL.ECLCommNotify

traceString

public void traceString(java.lang.String s)
Outputs a string to the trace log if level 4 tracing is enabled on the "trace" method of this class.

Parameters:
s - The string to output to the trace log.

trace

protected void trace(java.lang.String s)
Outputs a string to the trace log if level 4 tracing is enabled on the "trace" method of this class.

Parameters:
s - The string to output to the trace log.

retrieveProperties

public static java.util.Properties retrieveProperties(Resource resource)
Get the ECLSession properties from the "standard" set of resource attributes.

Typically called from the HostAccessLogin.getProperties() interface method implementation for a resource adapter, so it can support the standard way of exposing the setting of these properties.

The set of resource attributes read by this method are:


getDisplayableCommand

protected static java.lang.String getDisplayableCommand(java.lang.String command,
                                                        java.util.List stringsToHide)
Transform the command into a string which can be safely displayed.

Parameters:
command - string to be transformed to hide passwords and other sensitive data
stringsToHide - a list of strings that need to be hidden in command
Returns:
the transformed string. Patterns which resemble passwords (as well as the strings present in stringsToHide) will be replaced with asterisks.