IP*Works! V9

ipworks
Class Rshell

java.lang.Object
  extended by ipworks.Rshell

public class Rshell
extends java.lang.Object

The Rshell bean is used to execute commands on a remote Unix machine using the rshell mechanism.

The Rshell bean allows remote execution of commands on UNIX hosts, or any other system with the rshell interface. Using the bean is very simple. The destination is specified by the RemoteHost property, the login information is given by the LocalUser and RemoteUser properties. Then call the Execute method with the Command to execute as a parameter. You can also set the Command property to the command that you would like to execute for identical results. Further input can be supplied to the command by assigning data to the Text parameter of the Send method, or via the Stdin property.

The output of the command is returned through the Stdout event. If an error happens on the protocol level, the error message can be found in the ErrorMessage property. Errors during command execution (the stderr stream) are given by the Stderr event.

To be able to successfully use the bean, the remote host must be set up to allow execution of commands via rshell from the machine the bean runs on.


Constructor Summary
Rshell()
          Creates an instance of Rshell Bean.
Rshell(java.lang.String runtimeLicense)
          Creates an instance of Rshell Bean with specified run-time license.
 
Method Summary
 void addRshellEventListener(RshellEventListener l)
           
 java.lang.String config(java.lang.String configurationString)
          Sets or retrieves a configuration setting.
 void disconnect()
          Disconnects from the RemoteHost .
 void doEvents()
          Processes events from the internal message queue.
 void execute(java.lang.String command)
          Executes a Command on the remote host.
 int getBytesSent()
          The number of bytes actually sent after an assignment to Stdin.
 java.lang.String getCommand()
          The command to be sent to the remote host.
 byte[] getEOL()
          Used to break the stdout data stream into chunks separated by its value.
 byte[] getErrEOL()
          Used to break the stderr data stream into chunks separated by its value.
 java.lang.String getErrorMessage()
          The error message returned when any of the steps prior to command execution fail.
 Firewall getFirewall()
          A set of properties related to firewall access.
 java.lang.String getLocalHost()
          The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
 int getLocalPort()
          The TCP port in the local host where the bean binds.
 java.lang.String getLocalUser()
          The identifier of the user on the local machine.
 java.lang.String getRemoteHost()
          The address of the remote host.
 int getRemotePort()
          The remote shell service port (default is 514).
 java.lang.String getRemoteUser()
          The id of the user on the remote host.
 byte[] getStderr()
          Returns the standard error output (stderr) from the remote application.
 byte[] getStdout()
          Provides the standard output (stdout) from the remote application.
 int getTimeout()
          A timeout for the bean.
 void interrupt()
          Interrupt the current method.
 boolean isConnected()
          Shows whether the bean is connected.
 boolean isEOF()
          If True, the connection has closed, and there is no buffered data available.
 void removeRshellEventListener(RshellEventListener l)
           
 void send(byte[] text)
          Sends standard input to the program executing on the remote host.
 void setCommand(java.lang.String command)
          The command to be sent to the remote host.
 void setConnected(boolean connected)
          Shows whether the bean is connected.
 void setEOL(byte[] EOL)
          Used to break the stdout data stream into chunks separated by its value.
 void setErrEOL(byte[] errEOL)
          Used to break the stderr data stream into chunks separated by its value.
 void setFirewall(Firewall firewall)
          A set of properties related to firewall access.
 void setLocalHost(java.lang.String localHost)
          The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
 void setLocalPort(int localPort)
          The TCP port in the local host where the bean binds.
 void setLocalUser(java.lang.String localUser)
          The identifier of the user on the local machine.
 void setRemoteHost(java.lang.String remoteHost)
          The address of the remote host.
 void setRemotePort(int remotePort)
          The remote shell service port (default is 514).
 void setRemoteUser(java.lang.String remoteUser)
          The id of the user on the remote host.
 void setStdin(byte[] stdin)
          A string of data to be sent to the remote host while connected.
 void setTimeout(int timeout)
          A timeout for the bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rshell

public Rshell()
Creates an instance of Rshell Bean.


Rshell

public Rshell(java.lang.String runtimeLicense)
Creates an instance of Rshell Bean with specified run-time license.

Method Detail

getBytesSent

public int getBytesSent()
The number of bytes actually sent after an assignment to Stdin.

The BytesSent property shows how many bytes were sent after the last assignment to Stdin . Please check the Stdin property for more information.


getCommand

public java.lang.String getCommand()
The command to be sent to the remote host.

This property contains the command to be sent to the remote host. Assigning a UNIX command to this property makes the bean attempt to connect to the RemoteHost and execute the command using the rshell protocol. There is no need to append an end-of-line character to the command.

If "" (empty string) is assigned to the Command property, the current connection is broken.

Example (Execute a Command)

 RshellControl.Command = "cd /home/username/; ls -al; cd/; ls" 


setCommand

public void setCommand(java.lang.String command)
                throws IPWorksException
The command to be sent to the remote host.

This property contains the command to be sent to the remote host. Assigning a UNIX command to this property makes the bean attempt to connect to the RemoteHost and execute the command using the rshell protocol. There is no need to append an end-of-line character to the command.

If "" (empty string) is assigned to the Command property, the current connection is broken.

Example (Execute a Command)

 RshellControl.Command = "cd /home/username/; ls -al; cd/; ls" 

Throws:
IPWorksException

isConnected

public boolean isConnected()
Shows whether the bean is connected.

This property is used to determine whether or not the bean is connected to the remote host.


setConnected

public void setConnected(boolean connected)
                  throws IPWorksException
Shows whether the bean is connected.

This property is used to determine whether or not the bean is connected to the remote host.

Throws:
IPWorksException

isEOF

public boolean isEOF()
If True, the connection has closed, and there is no buffered data available.

EOF is an acronym for "End Of File".


getEOL

public byte[] getEOL()
Used to break the stdout data stream into chunks separated by its value.

The EOL property is used to define boundaries in the Stdout stream using the value of the property.


setEOL

public void setEOL(byte[] EOL)
            throws IPWorksException
Used to break the stdout data stream into chunks separated by its value.

The EOL property is used to define boundaries in the Stdout stream using the value of the property.

Throws:
IPWorksException

getErrEOL

public byte[] getErrEOL()
Used to break the stderr data stream into chunks separated by its value.

The ErrEOL property is used to define boundaries in the Stderr stream using the value of the property.


setErrEOL

public void setErrEOL(byte[] errEOL)
               throws IPWorksException
Used to break the stderr data stream into chunks separated by its value.

The ErrEOL property is used to define boundaries in the Stderr stream using the value of the property.

Throws:
IPWorksException

getErrorMessage

public java.lang.String getErrorMessage()
The error message returned when any of the steps prior to command execution fail.

This error message is returned on a separate connection associated with error messages.


getFirewall

public Firewall getFirewall()
A set of properties related to firewall access.

This is a Firewall type property which contains fields describing the firewall through which the bean will attempt to connect.


setFirewall

public void setFirewall(Firewall firewall)
                 throws IPWorksException
A set of properties related to firewall access.

This is a Firewall type property which contains fields describing the firewall through which the bean will attempt to connect.

Throws:
IPWorksException

getLocalHost

public java.lang.String getLocalHost()
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multi-homed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multi-homed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.


setLocalHost

public void setLocalHost(java.lang.String localHost)
                  throws IPWorksException
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multi-homed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multi-homed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.

Throws:
IPWorksException

getLocalPort

public int getLocalPort()
The TCP port in the local host where the bean binds.

The LocalPort property must be set before a connection is attempted. It instructs the bean to bind to a specific port (or communication endpoint) in the local machine.

Setting it to 0 (default) enables the bean to choose a port at random. The chosen port will be shown by the LocalPort property after the connection is established.

LocalPort cannot be changed once a connection is made. Any attempt to set the LocalPort property when a connection is active will generate an error.

Use this property with caution. If you supply a value, it must be an available port on the system, or an error will be returned. Furthermore, the bean always attempts to bind to a secure (sub 1000) port when the value of LocalPort is the default (0). If you supply your own value, make sure the remote system is configured to allow that particular value.


setLocalPort

public void setLocalPort(int localPort)
                  throws IPWorksException
The TCP port in the local host where the bean binds.

The LocalPort property must be set before a connection is attempted. It instructs the bean to bind to a specific port (or communication endpoint) in the local machine.

Setting it to 0 (default) enables the bean to choose a port at random. The chosen port will be shown by the LocalPort property after the connection is established.

LocalPort cannot be changed once a connection is made. Any attempt to set the LocalPort property when a connection is active will generate an error.

Use this property with caution. If you supply a value, it must be an available port on the system, or an error will be returned. Furthermore, the bean always attempts to bind to a secure (sub 1000) port when the value of LocalPort is the default (0). If you supply your own value, make sure the remote system is configured to allow that particular value.

Throws:
IPWorksException

getLocalUser

public java.lang.String getLocalUser()
The identifier of the user on the local machine.

This property contains the identifier of the user on the local machine. This must be the identifier of a user in the local host for whom remote execution of commands is permitted in the remote host.


setLocalUser

public void setLocalUser(java.lang.String localUser)
                  throws IPWorksException
The identifier of the user on the local machine.

This property contains the identifier of the user on the local machine. This must be the identifier of a user in the local host for whom remote execution of commands is permitted in the remote host.

Throws:
IPWorksException

getRemoteHost

public java.lang.String getRemoteHost()
The address of the remote host. Domain names are resolved to IP addresses.

This property specifies the IP address (IP number in dotted internet format) or Domain Name of the remote host. It is set before a connection is attempted and cannot be changed once a connection is established.

If this property is set to a Domain Name, a DNS request is initiated, and upon successful termination of the request, this property is set to the corresponding address. If the search is not successful, an error is returned.

If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with an "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.

Example (Connecting)

 IPPortControl.RemoteHost = "MyHostNameOrIP"
 IPPortControl.RemotePort = 777
 IPPortControl.Connected = true 


setRemoteHost

public void setRemoteHost(java.lang.String remoteHost)
                   throws IPWorksException
The address of the remote host. Domain names are resolved to IP addresses.

This property specifies the IP address (IP number in dotted internet format) or Domain Name of the remote host. It is set before a connection is attempted and cannot be changed once a connection is established.

If this property is set to a Domain Name, a DNS request is initiated, and upon successful termination of the request, this property is set to the corresponding address. If the search is not successful, an error is returned.

If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with an "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.

Example (Connecting)

 IPPortControl.RemoteHost = "MyHostNameOrIP"
 IPPortControl.RemotePort = 777
 IPPortControl.Connected = true 

Throws:
IPWorksException

getRemotePort

public int getRemotePort()
The remote shell service port (default is 514).

This property specifies the rshell service port on the remote host.

A valid port number (a value between 1 and 65535) is required for the connection to take place. This property must be set before command execution is attempted.


setRemotePort

public void setRemotePort(int remotePort)
                   throws IPWorksException
The remote shell service port (default is 514).

This property specifies the rshell service port on the remote host.

A valid port number (a value between 1 and 65535) is required for the connection to take place. This property must be set before command execution is attempted.

Throws:
IPWorksException

getRemoteUser

public java.lang.String getRemoteUser()
The id of the user on the remote host.

This must be the id of a user in the remote host for whom remote execution of commands is permitted.


setRemoteUser

public void setRemoteUser(java.lang.String remoteUser)
                   throws IPWorksException
The id of the user on the remote host.

This must be the id of a user in the remote host for whom remote execution of commands is permitted.

Throws:
IPWorksException

getStderr

public byte[] getStderr()
Returns the standard error output (stderr) from the remote application.

The property is set to an empty string before each new request.


setStdin

public void setStdin(byte[] stdin)
              throws IPWorksException
A string of data to be sent to the remote host while connected.

This property is used to provide input for the process in the remote host.

If you are sending data to the remote host faster than it can process it, or faster than the network bandwidth allows, the outgoing queue might fill up. When this happens, Stdin fails with exception 10035: "[10035] Operation would block" (WSAEWOULDBLOCK). You can check this error, and then try to send the data again.

Throws:
IPWorksException

getStdout

public byte[] getStdout()
Provides the standard output (stdout) from the remote application.

The property is set to an empty string before each new request.


getTimeout

public int getTimeout()
A timeout for the bean.

If the Timeout property is set to 0, all operations return immediately, potentially failing with an error if they can't be completed immediately.

If Timeout is set to a positive value, the bean will wait for the operation to complete before returning control.

The bean will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.

If Timeout expires, and the operation is not yet complete, the bean throws an exception.

Please note that by default, all timeouts are inactivity timeouts , i.e. the timeout period is extended by Timeout seconds when any amount of data is successfully sent or received.

Optionally, the behavior of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum of Timeout seconds since the beginning of the operation, without extending the timeout period during communications.

This behavior is controlled by the AbsoluteTimeout configuration setting.

The default value for the Timeout property is 60 seconds.


setTimeout

public void setTimeout(int timeout)
                throws IPWorksException
A timeout for the bean.

If the Timeout property is set to 0, all operations return immediately, potentially failing with an error if they can't be completed immediately.

If Timeout is set to a positive value, the bean will wait for the operation to complete before returning control.

The bean will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.

If Timeout expires, and the operation is not yet complete, the bean throws an exception.

Please note that by default, all timeouts are inactivity timeouts , i.e. the timeout period is extended by Timeout seconds when any amount of data is successfully sent or received.

Optionally, the behavior of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum of Timeout seconds since the beginning of the operation, without extending the timeout period during communications.

This behavior is controlled by the AbsoluteTimeout configuration setting.

The default value for the Timeout property is 60 seconds.

Throws:
IPWorksException

config

public java.lang.String config(java.lang.String configurationString)
                        throws IPWorksException
Sets or retrieves a configuration setting.

Config is a generic method available in every bean. It is used to set and retrieve configuration settings for the bean.

Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the bean, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY , you must call Config("PROPERTY=VALUE") , where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY") . The value will be returned as a string.

The bean accepts one or more of the following configuration settings . Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the bean, access to these internal properties is provided through the Config method.

Rexec/Rshell Configuration Settings

EnableStderr
Enables or disables secondary (stderr) stream
Some systems (most notably certain versions of Linux) do not support the secondary stderr stream of rexec/rshell. For these systems you must turn stderr off. Any stderr output will then be provided through stdout.The default value for this setting is True.

StderrPort
The local port from which the remote system sends the stderr stream
The default value is 0, which instructs the bean to use a random port. Use this property with caution. If you supply a value, it must be an available port on the system or an error will be returned.Some systems do not support secondary stderr streams. Please refer to the EnableStderr configuration setting for more information.

MaxStdout
Maximum storage available for the stdout buffer
This indicates the maximum amount of characters that the bean will store in the Stdout property. The default value is -1, which indicates there is no maximum. A value of zero (0) will disable accumulation of stdout in the Stdout property, although the Stdout event will still continue to fire.
MaxStderr
Maximum storage available for the stderr buffer
This indicates the maximum amount of characters that the bean will store in the Stderr property. The default value is -1, which indicates there is no maximum. A value of zero (0) will disable accumulation of stderr in the Stderr property, although the Stderr event will still continue to fire.

IPPort Configuration Settings

FirewallAutoDetect
Tells the bean whether or not to automatically detect and use firewall system settings, if available
This is the same as AutoDetect . This setting is provided for use by beans that do not directly expose Firewall properties.
FirewallHost
Name or IP address of firewall (optional)
If a FirewallHost is given, requested connections will be authenticated through the specified firewall when connecting.If the FirewallHost setting is set to a Domain Name, a DNS request is initiated. Upon successful termination of the request, the FirewallHost setting is set to the corresponding address. If the search is not successful, an error is returned.

NOTE: This is the same as Host . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallListener
If true, the component binds to a SOCKS firewall as a server (IPPort only)
This entry is for IPPort only and does not work for other components that descend from IPPort.If this entry is set, the bean acts as a server. RemoteHost and RemotePort are used to tell the SOCKS firewall in which address and port to listen to. The firewall rules may ignore RemoteHost , and it is recommended that RemoteHost be set to empty string in this case.

RemotePort is the port in which the firewall will listen to. If set to 0, the firewall will select a random port. The binding (address and port) is provided through the ConnectionStatus event.

The connection to the firewall is made by calling the Connect method.

FirewallPassword
Password to be used if authentication is to be used when connecting through the firewall
If FirewallHost is specified, the FirewallUser and FirewallPassword settings are used to connect and authenticate to the given firewall. If the authentication fails, the bean throws an exception.NOTE: This is the same as Password . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallPort
The TCP port for the FirewallHost;
Note that the FirewallPort is set automatically when FirewallType is set to a valid value.NOTE: This is the same as Port . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallType
Determines the type of firewall to connect through
The appropriate values are as follows:
0
No firewall (default setting).
1
Connect through a tunneling proxy. FirewallPort is set to 80.
2
Connect through a SOCKS4 Proxy. FirewallPort is set to 1080.
3
Connect through a SOCKS5 Proxy. FirewallPort is set to 1080.
NOTE: This is the same as FirewallType . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallUser
A user name if authentication is to be used connecting through a firewall
If the FirewallHost is specified, the FirewallUser and FirewallPassword settings are used to connect and authenticate to the Firewall. If the authentication fails, the bean throws an exception.NOTE: This is the same as User . This setting is provided for use by beans that do not directly expose Firewall properties.

KeepAliveTime
The inactivity time in milliseconds before a TCP keep-alive packet is sent
When set, TCPKeepAlive will automatically be set to true. By default the operating system will determine the time a connection is idle before a TCP keep-alive packet is sent. This system default if this value is not specified here is 2 hours. In many cases a shorter interval is more useful. Set this value to the desired interval in milliseconds.Note: This value is not applicable in Java.

KeepAliveInterval
The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received
When set, TCPKeepAlive will automatically be set to true. A TCP keep-alive packet will be sent after a period of inactivity as defined by KeepAliveTime . If no acknowledgement is received from the remote host the keep-alive packet will be re-sent. This setting specifies the interval at which the successive keep-alive packets are sent in milliseconds. This system default if this value is not specified here is 1 second.Note: This value is not applicable in Java or MAC.

Linger
When set to True, connections are terminated gracefully
This property controls how a connection is closed. The default is True.In the case that Linger is True (default), there are two scenarios for determining how long the connection will linger. The first, if LingerTime is 0 (default), the system will attempt to send pending data for a connection until the default IP protocol timeout expires.

In the second scenario, LingerTime is a positive value, the system will attempt to send pending data until the specified LingerTime is reached. If this attempt fails, then the system will reset the connection.

The default behavior (which is also the default mode for stream sockets) might result in a long delay in closing the connection. Although the bean returns control immediately, the system could hold system resources until all pending data is sent (even after your application closes).

Setting this property to False forces an immediate disconnection. If you know that the other side has received all the data you sent (by a client acknowledgment, for example), setting this property to False might be the appropriate course of action.

LingerTime
Time in seconds to have the connection linger
LingerTime is the time, in seconds, to leave the socket connection linger. This value is 0 by default, which means it will use the default IP protocol timeout.
LocalHost
The name of the local host through which connections are initiated or accepted
The LocalHost setting contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.In multi-homed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost setting shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multi-homed hosts (machines with more than one IP interface).

LocalPort
The TCP port in the local host where the bean binds
This must be set before a connection is attempted. It instructs the bean to bind to a specific port (or communication endpoint) in the local machine.Setting this to 0 (default) enables the system to choose a port at random. The chosen port will be shown by LocalPort after the connection is established.

LocalPort cannot be changed once a connection is made. Any attempt to set this when a connection is active will generate an error.

This; setting is useful when trying to connect to services that require a trusted port in the client side. An example is the remote shell (rsh) service in UNIX systems.

MaxLineLength
The maximum amount of data to accumulate when no EOL is found
MaxLineLength is the size of an internal buffer, which holds received data while waiting for an EOL string.If an EOL string is found in the input stream before MaxLineLength bytes are received, the DataIn event is fired with the EOL parameter set to True, and the buffer is reset.

If no EOL is found, and MaxLineLength bytes are accumulated in the buffer, the DataIn event is fired with the EOL parameter set to False, and the buffer is reset.

The minimum value for MaxLineLength is 256 bytes. The default value is 2048 bytes. The maximum value is 65536 bytes.

MaxTransferRate
The transfer rate limit in bytes per second
This setting can be used to throttle outbound TCP traffic. Set this to the number of bytes to be sent per second. By default this is not set and there is no limit.
TCPKeepAlive
Determines whether or not the keep alive socket option is enabled
If set to true, the socket's keep-alive option is enabled and keep-alive packets will be sent periodically to maintain the connection. Set KeepAliveTime and KeepAliveInterval to configure the timing of the keep-alive packets.Note: This value is not applicable in Java.

UseIPv6
Whether or not to use IPv6
By default, the component expects an IPv4 address for local and remote host properties, and will create an IPv4 socket. To use IPv6 instead, set this to True.
CloseStreamAfterTransfer
If true, the component will close the upload or download stream after the transfer
This entry is for bean and all the components that descend from it.This property is true by default. Therefore, by default, all streams will be closed after a transfer is completed. In order to keep streams open after the transfer of data, you must set this config to false.

TcpNoDelay
Whether or not to delay when sending packets
When true, the socket will send all data that is ready to send at once. When false, the socket will send smaller buffered packets of data at small intervals. This is known as the Nagle algorithm.By default, this config is set to false.

Socket Configuration Settings

AbsoluteTimeout
Determines whether timeouts are inactivity timeouts or absolute timeouts
If AbsoluteTimeout is set to True, any method which does not complete within Timeout seconds will be aborted. By default, AbsoluteTimeout is False, and the timeout is an inactivity timeout.
FirewallData
Used to send extra data to the firewall
When the firewall is a tunneling proxy, use this property to send custom (additional) headers to the firewall (e.g. headers for custom authentication schemes).
InBufferSize
The size in bytes of the incoming queue of the socket
This is the size of an internal queue in the TCP/IP stack. You can increase or decrease its size depending on the amount of data that you will be receiving. Increasing the value of the InBufferSize setting can provide significant improvements in performance in some cases.Some TCP/IP implementations do not support variable buffer sizes. If that is the case, when the bean is activated the InBufferSize reverts to its defined size. The same happens if you attempt to make it too large or too small.

OutBufferSize
The size in bytes of the outgoing queue of the socket
This is the size of an internal queue in the TCP/IP stack. You can increase or decrease its size depending on the amount of data that you will be sending. Increasing the value of the OutBufferSize setting can provide significant improvements in performance in some cases.Some TCP/IP implementations do not support variable buffer sizes. If that is the case, when the bean is activated the OutBufferSize reverts to its defined size. The same happens if you attempt to make it too large or too small.

Base Configuration Settings

GUIAvailable
Tells the bean whether or not a message loop is available for processing events
In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The bean will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.In some non-GUI applications an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GuiAvailable to false will ensure that the bean does not attempt to process external events.

Throws:
IPWorksException

disconnect

public void disconnect()
                throws IPWorksException
Disconnects from the RemoteHost .

This method disconnects from the RemoteHost . Calling this method is normally unnecessary, unless you wish to interrupt the remote program, or the remote program is waiting for standard input to end before terminating.

Throws:
IPWorksException

doEvents

public void doEvents()
              throws IPWorksException
Processes events from the internal message queue.

When DoEvents is called, the bean processes any available events. If no events are available, it waits for a preset period of time, and then returns.

Throws:
IPWorksException

execute

public void execute(java.lang.String command)
             throws IPWorksException
Executes a Command on the remote host.

This method executes a Command on the remote host. Calling this method is equivalent to setting the Command property to Command .

Example (Execute a Command)

 RshellControl.Execute("cd /home/username/; ls -al; cd/; ls") 

Throws:
IPWorksException

interrupt

public void interrupt()
               throws IPWorksException
Interrupt the current method.

If there is no method in progress, Interrupt simply returns, doing nothing.

Throws:
IPWorksException

send

public void send(byte[] text)
          throws IPWorksException
Sends standard input to the program executing on the remote host.

This method sends standard input to the program executing on the remote host. Calling this method is equivalent to setting the Stdin property to Text .

Throws:
IPWorksException

addRshellEventListener

public void addRshellEventListener(RshellEventListener l)
                            throws java.util.TooManyListenersException
Throws:
java.util.TooManyListenersException

removeRshellEventListener

public void removeRshellEventListener(RshellEventListener l)

IP*Works! V9

Copyright (c) 2013 /n software inc. - All rights reserved.