Services Builder for Screens

com.attachmate.connectors.screen
Class ScreenConnectorAccessImpl

java.lang.Object
  |
  +--com.attachmate.connectors.screen.ScreenConnectorAccessImpl
All Implemented Interfaces:
IConnectorAccess, com.attachmate.resource.spi.IConnectorResource

public class ScreenConnectorAccessImpl
extends java.lang.Object
implements IConnectorAccess, com.attachmate.resource.spi.IConnectorResource

The screen connector.

See Also:
<{IConnectorAccess}>

Field Summary
static java.lang.String PARAM_CACHE
          Parameter for specifying caching in IConnectorAccess.open.
static java.lang.String PARAM_INSTANCE
          Parameter for setting instance name in IConnectorAccess.open.
static java.lang.String PARAM_JOB
          Parameter for specifying caching in IConnectorAccess.open.
static java.lang.String PARAM_PATH
          Parameter for setting instance name in IConnectorAccess.open.
 
Constructor Summary
ScreenConnectorAccessImpl()
          Constructs a new ScreenConnectorAccessImpl.
 
Method Summary
 void cancel()
          Cancels task execution.
 void cleanup()
          Called my the ConnectionManager after a Connection is closed.
 void close()
          Free the task server and the task context.
 void destroy()
          Called by the ConnectionManager when it ready to remove this object from the pool.
 void execute(java.lang.String taskID, java.lang.String inputs)
          Execute loads and configures the ITaskServer and then proceeds to process the inputs supplied along with the metadata schema.
 int getAvailable()
          Returns the size of the output XML.
 java.lang.String getConnectorPath()
          Gets the path to the xml file that was used to open the connector.
 java.lang.String getData()
          Returns the data retrieved as a result of executing the task.
 java.util.Hashtable getInstanceInfo()
           
 int getMaxSize()
          Returns the maximum size of the output XML.
 java.lang.String getMetaData(java.lang.String taskID)
          Uses ReadWriteMetaDataImpl to read and parse the MetaData schema file.
 int getTimeOut()
          Gets the execution timeout.
 java.lang.String open(java.lang.String path)
          Initializes the Connector, must be successfully called before calling Execute().
 void setMaxSize(int size)
          Specifies a maximum size for the output XML.
 void setTimeOut(int time)
          Sets the execution timeout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_PATH

public static final java.lang.String PARAM_PATH
Parameter for setting instance name in IConnectorAccess.open.

See Also:
Constant Field Values

PARAM_INSTANCE

public static final java.lang.String PARAM_INSTANCE
Parameter for setting instance name in IConnectorAccess.open.

See Also:
Constant Field Values

PARAM_CACHE

public static final java.lang.String PARAM_CACHE
Parameter for specifying caching in IConnectorAccess.open.

See Also:
Constant Field Values

PARAM_JOB

public static final java.lang.String PARAM_JOB
Parameter for specifying caching in IConnectorAccess.open.

See Also:
Constant Field Values
Constructor Detail

ScreenConnectorAccessImpl

public ScreenConnectorAccessImpl()
Constructs a new ScreenConnectorAccessImpl.

Method Detail

open

public java.lang.String open(java.lang.String path)
                      throws com.attachmate.connectors.ConnectorAccessException
Initializes the Connector, must be successfully called before calling Execute().

Specified by:
open in interface IConnectorAccess
Parameters:
path - The XML Meta data schema file to be parsed. This can be a file or URL. Parameters, such as instance name can be specified using the standard URL ? & = characters. For example,
  c:myConnector.xml?instance=LU.MyLuName&otherParam=otherParamValue
 
The following parameters are supported:
  • instance - The instance name for this connector. Sometimes used to request the LU name for the connection (default="").
  • cache - enables caching of the metadata instead of reloading for each connector instance (true or false (default=false)).
  • job - Associates a job name with this connector instance for event logging and auditing (default="Connector").
Returns:
the version of the data references by the path argument.
Throws:
com.attachmate.connectors.ConnectorAccessException - in the event of an error.

getMetaData

public java.lang.String getMetaData(java.lang.String taskID)
Uses ReadWriteMetaDataImpl to read and parse the MetaData schema file.

Specified by:
getMetaData in interface IConnectorAccess
Parameters:
taskID - the transaction ID whose meta data we want to retreive.
Returns:
the MetaData XML as a String.

execute

public void execute(java.lang.String taskID,
                    java.lang.String inputs)
             throws com.attachmate.connectors.ConnectorAccessException
Execute loads and configures the ITaskServer and then proceeds to process the inputs supplied along with the metadata schema. Once the inputs have been set, execute on the TaskServer is called and then the outputs are retrieved.

Specified by:
execute in interface IConnectorAccess
Parameters:
taskID - the transaction ID whose inputs and outpus we want to process.
inputs - the string of inputs to process that must match the format of the metadata schema.
Throws:
com.attachmate.connectors.ConnectorAccessException - in the event of an error.

getData

public java.lang.String getData()
                         throws com.attachmate.connectors.ConnectorAccessException
Returns the data retrieved as a result of executing the task.

Specified by:
getData in interface IConnectorAccess
Returns:
the data as a String
com.attachmate.connectors.ConnectorAccessException

getAvailable

public int getAvailable()
Returns the size of the output XML.

Specified by:
getAvailable in interface IConnectorAccess
Returns:
the number of characters available.

getMaxSize

public int getMaxSize()
Returns the maximum size of the output XML.

Specified by:
getMaxSize in interface IConnectorAccess
Returns:
the maximum size of the output XML.

setMaxSize

public void setMaxSize(int size)
Specifies a maximum size for the output XML.

Specified by:
setMaxSize in interface IConnectorAccess
Parameters:
size - the maximum size of the output XML.

getTimeOut

public int getTimeOut()
Gets the execution timeout.

Specified by:
getTimeOut in interface IConnectorAccess
Returns:
the timeout.

setTimeOut

public void setTimeOut(int time)
Sets the execution timeout.

Specified by:
setTimeOut in interface IConnectorAccess
Parameters:
time - the timeout.

cancel

public void cancel()
Cancels task execution.

Specified by:
cancel in interface IConnectorAccess

getConnectorPath

public java.lang.String getConnectorPath()
Gets the path to the xml file that was used to open the connector.

Returns:
the connector path.

close

public void close()
           throws com.attachmate.connectors.ConnectorAccessException
Free the task server and the task context.

Specified by:
close in interface IConnectorAccess
Throws:
com.attachmate.connectors.ConnectorAccessException - in the event of an error.

getInstanceInfo

public java.util.Hashtable getInstanceInfo()

cleanup

public void cleanup()
             throws com.attachmate.connectors.ConnectorAccessException
Called my the ConnectionManager after a Connection is closed. Should be used to cleanup resources between uses. This should not close any of the resources.

Specified by:
cleanup in interface com.attachmate.resource.spi.IConnectorResource
com.attachmate.connectors.ConnectorAccessException
Since:
1.0

destroy

public void destroy()
             throws com.attachmate.connectors.ConnectorAccessException
Called by the ConnectionManager when it ready to remove this object from the pool. This should close all resources.

Specified by:
destroy in interface com.attachmate.resource.spi.IConnectorResource
com.attachmate.connectors.ConnectorAccessException
Since:
1.0

Services Builder for Screens