|
i-net Konnekter | ||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectcom.inet.jj.srv.JJServer
This is the i-net Konnekter(TM) server.
| Field Summary | |
static int |
LOG_DEBUG
|
static int |
LOG_FATAL
|
static int |
LOG_INFO
|
static int |
LOG_WARNING
|
| Constructor Summary | |
JJServer()
Creates a new i-net Konnekter server on the default port (9876). |
|
JJServer(int port)
Creates a new i-net Konnekter server on a specified port. |
|
| Method Summary | |
java.lang.Object |
addCommand(java.lang.String name,
JavaCommandFactory cmdFactory)
Adds a new JavaCommandFactory to the command current list. |
java.lang.Object |
addCommand(java.lang.String name,
java.lang.String sql)
Adds a new command to the current list. |
java.util.Properties |
addUDS(java.lang.String name,
java.lang.String driver,
java.lang.String url)
Adds a new User Data Source specified by a name and adds the driver's name and url for a certain database to the list. |
java.util.Properties |
addUDS(java.lang.String name,
java.lang.String driver,
java.lang.String url,
java.util.Properties info)
Adds a new User Data Source specified by a name and adds the driver's name, url and properties for a certain database to the list. |
java.util.Properties |
addUDS(java.lang.String name,
java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String password)
Adds a new User Data Source specified by a name and adds the driver's name, url, user name and password for a certain database to the list. |
java.lang.Object |
getCommand(java.lang.String name)
Returns the sql statement for this command. |
int |
getConnectedClientCount()
Returns the current number of the connected clients. |
java.util.Vector |
getConnectedHostNames()
Returns a list of the client's host names connected to the server. |
java.util.Vector |
getConnectedHostNames(java.lang.String uds)
Returns the list of the client's host names connected to the specified UDS on the server. |
java.sql.Connection |
getConnection(java.lang.String uds)
Try to make a database connection for the given UserDataSource. |
java.util.Vector |
getCurrentExecutingCommands()
Returns a list of current executing commands or SQL statements for all clients. |
java.util.Vector |
getCurrentExecutingCommands(java.lang.String host)
Returns a list of current executing commands or SQL statements for a certain client. |
int |
getDBConnectionCount()
Returns the current number of connections to the databases. |
int |
getDBConnectionCount(java.lang.String host)
Returns the current number of connections to the databases for a specified host. |
int |
getDBFreeConnectionCount()
Returns the number of connections to the databases which are currently not in use. |
int |
getInactiveTimeout()
Returns the current inactive timeout. |
long |
getInitialTime(java.lang.String host)
Returns the initial time of the client's connection. |
int |
getLogLevel()
Get the log level. |
java.io.PrintStream |
getLogStream()
Returns the server's log stream. |
int |
getMaxConnectionCount()
Returns the number of possible maximum connections. |
boolean |
getOnlyCommandMode()
Returns the current server command mode. |
int |
getOpenCallableStatementCount()
Returns the current number of the callable statements opened on the server. |
int |
getOpenCallableStatementCount(java.lang.String host)
Returns the current number of the callable statements opened on the server for a client. |
java.util.Vector |
getOpenedCommands()
Returns a list of commands which are opened on the server for all clients. |
java.util.Vector |
getOpenedCommands(java.lang.String host)
Returns a list of commands which are opened on the server for specified client. |
int |
getOpenJavaCommandCount()
Returns the current number of the JavaCommands opened on the server. |
int |
getOpenJavaCommandCount(java.lang.String host)
Returns the current number of the callable statements opened on the server for a client. |
int |
getOpenPreparedStatementCount()
Returns the current number of the prepared statements opened on the server. |
int |
getOpenPreparedStatementCount(java.lang.String host)
Returns the current number of the prepared statements opened on the server for a client. |
int |
getOpenResultSetCount()
Returns the current number of the ResultSets opened on the server. |
int |
getOpenResultSetCount(java.lang.String host)
Returns the current number of the ResultSets opened on the server for a client. |
int |
getOpenStatementCount()
Returns the current number of the statements opened on the server. |
int |
getOpenStatementCount(java.lang.String host)
Returns the current number of the statements opened on the server for a client. |
int |
getPoolLoginTimeout()
Returns the maximum time in seconds that the PoolManager can wait when the maximum number of connections for a DataSource is in use. |
int |
getPoolTimeout()
Returns timeout of an unused connection in the pool before the connection was closed. |
java.util.Properties |
getUDS(java.lang.String name)
Returns a User Data Source specified by it's name as java.util.Properties object.
|
boolean |
isLobToStream()
Get the flag logToStreams. |
void |
removeAllCommands()
Removes all commands from the current list. |
void |
removeAllUDS()
Removes all User Data Sources from the list. |
java.lang.Object |
removeCommand(java.lang.String name)
Removes the command from the current list. |
java.util.Properties |
removeUDS(java.lang.String name)
Removes the specified User Data Source from the list. |
void |
run()
For internal use only. |
void |
setInactiveTimeout(int timeout)
Sets the time which the server will be waiting for a client's request. |
void |
setLobToStream(boolean lobToStream)
Sett the flag logToStreams. |
void |
setLogLevel(int level)
Set the log level. |
void |
setLogStream(java.io.PrintStream out)
Sets the PrintStream object to log the server. |
void |
setMaxConnectionCount(int max)
Sets the number of maximum connections to be made for the PoolManager. |
void |
setOnlyCommandMode(boolean mode)
If the "only command" mode is enabled then the server will accept commands, only. |
void |
setPoolLoginTimeout(int timeout)
Sets the maximum time in seconds that the PoolManager can wait when the maximum number of connections for a DataSource is in use. |
void |
setPoolTimeout(int poolTimeout)
This property sets the minimum time in seconds the PoolManager is waiting before an unused real connection to a database will be closed and removed from the pool. |
void |
start()
Starts the i-net Konnekter(TM) server. |
void |
stop()
Stops the i-net Konnekter(TM) server. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int LOG_FATAL
public static final int LOG_WARNING
public static final int LOG_INFO
public static final int LOG_DEBUG
| Constructor Detail |
public JJServer()
public JJServer(int port)
port - the port number.| Method Detail |
public void start()
throws java.lang.Exception
java.lang.Exception - if it is unable to start the server. E.g. if the specified port is in use.stop()public void run()
run in interface java.lang.Runnablepublic void stop()
start()
public java.util.Properties addUDS(java.lang.String name,
java.lang.String driver,
java.lang.String url,
java.util.Properties info)
name - the data source name.driver - the driver name.url - the driver url.info - the driver properties.
null if there was no such UDS.addUDS(String, String, String),
addUDS(String, String, String, String, String),
getUDS(String),
removeUDS(String),
removeAllUDS()
public java.util.Properties addUDS(java.lang.String name,
java.lang.String driver,
java.lang.String url,
java.lang.String user,
java.lang.String password)
name - the data source name.driver - the driver name.url - the driver url.user - the user name.password - the password.
null if there was no such UDS.addUDS(String, String, String),
addUDS(String, String, String, Properties),
getUDS(String),
removeUDS(String),
removeAllUDS()
public java.util.Properties addUDS(java.lang.String name,
java.lang.String driver,
java.lang.String url)
name - the data source name.driver - the driver name.url - the driver url.
null if there was no such UDS.addUDS(String, String, String, Properties),
addUDS(String, String, String, String, String),
getUDS(String),
removeUDS(String),
removeAllUDS()public java.util.Properties removeUDS(java.lang.String name)
name - the name of the user data source.
null if there was no such UDS.removeAllUDS(),
addUDS(String, String, String),
addUDS(String, String, String, Properties),
addUDS(String, String, String, String, String),
getUDS(String)public void removeAllUDS()
removeUDS(String),
addUDS(String, String, String),
addUDS(String, String, String, Properties),
addUDS(String, String, String, String, String),
getUDS(String)public java.util.Properties getUDS(java.lang.String name)
java.util.Properties object.
With the get(String key) method you can get each property of the UDS, e.g. get("url") returns the url.
name - the data source name.
java.util.Properties object or null if UDS under this name not exist.addUDS(String, String, String),
addUDS(String, String, String, String, String),
addUDS(String, String, String, Properties),
removeUDS(String),
removeAllUDS()public void setInactiveTimeout(int timeout)
timeout - the timeout in secondsgetInactiveTimeout()public int getInactiveTimeout()
setInactiveTimeout(int)public void setLogStream(java.io.PrintStream out)
setLogStream(new PrintStream(new FileOutputStream("server.log")))setLogStream(System.out)
out - the logging PrintStream object; null to disable logging.getLogStream()public java.io.PrintStream getLogStream()
setLogStream(java.io.PrintStream)public void setLogLevel(int level)
level - the new log levelLOG_FATAL,
LOG_WARNING,
LOG_INFO,
LOG_DEBUG,
setLogStream(java.io.PrintStream),
getLogLevel()public int getLogLevel()
setLogLevel(int)public void setPoolTimeout(int poolTimeout)
poolTimeout - timeout of the unused connection in secondsgetPoolTimeout()public int getPoolTimeout()
setPoolTimeout(int)public void setMaxConnectionCount(int max)
max - the number of maximum connections.getMaxConnectionCount()public int getMaxConnectionCount()
setMaxConnectionCount(int)public void setPoolLoginTimeout(int timeout)
timeout - the timeout in seconds.getPoolLoginTimeout(),
setMaxConnectionCount(int),
getMaxConnectionCount()public int getPoolLoginTimeout()
setPoolLoginTimeout(int),
setMaxConnectionCount(int),
getMaxConnectionCount()
public java.lang.Object addCommand(java.lang.String name,
java.lang.String sql)
addCommand("Query 1", "select * from myTable")
addCommand("insert 1", "insert into table1 values (?,?)")
name - the command's namesql - the sql statement
null if there was no such command.addCommand(String, JavaCommandFactory),
getCommand(String),
removeCommand(String),
removeAllCommands(),
setOnlyCommandMode(boolean),
getOnlyCommandMode()
public java.lang.Object addCommand(java.lang.String name,
JavaCommandFactory cmdFactory)
name - the command's namecmdFactory - the Java Command Factory that creates the Java Command.
null if there was no such command.JavaCommand,
JavaCommandFactory,
addCommand(String, String),
getCommand(String),
removeCommand(String),
removeAllCommands(),
setOnlyCommandMode(boolean),
getOnlyCommandMode()public java.lang.Object removeCommand(java.lang.String name)
name - the command's name.
null if there was no such command.public void removeAllCommands()
public java.lang.Object getCommand(java.lang.String name)
name - the command's name.
null if there is no such command.public void setOnlyCommandMode(boolean mode)
mode - true to enable "only command" mode, false to disable.addCommand(String, String)public boolean getOnlyCommandMode()
true if the "only command mode" is turned on, false otherwise.setOnlyCommandMode(boolean)public void setLobToStream(boolean lobToStream)
lobToStream - the new valuepublic boolean isLobToStream()
setLobToStream(boolean)
public java.sql.Connection getConnection(java.lang.String uds)
throws java.sql.SQLException
uds - the name of the User Data Source defined on the server.
java.sql.SQLExceptionpublic int getDBConnectionCount()
getDBFreeConnectionCount()public int getDBConnectionCount(java.lang.String host)
host - the host name
getDBFreeConnectionCount()public int getDBFreeConnectionCount()
getDBConnectionCount()public int getConnectedClientCount()
public int getOpenResultSetCount()
getOpenResultSetCount(String),
getOpenStatementCount(),
getOpenPreparedStatementCount(),
getOpenCallableStatementCount(),
getOpenJavaCommandCount()public int getOpenResultSetCount(java.lang.String host)
host - the client's host name
getOpenResultSetCount(),
getOpenStatementCount(String),
getOpenPreparedStatementCount(String),
getOpenCallableStatementCount(String),
getOpenJavaCommandCount(String),
getConnectedHostNames()public int getOpenStatementCount()
getOpenStatementCount(String),
getOpenResultSetCount(),
getOpenPreparedStatementCount(),
getOpenCallableStatementCount(),
getOpenJavaCommandCount()public int getOpenStatementCount(java.lang.String host)
host - the client's host name
getOpenStatementCount(),
getOpenResultSetCount(String),
getOpenPreparedStatementCount(String),
getOpenCallableStatementCount(String),
getOpenJavaCommandCount(String),
getConnectedHostNames()public int getOpenPreparedStatementCount()
getOpenPreparedStatementCount(String),
getOpenStatementCount(),
getOpenResultSetCount(),
getOpenCallableStatementCount(),
getOpenJavaCommandCount()public int getOpenPreparedStatementCount(java.lang.String host)
host - the client's host name
getOpenPreparedStatementCount(),
getOpenResultSetCount(String),
getOpenStatementCount(String),
getOpenCallableStatementCount(String),
getOpenJavaCommandCount(String),
getConnectedHostNames()public int getOpenCallableStatementCount()
getOpenCallableStatementCount(String),
getOpenStatementCount(),
getOpenResultSetCount(),
getOpenPreparedStatementCount(),
getOpenJavaCommandCount()public int getOpenCallableStatementCount(java.lang.String host)
host - the client's host name
getOpenCallableStatementCount(),
getOpenResultSetCount(String),
getOpenStatementCount(String),
getOpenPreparedStatementCount(String),
getOpenJavaCommandCount(String),
getConnectedHostNames()public int getOpenJavaCommandCount()
getOpenStatementCount(),
getOpenResultSetCount(),
getOpenPreparedStatementCount(),
getOpenJavaCommandCount(String)public int getOpenJavaCommandCount(java.lang.String host)
host - the client's host name
getOpenJavaCommandCount(),
getOpenCallableStatementCount(String),
getOpenResultSetCount(String),
getOpenStatementCount(String),
getOpenPreparedStatementCount(String),
getConnectedHostNames()public java.util.Vector getCurrentExecutingCommands()
public java.util.Vector getCurrentExecutingCommands(java.lang.String host)
host - the client's host name
public java.util.Vector getOpenedCommands()
setLogStream(java.io.PrintStream)public java.util.Vector getOpenedCommands(java.lang.String host)
host - the client's host name
getConnectedHostNames(),
setLogStream(java.io.PrintStream)public long getInitialTime(java.lang.String host)
host - the client's host name.
public java.util.Vector getConnectedHostNames()
getConnectedHostNames(String)public java.util.Vector getConnectedHostNames(java.lang.String uds)
uds - the name of the User Data Source to which the client's are connected.
getConnectedHostNames()
|
i-net Konnekter | ||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||