org.safs.tools.input
Class SAFSINPUT

java.lang.Object
  extended by org.safs.tools.drivers.DriverConfiguredSTAFInterfaceClass
      extended by org.safs.tools.input.SAFSINPUT
All Implemented Interfaces:
ConfigurableToolsInterface, GenericToolsInterface, InputInterface

public class SAFSINPUT
extends DriverConfiguredSTAFInterfaceClass
implements InputInterface

This concrete implementation interfaces clients to the SAFSINPUT service. This class expects a DriverInterface object to provide access to all configuration information.

AUTOLAUNCH

TRUE--Enable this class to launch the STAF service if it is not already running.
FALSE--Do not try to launch the service if it is not running.

The Driver's 'safs.driver.autolaunch' command-line option is also queried for this setting and overrides any other configuration source setting.

The default AUTOLAUNCH setting is TRUE.

ITEM

The full class name for an alternate InputInterface class for SAFSINPUT. This parameter is only needed if an alternate/custom InputInterface is used. The class must be findable by the JVM and Class.forName functions.

The default ITEM value is org.safs.tools.input.SAFSINPUT

SERVICECLASS

The full class name for an alternate service class for SAFSINPUT. This parameter is only needed if an alternate/custom service is used. This class must be findable by the JVM. This setting, if provided, will cause any SERVICEJAR setting to be ignored.

The default SERVICECLASS value is org.safs.staf.service.input.SAFSInputService

SERVICEJAR

The full path and name for an alternate service JAR for SAFSINPUT. This parameter is only needed if an alternate/custom service is used. This class must be findable by the JVM. If a value is specified for SERVICECLASS, then this setting is ignored.

The default SERVICEJAR value is [safsroot]/lib/safsinput.jar

SERVICE

The service name for an alternate service instead of "SAFSINPUT". This parameter is only needed if an alternate/custom service is used. Note: All of the standard SAFS Framework tools currently expect the default "SAFSINPUT" service name.

OPTIONS

Any additional PARMS to be sent to the service upon initialization. We already handle sending the DIR parameter with the path obtained from the Driver. Any other options needed for service initialization should be specified here. There typically will be none.


Field Summary
protected  java.lang.String classpath
          Stores classname or JAR file fullpath for STAF service initialization.
protected static java.lang.String DEFAULT_SAFSINPUT_CLASS
          "org.safs.staf.service.input.SAFSInputService"
protected static java.lang.String DEFAULT_SAFSINPUT_CLASS3
           
protected static java.lang.String DEFAULT_SAFSINPUT_JAR
          "safsinput.jar"
 
Fields inherited from class org.safs.tools.drivers.DriverConfiguredSTAFInterfaceClass
config, customStr, customText, debugStr, debugText, driver, DRIVER_TEMP_PROCESS, failedStr, failedText, genericStr, genericText, launchCount, log, machine, otherStr, otherText, passedStr, passedText, processName, running, SAFS_RESBUN_NAME, servicename, shutdownCount, staf, STAFPROC_EXE, warningStr, warningText, weStartedService, weStartedSTAF
 
Constructor Summary
SAFSINPUT()
          Constructor for SAFSINPUT.
 
Method Summary
 void close(UniqueIDInterface source)
          Close the specified input source.
 InputRecordInterface gotoRecord(UniqueRecordInterface recordInfo)
          Goto a specific linenumber or blockid of the specified input source.
 boolean gotoStart(UniqueIDInterface source)
          Goto the beginning of the specified input source.
 void launchInterface(java.lang.Object configInfo)
          Expects a DriverInterface for initialization.
 InputRecordInterface nextRecord(UniqueIDInterface source)
          Return the next record from the specified input source.
 boolean open(UniqueSourceInterface source)
          Open a new Input source.
The UniqueSourceInterface is expected to simply have the id and the filename or fullpath.
protected  InputRecordInterface parseInputRecord(com.ibm.staf.STAFResult result)
          Return a valid InputRecordInfo object or an InputRecordInvalid object.
 void reset()
          Reset/Clear all sources in the service.
 
Methods inherited from class org.safs.tools.drivers.DriverConfiguredSTAFInterfaceClass
extendedGenericMessage, finalize, getSTAFHelper, isToolRunning, logMessage, setLogUtilities, shutdown, shutdownService, simpleGenericMessage, simpleGenericSuccessMessage, simpleGenericWarningMessage, simpleSuccessMessage, simpleSuccessMessage, simpleSuccessUsingMessage, standardErrorMessage
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SAFSINPUT_CLASS

protected static final java.lang.String DEFAULT_SAFSINPUT_CLASS
"org.safs.staf.service.input.SAFSInputService"

See Also:
Constant Field Values

DEFAULT_SAFSINPUT_CLASS3

protected static final java.lang.String DEFAULT_SAFSINPUT_CLASS3
See Also:
Constant Field Values

DEFAULT_SAFSINPUT_JAR

protected static final java.lang.String DEFAULT_SAFSINPUT_JAR
"safsinput.jar"

See Also:
Constant Field Values

classpath

protected java.lang.String classpath
Stores classname or JAR file fullpath for STAF service initialization.

Constructor Detail

SAFSINPUT

public SAFSINPUT()
Constructor for SAFSINPUT. The object cannot do much of anything at all until the DriverInterface and ConfigureInterface have been received via the launchInterface function.

Method Detail

launchInterface

public void launchInterface(java.lang.Object configInfo)
Expects a DriverInterface for initialization. The superclass handles generic initialization and then we provide SAFSINPUT-specific initialization.

Specified by:
launchInterface in interface ConfigurableToolsInterface
Overrides:
launchInterface in class DriverConfiguredSTAFInterfaceClass
Parameters:
configInfo - can be whatever the final implementation needs it to be. This might be a String with configuration information, the name of a class, or an instance of some object used to provide configuration assets.
See Also:
ConfigurableToolsInterface.launchInterface(Object)

open

public boolean open(UniqueSourceInterface source)
Open a new Input source.
The UniqueSourceInterface is expected to simply have the id and the filename or fullpath.

Specified by:
open in interface InputInterface
Returns:
TRUE if OPEN was successful.
See Also:
InputInterface.open(UniqueSourceInterface)

parseInputRecord

protected InputRecordInterface parseInputRecord(com.ibm.staf.STAFResult result)
Return a valid InputRecordInfo object or an InputRecordInvalid object. Parses the record looking for valid "linenum:data" format.


nextRecord

public InputRecordInterface nextRecord(UniqueIDInterface source)
Return the next record from the specified input source.

Specified by:
nextRecord in interface InputInterface
See Also:
InputInterface.nextRecord(UniqueIDInterface)

gotoStart

public boolean gotoStart(UniqueIDInterface source)
Goto the beginning of the specified input source.

Specified by:
gotoStart in interface InputInterface
Returns:
TRUE if successful.
See Also:
InputInterface.gotoStart(UniqueIDInterface)

gotoRecord

public InputRecordInterface gotoRecord(UniqueRecordInterface recordInfo)
Goto a specific linenumber or blockid of the specified input source.

Specified by:
gotoRecord in interface InputInterface
See Also:
InputInterface.gotoRecord(UniqueRecordInterface)

close

public void close(UniqueIDInterface source)
Close the specified input source.

Specified by:
close in interface InputInterface
See Also:
InputInterface.close(UniqueIDInterface)

reset

public void reset()
Reset/Clear all sources in the service.

Specified by:
reset in interface GenericToolsInterface
See Also:
GenericToolsInterface.reset()