net.jxta.impl.endpoint.relay
Class RelayTransport
java.lang.Object
net.jxta.impl.endpoint.relay.RelayTransport
- All Implemented Interfaces:
- EndpointListener, Module
- public final class RelayTransport
- extends Object
- implements EndpointListener, Module
The Relay Server supports the following commands:
CONNECT - message contains PEERID, optional LEASE
DISCONNECT - message contains PEERID.
GETSERVER - message contains PEERID.
Method Summary |
(package private) static Message |
createConnectedMessage(long lease)
|
(package private) static Message |
createConnectMessage(long lease,
boolean doReturnAdv,
boolean doFlushQueue)
|
(package private) static String |
createConnectString(long lease,
boolean doReturnAdv,
boolean doFlushQueue)
|
(package private) static Message |
createDisconnectedMessage()
|
(package private) static Message |
createDisconnectMessage()
|
(package private) static Message |
createPIDRequestMessage()
|
(package private) static Message |
createPIDResponseMessage(String pidStr)
|
protected PeerGroup |
getGroup()
|
protected String |
getServiceName()
|
(package private) static String |
getString(Message message,
String tag)
Convinence function for getting a String from the element with the given
tag and relay namespace |
void |
init(PeerGroup group,
ID assignedID,
Advertisement implAdv)
|
void |
processIncomingMessage(Message message,
EndpointAddress srcAddr,
EndpointAddress dstAddr)
|
(package private) static void |
setString(Message message,
String tag,
String value)
Convinence function for setting a string element with the relay namespace |
int |
startApp(String[] args)
|
void |
stopApp()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
protocolName
static final String protocolName
- See Also:
- Constant Field Values
RELAY_NS
static final String RELAY_NS
- See Also:
- Constant Field Values
REQUEST_ELEMENT
static final String REQUEST_ELEMENT
- See Also:
- Constant Field Values
RESPONSE_ELEMENT
static final String RESPONSE_ELEMENT
- See Also:
- Constant Field Values
PEERID_ELEMENT
static final String PEERID_ELEMENT
- See Also:
- Constant Field Values
LEASE_ELEMENT
static final String LEASE_ELEMENT
- See Also:
- Constant Field Values
RELAY_ADV_ELEMENT
static final String RELAY_ADV_ELEMENT
- See Also:
- Constant Field Values
CONNECT_REQUEST
static final String CONNECT_REQUEST
- See Also:
- Constant Field Values
CONNECT_REQUEST_ELEMENT
static final MessageElement CONNECT_REQUEST_ELEMENT
DISCONNECT_REQUEST
static final String DISCONNECT_REQUEST
- See Also:
- Constant Field Values
DISCONNECT_REQUEST_ELEMENT
static final MessageElement DISCONNECT_REQUEST_ELEMENT
PID_REQUEST
static final String PID_REQUEST
- See Also:
- Constant Field Values
PID_REQUEST_ELEMENT
static final MessageElement PID_REQUEST_ELEMENT
CONNECTED_RESPONSE
static final String CONNECTED_RESPONSE
- See Also:
- Constant Field Values
CONNECTED_RESPONSE_ELEMENT
static final MessageElement CONNECTED_RESPONSE_ELEMENT
DISCONNECTED_RESPONSE
static final String DISCONNECTED_RESPONSE
- See Also:
- Constant Field Values
DISCONNECTED_RESPONSE_ELEMENT
static final MessageElement DISCONNECTED_RESPONSE_ELEMENT
PID_RESPONSE
static final String PID_RESPONSE
- See Also:
- Constant Field Values
PID_RESPONSE_ELEMENT
static final MessageElement PID_RESPONSE_ELEMENT
DEFAULT_MAX_CLIENTS
static final int DEFAULT_MAX_CLIENTS
- See Also:
- Constant Field Values
DEFAULT_MAX_SERVERS
static final int DEFAULT_MAX_SERVERS
- See Also:
- Constant Field Values
DEFAULT_LEASE
static final long DEFAULT_LEASE
- See Also:
- Constant Field Values
DEFAULT_STALL_TIMEOUT
static final long DEFAULT_STALL_TIMEOUT
- See Also:
- Constant Field Values
DEFAULT_POLL_INTERVAL
static final long DEFAULT_POLL_INTERVAL
- See Also:
- Constant Field Values
DEFAULT_BROADCAST_INTERVAL
static final long DEFAULT_BROADCAST_INTERVAL
- See Also:
- Constant Field Values
DEFAULT_CLIENT_QUEUE_SIZE
static final int DEFAULT_CLIENT_QUEUE_SIZE
- See Also:
- Constant Field Values
RelayTransport
public RelayTransport()
init
public void init(PeerGroup group,
ID assignedID,
Advertisement implAdv)
throws PeerGroupException
-
- Specified by:
init
in interface Module
- Throws:
PeerGroupException
startApp
public int startApp(String[] args)
-
- Specified by:
startApp
in interface Module
stopApp
public void stopApp()
-
- Specified by:
stopApp
in interface Module
processIncomingMessage
public void processIncomingMessage(Message message,
EndpointAddress srcAddr,
EndpointAddress dstAddr)
-
- Specified by:
processIncomingMessage
in interface EndpointListener
getGroup
protected PeerGroup getGroup()
getServiceName
protected String getServiceName()
createPIDRequestMessage
static Message createPIDRequestMessage()
createPIDResponseMessage
static Message createPIDResponseMessage(String pidStr)
createConnectMessage
static Message createConnectMessage(long lease,
boolean doReturnAdv,
boolean doFlushQueue)
createConnectString
static String createConnectString(long lease,
boolean doReturnAdv,
boolean doFlushQueue)
createConnectedMessage
static Message createConnectedMessage(long lease)
createDisconnectMessage
static Message createDisconnectMessage()
createDisconnectedMessage
static Message createDisconnectedMessage()
setString
static void setString(Message message,
String tag,
String value)
- Convinence function for setting a string element with the relay namespace
getString
static String getString(Message message,
String tag)
- Convinence function for getting a String from the element with the given
tag and relay namespace