SQLFire 1.0

com.vmware.sqlfire
Interface NetworkInterface


public interface NetworkInterface

Encapsulates a network listener that clients can use to connect using SQLFire JDBC client driver (URL of the form 'jdbc:sqlfire://<host>:<port>'). A new interface can be created using FabricService.startNetworkServer(String, int, Properties) -- see FabricServer API for details.

See Also:
FabricServer

Nested Class Summary
static interface NetworkInterface.ConnectionListener
          A listener which can be registered on NetworkInterface in order to receive events about connections created or destroyed for a client on the DRDA network server.
 
Method Summary
 String asString()
          Get the string representation of this NetworkInterface in '<host>/<bind-address>[<port>]' format.
 Properties getCurrentProperties()
          Get current Network server properties
 String getHostName()
          Get the host name of this network server.
 int getMaxThreads()
          Returns the current maxThreads setting for the running Network Server
 int getPort()
          Get the port of this network server.
 String getRuntimeInfo()
          Return detailed session runtime information about sessions, prepared statements, and memory usage for the running Network Server.
 String getSysinfo()
          Return classpath and version information about the running Network Server.
 int getTimeSlice()
          Return the current timeSlice setting for the running Network Server
 int getTotalConnections()
          Get the total number of current connections to this network server.
 void logConnections(boolean on)
          Turn logging connections on or off.
 void setConnectionListener(NetworkInterface.ConnectionListener listener)
          Set a new NetworkInterface.ConnectionListener for this network server.
 void setMaxThreads(int max)
          Set Network Server maxthread parameter.
 void setTimeSlice(int timeslice)
          Set Network Server connection time slice parameter.
 void setTraceDirectory(String traceDirectory)
          Set directory for trace files.
 boolean status()
          Whether the network server is listening on the configured port or not.
 void stop()
          Stop listening on network clients on this network server control.
 void trace(boolean on)
          Turn tracing on or off for all sessions on the Network Server.
 void trace(int connNum, boolean on)
          Turn tracing on or off for the specified connection on the Network Server.
 

Method Detail

stop

void stop()
Stop listening on network clients on this network server control.


status

boolean status()
Whether the network server is listening on the configured port or not.

Returns:
true if server socket is open for connection, otherwise false.

trace

void trace(boolean on)
Turn tracing on or off for all sessions on the Network Server.

Parameters:
on - true to turn tracing on, false to turn tracing off.

trace

void trace(int connNum,
           boolean on)
Turn tracing on or off for the specified connection on the Network Server.

Parameters:
connNum - connection number. Note: Connection numbers will print in the SQLFire error log if logConnections is on.
on - true to turn tracing on, false to turn tracing off.

logConnections

void logConnections(boolean on)
Turn logging connections on or off. When logging is turned on a message is written to the SQLFire log each time a connection is made.

Parameters:
on - true to turn on, false to turn off

setTraceDirectory

void setTraceDirectory(String traceDirectory)
Set directory for trace files. The directory must be on the machine where the server is running.

Parameters:
traceDirectory - directory for trace files on machine where server is running

setConnectionListener

void setConnectionListener(NetworkInterface.ConnectionListener listener)
Set a new NetworkInterface.ConnectionListener for this network server. This will replace any old listener if any.

Parameters:
listener - the NetworkInterface.ConnectionListener to be added

getSysinfo

String getSysinfo()
Return classpath and version information about the running Network Server.

Returns:
sysinfo output

getRuntimeInfo

String getRuntimeInfo()
Return detailed session runtime information about sessions, prepared statements, and memory usage for the running Network Server.

Returns:
run time information

setMaxThreads

void setMaxThreads(int max)
Set Network Server maxthread parameter. This is the maximum number of threads that will be used for JDBC client connections. setTimeSlice should also be set so that clients will yield appropriately.

Parameters:
max - maximum number of connection threads. If <= 0, connection threads will be created when there are no free connection threads.
See Also:
setTimeSlice(int)

getMaxThreads

int getMaxThreads()
Returns the current maxThreads setting for the running Network Server

Returns:
maxThreads setting
See Also:
setMaxThreads(int)

setTimeSlice

void setTimeSlice(int timeslice)
Set Network Server connection time slice parameter. This should be set and is only relevant if setMaxThreads > 0.

Parameters:
timeslice - number of milliseconds given to each session before yielding to another session, if <=0, never yield.
See Also:
setMaxThreads(int)

getTimeSlice

int getTimeSlice()
Return the current timeSlice setting for the running Network Server

Returns:
timeSlice setting
See Also:
setTimeSlice(int)

getCurrentProperties

Properties getCurrentProperties()
Get current Network server properties

Returns:
Properties object containing Network server properties

asString

String asString()
Get the string representation of this NetworkInterface in '<host>/<bind-address>[<port>]' format.


getTotalConnections

int getTotalConnections()
Get the total number of current connections to this network server.


getHostName

String getHostName()
Get the host name of this network server.


getPort

int getPort()
Get the port of this network server.


SQLFire 1.0

Copyright © 2010-2011 VMware, Inc. All rights reserved.