com.waveset.adapter.ScriptedConnection
Class ScriptedConnection

java.lang.Object
  extended bycom.waveset.adapter.ResourceConnection
      extended bycom.waveset.adapter.ScriptedConnection.ScriptedConnection
Direct Known Subclasses:
SSHConnection, TelnetConnection

public abstract class ScriptedConnection
extends ResourceConnection


Field Summary
protected  java.io.InputStream _err
           
protected  java.lang.String _host
           
protected  java.io.InputStream _in
           
protected  java.io.OutputStream _out
           
protected  java.lang.String _password
           
protected  int _port
           
protected  java.lang.String _term
           
protected  java.lang.String _type
           
protected  java.lang.String _user
           
static java.lang.String code_id
           
static java.lang.String HOST
           
static int MAX_WAIT_MILLISECONDS
           
static java.lang.String PASSWORD
           
static java.lang.String PORT
           
protected static int READ_BUFFER_SIZE
           
protected static int READ_CHECK_FREQUENCY
           
static java.lang.String TERM
           
static java.lang.String TYPE
           
static java.lang.String USER
           
 
Fields inherited from class com.waveset.adapter.ResourceConnection
_args, _connected, _pooled, _timeIdled, _trace
 
Constructor Summary
ScriptedConnection()
          Constructors.
ScriptedConnection(java.util.HashMap args)
           
ScriptedConnection(java.util.HashMap args, boolean pooled)
           
 
Method Summary
 boolean argsEqual(java.util.HashMap argsIn)
          Tests if the attribute values in args matches with those set in the ResourceConnection object.
abstract  void disConnect()
          Deprecated. since 3.1. Use disconnect() instead.
 int flushInputStream()
          Reads any available data from the input buffer into the unprocessed area and marks all of the unprocessed input data as having been read.
 java.lang.String getHost()
          Returns the host name of the resource.
 int getPort()
          Returns the port number of the resource.
 boolean isLoggedIn()
           
 CaptureList runScript(Script script)
          Executes a Script on the connected resource.
static int saneFrequency(int maxSleepTime, int proposedFrequency)
          Calculate the needed frequency so that Thread.sleep requests are less than, or equal to, MAX_WAIT_MILLISECONDS per cycle.
 boolean selfAuthenticates()
          Returns an indication of whether the connection will authenticate itself.
 void setArgs(java.util.HashMap args)
          Tests for valid attribute values passed in through args.
 java.lang.String setDecoder(java.lang.String enc)
           
 java.lang.String setEncoder(java.lang.String enc)
           
 void setLineTermination(java.lang.String lineTermination)
           
 void setLoggedIn(boolean loggedIn)
           
 
Methods inherited from class com.waveset.adapter.ResourceConnection
connect, disconnect, getArgsType, getTimeIdled, isConnected, isPooled, setConnected, setPooled, setTimeIdled, testConnection
 
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

READ_BUFFER_SIZE

protected static final int READ_BUFFER_SIZE
See Also:
Constant Field Values

READ_CHECK_FREQUENCY

protected static final int READ_CHECK_FREQUENCY
See Also:
Constant Field Values

HOST

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

PORT

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

USER

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

PASSWORD

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

TYPE

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

TERM

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

_host

protected java.lang.String _host

_port

protected int _port

_user

protected java.lang.String _user

_password

protected java.lang.String _password

_type

protected java.lang.String _type

_term

protected java.lang.String _term

_in

protected java.io.InputStream _in

_err

protected java.io.InputStream _err

_out

protected java.io.OutputStream _out

MAX_WAIT_MILLISECONDS

public static final int MAX_WAIT_MILLISECONDS
Constructor Detail

ScriptedConnection

public ScriptedConnection()
                   throws WavesetException
Constructors.


ScriptedConnection

public ScriptedConnection(java.util.HashMap args)
                   throws WavesetException

ScriptedConnection

public ScriptedConnection(java.util.HashMap args,
                          boolean pooled)
                   throws WavesetException
Method Detail

setArgs

public void setArgs(java.util.HashMap args)
             throws java.lang.IllegalArgumentException
Description copied from class: ResourceConnection
Tests for valid attribute values passed in through args.

Overrides:
setArgs in class ResourceConnection
Throws:
java.lang.IllegalArgumentException

argsEqual

public boolean argsEqual(java.util.HashMap argsIn)
Description copied from class: ResourceConnection
Tests if the attribute values in args matches with those set in the ResourceConnection object.

Specified by:
argsEqual in class ResourceConnection

setLoggedIn

public void setLoggedIn(boolean loggedIn)

isLoggedIn

public boolean isLoggedIn()

disConnect

public abstract void disConnect()
                         throws WavesetException
Deprecated. since 3.1. Use disconnect() instead.

Says goodbye and disconnects from the resource.

Throws:
WavesetException

getHost

public java.lang.String getHost()
Returns the host name of the resource.


getPort

public int getPort()
Returns the port number of the resource.


selfAuthenticates

public boolean selfAuthenticates()
Returns an indication of whether the connection will authenticate itself. The alternative is a scripted authentication.


flushInputStream

public int flushInputStream()
Reads any available data from the input buffer into the unprocessed area and marks all of the unprocessed input data as having been read. Returns the total amount of data that was flushed.


saneFrequency

public static int saneFrequency(int maxSleepTime,
                                int proposedFrequency)
Calculate the needed frequency so that Thread.sleep requests are less than, or equal to, MAX_WAIT_MILLISECONDS per cycle.

Parameters:
maxSleepTime -
proposedFrequency -
Returns:

runScript

public CaptureList runScript(Script script)
                      throws WavesetException
Executes a Script on the connected resource.

Throws:
WavesetException

setLineTermination

public void setLineTermination(java.lang.String lineTermination)

setEncoder

public java.lang.String setEncoder(java.lang.String enc)
Parameters:
enc - The character set that should be used when sending data to the resource
Returns:

setDecoder

public java.lang.String setDecoder(java.lang.String enc)
Parameters:
enc - The character set that data from the resource arrives in.
Returns: