Project JXTA

net.jxta.impl.endpoint.relay
Class RelayServer

java.lang.Object
  extended by net.jxta.impl.endpoint.relay.RelayServer
All Implemented Interfaces:
Runnable, EventListener, MessageSender, MessageTransport, MessengerEventListener

public class RelayServer
extends Object
implements MessageSender, MessengerEventListener, Runnable

Relay server that maintains outgoing message queues, leases, etc.


Nested Class Summary
(package private) static class RelayServer.BGSend
          Sends a message on an synchronous messenger.
 
Field Summary
protected  AccessList acl
           
protected  File aclFile
           
protected  long aclFileLastModified
           
protected  PeerGroup group
           
protected  String peerId
           
protected  long refreshTime
           
protected  net.jxta.impl.endpoint.relay.RelayServer.RelayServerCache relayServerCache
           
protected  String serviceName
           
 
Constructor Summary
RelayServer(PeerGroup group, String serviceName, RelayConfigAdv relayConfigAdv)
          constructor
 
Method Summary
 boolean allowsRouting()
          
 EndpointService getEndpointService()
          
 Messenger getMessenger(EndpointAddress destAddr, Object hintIgnored)
          
 String getProtocolName()
          
 EndpointAddress getPublicAddress()
          
 List getRelayedClients()
          Debug routine: returns the list of relayedClients with details.
protected  void handleRequest(Message message, EndpointAddress dstAddr)
           
protected  void handleRequest(Messenger messenger, EndpointAddress connectionAddress)
           
(package private)  void handleRequest(String request, String clientPeerId, Messenger messenger)
           
 boolean isConnectionOriented()
          
 boolean isPropagateEnabled()
          (@inheritdoc}
 boolean isPropagationSupported()
          (@inheritdoc}
 boolean messengerReady(MessengerEvent event)
          
 boolean ping(EndpointAddress addr)
          
 void propagate(Message msg, String serviceName, String serviceParams, String prunePeer)
          
protected  void removeClient(String clientPeerId, RelayServerClient handler)
           
 void run()
          
 boolean startServer()
           
 void stopServer()
           
 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

group

protected final PeerGroup group

serviceName

protected final String serviceName

peerId

protected final String peerId

acl

protected final AccessList acl

aclFile

protected File aclFile

refreshTime

protected long refreshTime

aclFileLastModified

protected long aclFileLastModified

relayServerCache

protected final net.jxta.impl.endpoint.relay.RelayServer.RelayServerCache relayServerCache
Constructor Detail

RelayServer

public RelayServer(PeerGroup group,
                   String serviceName,
                   RelayConfigAdv relayConfigAdv)
constructor

Method Detail

getRelayedClients

public List getRelayedClients()
Debug routine: returns the list of relayedClients with details.


startServer

public boolean startServer()

stopServer

public void stopServer()

getPublicAddress

public EndpointAddress getPublicAddress()

Specified by:
getPublicAddress in interface MessageSender

isConnectionOriented

public boolean isConnectionOriented()

Specified by:
isConnectionOriented in interface MessageSender

allowsRouting

public boolean allowsRouting()

Specified by:
allowsRouting in interface MessageSender

transportControl

public Object transportControl(Object operation,
                               Object Value)

Specified by:
transportControl in interface MessageTransport

getMessenger

public Messenger getMessenger(EndpointAddress destAddr,
                              Object hintIgnored)

Specified by:
getMessenger in interface MessageSender

isPropagateEnabled

public boolean isPropagateEnabled()
(@inheritdoc}

Specified by:
isPropagateEnabled in interface MessageSender

isPropagationSupported

public boolean isPropagationSupported()
(@inheritdoc}

Specified by:
isPropagationSupported in interface MessageSender

propagate

public void propagate(Message msg,
                      String serviceName,
                      String serviceParams,
                      String prunePeer)
               throws IOException

Specified by:
propagate in interface MessageSender
Throws:
IOException

ping

public boolean ping(EndpointAddress addr)

Specified by:
ping in interface MessageSender

getProtocolName

public String getProtocolName()

Specified by:
getProtocolName in interface MessageTransport

getEndpointService

public EndpointService getEndpointService()

Specified by:
getEndpointService in interface MessageTransport

messengerReady

public boolean messengerReady(MessengerEvent event)

Specified by:
messengerReady in interface MessengerEventListener

handleRequest

protected void handleRequest(Messenger messenger,
                             EndpointAddress connectionAddress)

handleRequest

protected void handleRequest(Message message,
                             EndpointAddress dstAddr)

handleRequest

void handleRequest(String request,
                   String clientPeerId,
                   Messenger messenger)

removeClient

protected void removeClient(String clientPeerId,
                            RelayServerClient handler)

run

public void run()

Specified by:
run in interface Runnable

JXTA J2SE