|
Project 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
RelayClient manages the relationship with the RelayServer(s)
Field Summary | |
protected net.jxta.impl.endpoint.relay.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(net.jxta.impl.endpoint.relay.RelayClient.RelayServerConnection server)
|
Vector |
getActiveRelays(PeerGroup pg)
return the list of connected relays |
EndpointService |
getEndpointService()
|
String |
getProtocolName()
|
Iterator |
getPublicAddresses()
|
protected void |
handleResponse(Message message,
EndpointAddress dstAddr)
|
protected boolean |
isRelayConnectDone()
|
(package private) static EndpointAddress[] |
loadSeeds(URI seedingURI)
|
protected RdvAdvertisement |
maintainRelayConnection(net.jxta.impl.endpoint.relay.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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected net.jxta.impl.endpoint.relay.RelayClient.RelayServerConnection currentServer
Constructor Detail |
public RelayClient(PeerGroup group, String serviceName, RelayConfigAdv relayConfig)
Method Detail |
public boolean startClient()
public void stopClient()
public Iterator getPublicAddresses()
getPublicAddresses
in interface MessageReceiver
public String getProtocolName()
getProtocolName
in interface MessageTransport
public EndpointService getEndpointService()
getEndpointService
in interface MessageTransport
public Object transportControl(Object operation, Object Value)
transportControl
in interface MessageTransport
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(net.jxta.impl.endpoint.relay.RelayClient.RelayServerConnection server)
server
- The relay server to connect to
protected RdvAdvertisement maintainRelayConnection(net.jxta.impl.endpoint.relay.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 getActiveRelays(PeerGroup pg)
static EndpointAddress[] loadSeeds(URI seedingURI) throws IOException
IOException
|
JXTA J2SE | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |