|
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 |
java.lang.Objectcom.jivesoftware.forum.net.AcceptPort
public class AcceptPort
Represents and manages a network accept port. Accept ports know what port/address to bind to, have and verify their accept policies, and allow a generic mechanism for opening and closing ports for accepting connections. The accept port implementation accepts incoming connections but never reads from them.
Constructor Summary | |
---|---|
AcceptPort(ConnectionManager connectionManager,
java.lang.String configPrefixName)
Loads an existing accept port from the configuration property object that uses the given connection manager. |
|
AcceptPort(ConnectionManager connectionManager,
java.lang.String configPrefixName,
java.net.InetAddress bindAddress,
int bindport)
Constructs an new accept port with the given bind address and port that uses the given connection manager and save the settings to the configuration property object. |
Method Summary | |
---|---|
void |
close()
Closes the port by closing the accept thread (if needed). |
ConnectionMonitor |
getAcceptMonitor()
Obtain the monitor watching the basic behavior of this AcceptPort. |
AcceptPolicy |
getAcceptPolicy()
The accept policy specific to this accept port. |
java.net.InetAddress |
getAddress()
Returns the inet address that will be used. |
ConnectionMonitor |
getConnectMonitor()
Obtain the monitor watching the accepted connection behavior of this AcceptPort. |
ConnectionMonitor |
getDisconnectMonitor()
Obtain the monitor watching the rejected connection behavior of this AcceptPort. |
int |
getPort()
Returns the port number this accept port will use. |
long |
getUptime()
Returns the number of milliseconds the accept port has been open or -1 if the accept port is closed. |
boolean |
isSecure()
Returns true if this accept port generates natively secure connections. |
void |
open()
Opens the port by starting up an accept thread (if needed). |
void |
remove()
Closes the AcceptPort and removes it from service. |
void |
setAddress(java.net.InetAddress address)
Sets the inet address that will be used. |
void |
setPort(int port)
Sets the port number this accept port will use. |
void |
setSecure(boolean secure)
Sets the security status of this connection. |
java.lang.String |
toString()
Generates a string representation of this port. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AcceptPort(ConnectionManager connectionManager, java.lang.String configPrefixName) throws java.io.IOException
connectionManager
- the connection manager that will handle connections
produced by the accept portconfigPrefixName
- the name of the jive property this port is saved to.
java.io.IOException
- if there was problem initializing the port.public AcceptPort(ConnectionManager connectionManager, java.lang.String configPrefixName, java.net.InetAddress bindAddress, int bindport)
Newly created accept ports always are created closed. Callers must manually open the port to begin accepting connections.
connectionManager
- the connection manager that will.
handle connections produced by this accept port.bindAddress
- the address the new port should bind to.bindport
- the port number the new should bind to.configPrefixName
- the name of the jive property this port is saved to.Method Detail |
---|
public boolean isSecure()
public void setSecure(boolean secure)
secure
- true if the port is secure (e.g. SSL/TLS)public int getPort()
public void setPort(int port)
port
- the port number for this port to use.public java.net.InetAddress getAddress()
public void setAddress(java.net.InetAddress address)
If the port is open the port will automatically be closed before changing the address. The port will NOT be automatically re-opened once the address is changed.
address
- the inet address this port is bound to, or null if any/all.public long getUptime()
public void open() throws java.io.IOException, java.lang.SecurityException, java.lang.IllegalArgumentException
java.io.IOException
- If the the port is already bound or otherwise failed to open
java.lang.SecurityException
- If the security manager refuses the operation
java.lang.IllegalArgumentException
- If the InetAddress is not valid on this machinepublic void close() throws java.io.IOException
java.io.IOException
- if the the port is already bound or otherwise failed to open.public void remove() throws java.io.IOException
Closes the AcceptPort and removes it from service.
java.io.IOException
- if there was a problem closing the connection.public AcceptPolicy getAcceptPolicy()
The accept policy specific to this accept port.
Incoming accept requests are evaluated with the AcceptPort's AcceptPolicy. The AcceptManager only checks this accept policy when deciding whether to connect or reject incoming sockets. Most accept port specific accept policies should use the results of the global AcceptManager AcceptPolicy in determining the overall accept response.
public ConnectionMonitor getAcceptMonitor()
Obtain the monitor watching the basic behavior of this AcceptPort.
Counts the raw connections accepted before the accept policy is applied and the sockets are added to the ConnectionManager or they are disconnected because they fail to pass the accept policy.
public ConnectionMonitor getConnectMonitor()
Obtain the monitor watching the accepted connection behavior of this AcceptPort.
public ConnectionMonitor getDisconnectMonitor()
Obtain the monitor watching the rejected connection behavior of this AcceptPort.
public java.lang.String toString()
Generates a string representation of this port.
toString
in class java.lang.Object
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |