Top Description Fields Constructors Methods
org.apache.derby.impl.drda

pack-priv Class NetworkServerMBeanImpl

extends Object
implements NetworkServerMBean
Class Inheritance
All Implemented Interfaces
org.apache.derby.mbeans.drda.NetworkServerMBean
Imports
org.apache.derby.drda.NetworkServerControl, org.apache.derby.shared.common.reference.Property, org.apache.derby.iapi.services.monitor.Monitor, org.apache.derby.iapi.services.property.PropertyUtil, org.apache.derby.mbeans.drda.NetworkServerMBean, org.apache.derby.shared.common.security.SystemPermission

This is an implementation of the org.apache.derby.mbeans.drda.NetworkServerMBean, providing management and monitoring capabilities related to the Network Server through JMX.

This bean uses callbacks to the NetworkServerControlImpl class instead of invoking NetworkServerControl, as it is the impl class that contains most of the information we want to expose via JMX.

See Also
org.apache.derby.mbeans.drda.NetworkServerMBean

Field Summary

Modifier and TypeField and Description
private static final SystemPermission
private long
private long
private long
private long
private static final SystemPermission
private int
private int
private NetworkServerControlImpl
private final long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static void
checkControl()

Ensure the caller has permission to control the network server.

private static void
checkMonitor()

Ensure the caller has permission to monitor the network server.

private static void
public int
public int
getActiveConnectionCount()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getActiveConnectionCount.

Gets the number of currently active connections.

public long
getBytesReceived()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getBytesReceived.

Gets the total number of bytes read by the server since it was started.

public synchronized int
getBytesReceivedPerSecond()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getBytesReceivedPerSecond.

Gets the number of bytes received per second by the Network Server.

public long
getBytesSent()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getBytesSent.

Gets the total number of bytes written by the server since it was started.

public synchronized int
getBytesSentPerSecond()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getBytesSentPerSecond.

Gets the number of bytes sent per second by the Network Server.

public int
getConnectionCount()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getConnectionCount.

Gets the total number of current connections (waiting or active) to the Network Server.

public int
public String
getDrdaHost()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaHost.

Gets the network interface address on which the Network Server is listening.

public boolean
getDrdaKeepAlive()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaKeepAlive.

Reports whether or not the Derby Network Server will send keep-alive probes and attempt to clean up connections for disconnected clients (the value of the derby.drda.keepAlive property).

public int
getDrdaMaxThreads()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaMaxThreads.

Reports the maximum number of client connection threads the Network Server will allocate at any given time.

public int
getDrdaPortNumber()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaPortNumber.

Gets the port number on which the Network Server is listening for client connections.

public String
getDrdaSecurityMechanism()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaSecurityMechanism.

The Derby security mechanism required by the Network Server for all client connections.

public String
getDrdaSslMode()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaSslMode.

Reports whether client connections must be encrypted using Secure Sockets Layer (SSL), and whether certificate based peer authentication is enabled.

public int
getDrdaStreamOutBufferSize()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaStreamOutBufferSize.

The size of the buffer used for streaming BLOB and CLOB from server to client.

public int
getDrdaTimeSlice()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaTimeSlice.

If the server property derby.drda.maxThreads is set to a non-zero value, this is the number of milliseconds that each client connection will actively use in the Network Server before yielding to another connection.

public boolean
getDrdaTraceAll()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaTraceAll.

Whether server-side tracing is enabled for all client connections (sessions).

public String
getDrdaTraceDirectory()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaTraceDirectory.

Indicates the location of tracing files on the server host, if server tracing has been enabled.

private String

Returns:

the value of the given server property
getServerProperty
(String
the name of the server property
property
)

Gets the value of a specific network server setting (property).

public long
public long
getUptime()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getUptime.

Return time server has been running.
public int
public void
ping()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.ping.

Pings the Network Server.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONTROLback to summary
private static final SystemPermission CONTROL
lastReceiveBytesback to summary
private long lastReceiveBytes
lastReceiveTimeback to summary
private long lastReceiveTime
lastSentBytesback to summary
private long lastSentBytes
lastSentTimeback to summary
private long lastSentTime
MONITORback to summary
private static final SystemPermission MONITOR
receiveResultback to summary
private int receiveResult
sentResultback to summary
private int sentResult
serverback to summary
private NetworkServerControlImpl server
startTimeback to summary
private final long startTime

Constructor Detail

NetworkServerMBeanImplback to summary
pack-priv NetworkServerMBeanImpl(NetworkServerControlImpl nsc)

Method Detail

checkControlback to summary
private static void checkControl()

Ensure the caller has permission to control the network server.

checkMonitorback to summary
private static void checkMonitor()

Ensure the caller has permission to monitor the network server.

checkPermissionback to summary
private static void checkPermission(SystemPermission permission)
getAccumulatedConnectionCountback to summary
public int getAccumulatedConnectionCount()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getAccumulatedConnectionCount.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getAccumulatedConnectionCount.

Gets the accumulated number of connections. This includes all active and waiting connections since the Network Server was started. This number will not decrease as long as the Network Server is running.

Require SystemPermission("server", "monitor") if a security manager is installed.

Returns:int

the accumulated number of connections made since server startup

getActiveConnectionCountback to summary
public int getActiveConnectionCount()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getActiveConnectionCount.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getActiveConnectionCount.

Gets the number of currently active connections. All connections are active if the DrdaMaxThreads attribute (derby.drda.maxThreads property) is 0.

If DrdaMaxThreads is > 0 and DrdaTimeSlice is 0, connections remain active until they are closed. If there are more than DrdaMaxThreads connections, inactive connections will be waiting for some active connection to close. The connection request will return when the connection becomes active.

If DrdaMaxThreads is > 0 and DrdaTimeSlice > 0, connections will be alternating beetween active and waiting according to Derby's time slicing algorithm.

Requires SystemPermission("server", "monitor") if a security manager is installed.

Returns:int

the number of active connections

getBytesReceivedback to summary
public long getBytesReceived()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getBytesReceived.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getBytesReceived.

Gets the total number of bytes read by the server since it was started.

Require SystemPermission("server", "monitor") if a security manager is installed.

Returns:long

the total number of bytes received by the server

getBytesReceivedPerSecondback to summary
public synchronized int getBytesReceivedPerSecond()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getBytesReceivedPerSecond.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getBytesReceivedPerSecond.

Gets the number of bytes received per second by the Network Server. This number is calculated by taking into account the number of bytes received since the last calculation (or since MBean startup if it is the first time this attibute is being read).

The shortest interval measured is 1 second. This means that a new value will not be calculated unless there has been at least 1 second since the last calculation.

Requires SystemPermission("server", "monitor") if a security manager is installed.

Returns:int

the number of bytes received per second

getBytesSentback to summary
public long getBytesSent()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getBytesSent.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getBytesSent.

Gets the total number of bytes written by the server since it was started.

Requires SystemPermission("server", "monitor") if a security manager is installed.

Returns:long

the total number of bytes sent by the server

getBytesSentPerSecondback to summary
public synchronized int getBytesSentPerSecond()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getBytesSentPerSecond.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getBytesSentPerSecond.

Gets the number of bytes sent per second by the Network Server. This number is calculated by taking into account the number of bytes sent since the last calculation (or since MBean startup if it is the first time this attibute is being read).

The shortest interval measured is 1 second. This means that a new value will not be calculated unless there has been at least 1 second since the last calculation.

Requires SystemPermission("server", "monitor") if a security manager is installed.

Returns:int

the number of bytes sent per millisecond

getConnectionCountback to summary
public int getConnectionCount()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getConnectionCount.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getConnectionCount.

Gets the total number of current connections (waiting or active) to the Network Server.

Requires SystemPermission("server", "monitor") if a security manager is installed.

Returns:int

the number of current connections

getConnectionThreadPoolSizeback to summary
public int getConnectionThreadPoolSize()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getConnectionThreadPoolSize.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getConnectionThreadPoolSize.

Get the size of the connection thread pool. If DrdaMaxThreads (derby.drda.maxThreads) is set to a non-zero value, the size of the thread pool will not exceed this value.

Requires SystemPermission("server", "monitor") if a security manager is installed.

Returns:int

the size of the Network Server's connection thread pool

getDrdaHostback to summary
public String getDrdaHost()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaHost.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaHost.

Gets the network interface address on which the Network Server is listening. This corresponds to the value of the derby.drda.host property.

For example, the value "localhost" means that the Network Server is listening on the local loopback interface only.

The special value "0.0.0.0" (IPv4 environments only) represents the "unspecified address" - also known as the anylocal or wildcard address. In this context this means that the server is listening on all network interfaces (and may thus be able to see connections from both the local host as well as remote hosts, depending on which network interfaces are available).

Requires SystemPermission("server", "control") if a security manager is installed.

Returns:String

the the network interface address on which the Network Server is listening (derby.drda.host)

getDrdaKeepAliveback to summary
public boolean getDrdaKeepAlive()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaKeepAlive.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaKeepAlive.

Reports whether or not the Derby Network Server will send keep-alive probes and attempt to clean up connections for disconnected clients (the value of the derby.drda.keepAlive property).

If true, a keep-alive probe is sent to the client if a "long time" (by default, more than two hours) passes with no other data being sent or received. This will detect and clean up connections for clients on powered-off machines or clients that have disconnected unexpectedly.

If false, Derby will not attempt to clean up connections from disconnected clients, and will not send keep-alive probes.

Requires SystemPermission("server", "monitor") if a security manager is installed.

See also the documentation for the property derby.drda.keepAlive in the Derby Server and Administration Guide, section Managing the Derby Network Server, subsection Setting Network Server Properties, subsubsection derby.drda.keepAlive property.

Returns:boolean

true if Derby Network Server will send keep-alive probes and attempt to clean up connections for disconnected clients (derby.drda.keepAlive)

getDrdaMaxThreadsback to summary
public int getDrdaMaxThreads()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaMaxThreads.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaMaxThreads.

Reports the maximum number of client connection threads the Network Server will allocate at any given time. This corresponds to the derby.drda.maxThreads property.

Requires SystemPermission("server", "monitor") if a security manager is installed.

Returns:int

the maximum number of client connection threads the Network Server will allocate at any given time (derby.drda.maxThreads)

getDrdaPortNumberback to summary
public int getDrdaPortNumber()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaPortNumber.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaPortNumber.

Gets the port number on which the Network Server is listening for client connections. This corresponds to the value of the derby.drda.portNumber Network Server setting.

Requires SystemPermission("server", "control") if a security manager is installed.

Returns:int

the port number on which the Network Server is listening for client connections.

getDrdaSecurityMechanismback to summary
public String getDrdaSecurityMechanism()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaSecurityMechanism.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaSecurityMechanism.

The Derby security mechanism required by the Network Server for all client connections. This corresponds to the value of the derby.drda.securityMechanism property on the server.

If not set, the empty String will be returned, which means that the Network Server accepts any connection which uses a valid security mechanism.

For a list of valid security mechanisms, refer to the documentation for the derby.drda.securityMechanism property in the Derby Server and Administration Guide.

Requires SystemPermission("server", "control") if a security manager is installed.

Returns:String

the security mechanism required by the Network Server for all client connections (derby.drda.securityMechanism)

getDrdaSslModeback to summary
public String getDrdaSslMode()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaSslMode.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaSslMode.

Reports whether client connections must be encrypted using Secure Sockets Layer (SSL), and whether certificate based peer authentication is enabled. Refers to the derby.drda.sslMode property.

Peer authentication means that the other side of the SSL connection is authenticated based on a trusted certificate installed locally.

The value returned is one of "off" (no SSL encryption), "basic" (SSL encryption, no peer authentication) and "peerAuthentication" (SSL encryption and peer authentication). Refer to the Derby Server and Administration Guide for more details.

Requires SystemPermission("server", "control") if a security manager is installed.

Returns:String

whether client connections must be encrypted using Secure Sockets Layer (SSL), and whether certificate based peer authentication is enabled (derby.drda.sslMode)

getDrdaStreamOutBufferSizeback to summary
public int getDrdaStreamOutBufferSize()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaStreamOutBufferSize.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaStreamOutBufferSize.

The size of the buffer used for streaming BLOB and CLOB from server to client. Refers to the derby.drda.streamOutBufferSize property.

This setting may improve streaming performance when the default sizes of packets being sent are significantly smaller than the maximum allowed packet size in the network.

Requires SystemPermission("server", "monitor") if a security manager is installed.

Returns:int

the size of the buffer used for streaming blob/clob from server to client (derby.drda.streamOutBufferSize)

getDrdaTimeSliceback to summary
public int getDrdaTimeSlice()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaTimeSlice.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaTimeSlice.

If the server property derby.drda.maxThreads is set to a non-zero value, this is the number of milliseconds that each client connection will actively use in the Network Server before yielding to another connection. If this value is 0, a waiting connection will become active once a currently active connection is closed.

Refers to the derby.drda.timeSlice server property.

Requires SystemPermission("server", "monitor") if a security manager is installed.

Returns:int

the number of milliseconds that each client connection will actively use in the Network Server before yielding to another connection (derby.drda.timeSlice)

getDrdaTraceAllback to summary
public boolean getDrdaTraceAll()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaTraceAll.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaTraceAll.

Whether server-side tracing is enabled for all client connections (sessions). Refers to the derby.drda.traceAll server property.

Tracing may for example be useful when providing technical support information. The Network Server also supports tracing for individual connections (sessions), see the Derby Server and Administration Guide ("Controlling tracing by using the trace facility") for details.

When tracing is enabled, tracing information from each client connection will be written to a separate trace file.

Requires SystemPermission("server", "monitor") if a security manager is installed.

Returns:boolean

whether tracing for all client connections is enabled (derby.drda.traceAll)

getDrdaTraceDirectoryback to summary
public String getDrdaTraceDirectory()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaTraceDirectory.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getDrdaTraceDirectory.

Indicates the location of tracing files on the server host, if server tracing has been enabled.

If the server setting derby.drda.traceDirectory is set, its value will be returned. Otherwise, the Network Server's default values will be taken into account when producing the result.

Requires SystemPermission("server", "control") if a security manager is installed.

Returns:String

the potential location of tracing files on the server host

getServerPropertyback to summary
private String getServerProperty(String property)

Gets the value of a specific network server setting (property). Most server-related property keys have the prefix derby.drda. and may be found in the org.apache.derby.shared.common.reference.Property class.

Parameters
property:String

the name of the server property

Returns:String

the value of the given server property

See Also
org.apache.derby.shared.common.reference.Property
getStartTimeback to summary
public long getStartTime()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getStartTime.

Return start time.

Returns:long

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getStartTime.

the difference, measured in milliseconds, between the time the Network Server was started and Unix epoch (1970-01-01T00:00:00Z)

getUptimeback to summary
public long getUptime()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getUptime.

Return time server has been running.

Returns:long

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getUptime.

the difference, measured in milliseconds, between the current time and the time the Network Server was started

getWaitingConnectionCountback to summary
public int getWaitingConnectionCount()

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.getWaitingConnectionCount.

Doc from org.apache.derby.mbeans.drda.NetworkServerMBean.getWaitingConnectionCount.

Gets the number of currently waiting connections. This number will always be 0 if DrdaMaxThreads is 0. Otherwise, if the total number of connections is less than or equal to DrdaMaxThreads, then no connections are waiting.

Requires SystemPermission("server", "monitor") if a security manager is installed.

Returns:int

the number of waiting connections

pingback to summary
public void ping() throws Exception

Implements org.apache.derby.mbeans.drda.NetworkServerMBean.ping.

Pings the Network Server.

Exceptions
Exception:
if the ping fails.
See Also
org.apache.derby.mbeans.drda.NetworkServerMBean#ping()