|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Connection
Generic representation of a network connection.
This interface intentionally tries to abstract the underlying socket to enable generic use with traditional and nio style sockets.
Field Summary | |
---|---|
static int |
STATUS_READ_ACTIVE
Status indicating the connection is actively being handled by worker thread. |
static int |
STATUS_READ_CLOSED
Status indicating the connection is closed and can't be read. |
static int |
STATUS_READ_LOADED
Status indicating the connection is loaded with read data. |
static int |
STATUS_READ_READY
Status indicating the connection is ready to read. |
static int |
STATUS_READ_SCHEDULED
Status indicating the connection has been scheduled for handling by worker thread. |
Method Summary | |
---|---|
void |
close()
Close the connection removing any registrations with session managers. |
java.util.Date |
getConnectDate()
Obtain the date/time the connection was initially made. |
BandwidthMonitor |
getConsumerBandwidthMonitor()
Obtain the bandwidth monitor watching the raw network traffic for this connection's DataConsumer. |
int |
getID()
Obtain a unique key to identify this connection in the connection manager. |
java.net.InetAddress |
getLocalAddress()
Obtain the InetAddress describing the local side of the connection. |
int |
getLocalPort()
Obtain the local port for this connection. |
BandwidthMonitor |
getProducerBandwidthMonitor()
Obtain the bandwidth monitor watching the raw network traffic for this connection's DataProducer. |
java.io.Reader |
getReader()
|
int |
getReadStatus()
Obtain the current read status of the connection. |
java.net.InetAddress |
getRemoteAddress()
Obtain the InetAddress describing the connection. |
int |
getRemotePort()
Obtain the remote port for this connection. |
java.net.Socket |
getSocket()
|
long |
getUptime()
Obtain the number of milliseconds the connection has been open. |
java.io.Writer |
getWriter()
|
boolean |
isAcceptCreated()
Retrieve the mechanism used to open this connection |
boolean |
isClosed()
Retrieve the closed state of the Session. |
boolean |
isSecure()
Determines if this connection is secure. |
void |
setConnectionManager(ConnectionManager manager)
Sets the connection manager this connection belongs to. |
void |
setReadStatus(int status)
Sets the current read status of the connection. |
void |
setSecure(boolean secure)
Sets the security status of this connection. |
Field Detail |
---|
static final int STATUS_READ_CLOSED
static final int STATUS_READ_READY
static final int STATUS_READ_LOADED
static final int STATUS_READ_SCHEDULED
static final int STATUS_READ_ACTIVE
Method Detail |
---|
int getID()
Obtain a unique key to identify this connection in the connection manager. The ID is primarily used by stateless admin interfaces (e.g. HTTP) to allow a connection to be easily identified across accesses to the connection manager. The ID is only unique within the server at the time the connection is alive. IDs will be recycled on particularly long lived servers and should not be assumed to identify the same connection across server restarts, server instances, cluster members, etc.
java.util.Date getConnectDate()
Obtain the date/time the connection was initially made.
long getUptime()
Obtain the number of milliseconds the connection has been open.
If the connection is still open, this is the time difference between the result of getConnectDate() and the current time (e.g. System.currentTimeMillis() otherwise it returns the number of milliseconds between the opening and closing of the connection.
BandwidthMonitor getConsumerBandwidthMonitor()
Obtain the bandwidth monitor watching the raw network traffic for this connection's DataConsumer.
BandwidthMonitor getProducerBandwidthMonitor()
Obtain the bandwidth monitor watching the raw network traffic for this connection's DataProducer.
java.net.InetAddress getRemoteAddress()
Obtain the InetAddress describing the connection.
int getRemotePort()
Obtain the remote port for this connection.
java.net.InetAddress getLocalAddress()
Obtain the InetAddress describing the local side of the connection.
int getLocalPort()
Obtain the local port for this connection.
java.net.Socket getSocket()
java.io.Writer getWriter()
java.io.Reader getReader()
void close() throws java.io.IOException
java.io.IOException
- if there was problem closing the connection.boolean isClosed()
boolean isAcceptCreated()
boolean isSecure()
Determines if this connection is secure.
void setSecure(boolean secure)
Sets the security status of this connection.
Ordinarily a connection is either insecure (standard Socket or SocketChannel) or secure (SSLSocket). However, many protocols including XMPP and NNTP allow the use of SASL where transport layer security can be established after the connection is created. So application level objects must be able to change the security status of a connection during such negotiations.
secure
- true if the connection is secure (e.g. SSL/TLS).void setConnectionManager(ConnectionManager manager)
Sets the connection manager this connection belongs to.
Connections may only have on connection manager at a time.
manager
- the connection manager for the connection.int getReadStatus()
void setReadStatus(int status)
status
- the new status of the connection
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |