|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.endpoint.relay.RelayClient
public class RelayClient
RelayClient manages the relationship with the RelayServer(s)
Nested Class Summary | |
---|---|
(package private) static class |
RelayClient.RelayServerConnection
|
Field Summary | |
---|---|
(package private) RelayClient.RelayServerConnection |
currentServer
|
Constructor Summary | |
---|---|
RelayClient(PeerGroup group,
String serviceName,
RelayConfigAdv relayConfig)
|
Method Summary | |
---|---|
boolean |
addActiveRelay(EndpointAddress address,
RouteAdvertisement relayRoute)
Notify of a new relay connection |
boolean |
addActiveRelayListener(Object service)
Register an active Relay to the endpoint. |
(package private) RdvAdvertisement |
connectToRelay(RelayClient.RelayServerConnection server)
|
Vector<AccessPointAdvertisement> |
getActiveRelays(PeerGroup pg)
return the list of connected relays |
EndpointService |
getEndpointService()
Returns the endpoint service with which this MessageTransport is registered. |
String |
getProtocolName()
Returns a String containing the name of the protocol used by this MessageTransport. |
Iterator<EndpointAddress> |
getPublicAddresses()
Returns an Iterator of all of the EndpointAddresses by which this
MessageReceiver is reachable. |
protected void |
handleResponse(Message message,
EndpointAddress dstAddr)
|
protected boolean |
isRelayConnectDone()
|
protected RdvAdvertisement |
maintainRelayConnection(RelayClient.RelayServerConnection server)
|
boolean |
removeActiveRelay(EndpointAddress address,
RouteAdvertisement relayRoute)
Notify of a relay connection removal |
boolean |
removeActiveRelayListener(Object service)
Unregister an active Relay to the endpoint. |
void |
run()
Logic for the relay client Pick a relay server to try try getting a messenger to relay server, if can not get messenger, start over use the messenger to send a connect message wait for a response, if there is no response or a disconnect response, start over while still connected renew the lease as needed and keep the messenger connected FIXME 20041102 bondolo The approach used here is really, really stupid. |
boolean |
startClient()
|
void |
stopClient()
|
Object |
transportControl(Object operation,
Object Value)
Pass a transport control object to a message transport. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
RelayClient.RelayServerConnection currentServer
Constructor Detail |
---|
public RelayClient(PeerGroup group, String serviceName, RelayConfigAdv relayConfig)
Method Detail |
---|
public boolean startClient()
public void stopClient()
public Iterator<EndpointAddress> getPublicAddresses()
EndpointAddresses
by which this
MessageReceiver is reachable. The list is in order of
"preference" with the most "preferred" EndpointAddress being at the
beginning of the list.
getPublicAddresses
in interface MessageReceiver
public String getProtocolName()
EndpointAddress
.
getProtocolName
in interface MessageTransport
public EndpointService getEndpointService()
getEndpointService
in interface MessageTransport
public Object transportControl(Object operation, Object Value)
transportControl
in interface MessageTransport
operation
- Object that specifies the type of control operation
to be performedValue
- Object that specifies a value object associated
with the control operation
public void run()
connectToRelay()
will not return if a
connection to a relay is achieved. This makes continued iteration over
seeds after return incredibly silly. connectToRelay()
only
returns when it can NO LONGER CONNECT to the relay. The only
hack I can think of to subvert this is to stop iteration of advs/seeds
if connectToRelay()
takes a long time. bizarre.
run
in interface Runnable
protected boolean isRelayConnectDone()
RdvAdvertisement connectToRelay(RelayClient.RelayServerConnection server)
server
- The relay server to connect to
protected RdvAdvertisement maintainRelayConnection(RelayClient.RelayServerConnection server)
protected void handleResponse(Message message, EndpointAddress dstAddr)
public boolean addActiveRelayListener(Object service)
public boolean removeActiveRelayListener(Object service)
public boolean addActiveRelay(EndpointAddress address, RouteAdvertisement relayRoute)
public boolean removeActiveRelay(EndpointAddress address, RouteAdvertisement relayRoute)
public Vector<AccessPointAdvertisement> getActiveRelays(PeerGroup pg)
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |