LimeWire Consolidated API

com.limegroup.gnutella
Class StandardMessageRouter

java.lang.Object
  extended by com.limegroup.gnutella.MessageRouterImpl
      extended by com.limegroup.gnutella.StandardMessageRouter
All Implemented Interfaces:
MessageRouter, Service

public class StandardMessageRouter
extends MessageRouterImpl

This class is the message routing implementation for TCP messages.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.limegroup.gnutella.MessageRouterImpl
MessageRouterImpl.MulticastPingReplyHandler, MessageRouterImpl.MulticastPingRequestHandler, MessageRouterImpl.MulticastQueryReplyHandler, MessageRouterImpl.MulticastQueryRequestHandler, MessageRouterImpl.UDPQueryReplyHandler, MessageRouterImpl.VendorMessageHandler
 
Field Summary
 
Fields inherited from class com.limegroup.gnutella.MessageRouterImpl
_clientGUID, activityCallback, backgroundExecutor, connectionManager, connectionServices, contentManager, dhtManager, downloadManager, fileManager, forMeReplyHandler, headPongFactory, hostCatcher, limeAckHandler, messageDispatcher, multicastGuidMap, multicastService, networkManager, onDemandUnicaster, pingReplyFactory, pongCacher, qrpUpdater, queryDispatcher, queryHandlerFactory, queryReplyFactory, queryRequestFactory, queryUnicaster, searchResultHandler, simppManager, socketsManager, staticMessages, udpReplyHandlerCache, udpService, updateHandler, uploadManager
 
Fields inherited from interface com.limegroup.gnutella.MessageRouter
CLEAR_TIME
 
Constructor Summary
StandardMessageRouter(NetworkManager networkManager, QueryRequestFactory queryRequestFactory, QueryHandlerFactory queryHandlerFactory, OnDemandUnicaster onDemandUnicaster, HeadPongFactory headPongFactory, PingReplyFactory pingReplyFactory, ConnectionManager connectionManager, ReplyHandler forMeReplyHandler, QueryUnicaster queryUnicaster, FileManager fileManager, ContentManager contentManager, DHTManager dhtManager, UploadManager uploadManager, DownloadManager downloadManager, UDPService udpService, SearchResultHandler searchResultHandler, SocketsManager socketsManager, HostCatcher hostCatcher, QueryReplyFactory queryReplyFactory, StaticMessages staticMessages, com.google.inject.Provider<MessageDispatcher> messageDispatcher, MulticastService multicastService, QueryDispatcher queryDispatcher, com.google.inject.Provider<ActivityCallback> activityCallback, ConnectionServices connectionServices, ApplicationServices applicationServices, ScheduledExecutorService backgroundExecutor, com.google.inject.Provider<PongCacher> pongCacher, com.google.inject.Provider<SimppManager> simppManager, com.google.inject.Provider<UpdateHandler> updateHandler, GuidMapManager guidMapManager, UDPReplyHandlerCache udpReplyHandlerCache, com.google.inject.Provider<InspectionRequestHandler> inspectionRequestHandlerFactory, com.google.inject.Provider<UDPCrawlerPingHandler> udpCrawlerPingHandlerFactory, Statistics statistics, ReplyNumberVendorMessageFactory replyNumberVendorMessageFactory, PingRequestFactory pingRequestFactory, MessageHandlerBinder messageHandlerBinder, com.google.inject.Provider<OOBHandler> oobHandlerFactory, com.google.inject.Provider<MACCalculatorRepositoryManager> MACCalculatorRepositoryManager, com.google.inject.Provider<LimeACKHandler> limeACKHandler, OutgoingQueryReplyFactory outgoingQueryReplyFactory, SharedFilesKeywordIndex sharedFilesKeywordIndex, QRPUpdater qrpUpdater, URNFilter urnFilter)
           
 
Method Summary
protected  void respondToPingRequest(PingRequest ping, ReplyHandler handler)
          Responds to a Gnutella ping with cached pongs.
protected  boolean respondToQueryRequest(QueryRequest queryRequest, byte[] clientGUID, ReplyHandler handler)
          Respond to the query request.
protected  void respondToUDPPingRequest(PingRequest request, InetSocketAddress addr, ReplyHandler handler)
          Responds to a ping request received over a UDP port.
 
Methods inherited from class com.limegroup.gnutella.MessageRouterImpl
addBypassedSource, addBypassedSource, addMessageHandler, addMulticastMessageHandler, addUDPMessageHandler, broadcastPingRequest, downloadFinished, forwardInspectionRequestToLeaves, forwardQueryRequestToLeaves, getMessageHandler, getMulticastMessageHandler, getNumOOBToRequest, getOOBExpireTime, getPingRouteTableDump, getPushHandler, getPushRouteTableDump, getQueryLocs, getQueryRouteTable, getQueryRouteTableDump, getServiceName, getUDPMessageHandler, handleMessage, handleMulticastMessage, handlePingReply, handlePushProxyRequest, handleQueryReply, handleQueryRequest, handleQueryStatus, handleTCPConnectBackRedirect, handleTCPConnectBackRequest, handleUDPConnectBackRedirect, handleUDPConnectBackRequest, handleUDPMessage, handleUDPPingReply, handleUDPPingRequest, hasValidQueryKey, initialize, isHostUnicastQueried, isQueryAlive, multicastQueryRequest, originateMulticastQuery, originateQueryGUID, queryKilled, registerMessageListener, responsesToQueryReplies, responsesToQueryReplies, sendAcknowledgement, sendDynamicQuery, sendInitialQuery, sendMulticastPushRequest, sendPingReply, sendPingRequest, sendPushRequest, sendQueryKeyPong, sendQueryReply, sendQueryRequest, setMessageHandler, setMulticastMessageHandler, setUDPMessageHandler, start, stop, unicastQueryRequest, unregisterMessageListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardMessageRouter

@Inject
public StandardMessageRouter(NetworkManager networkManager,
                                    QueryRequestFactory queryRequestFactory,
                                    QueryHandlerFactory queryHandlerFactory,
                                    OnDemandUnicaster onDemandUnicaster,
                                    HeadPongFactory headPongFactory,
                                    PingReplyFactory pingReplyFactory,
                                    ConnectionManager connectionManager,
                                    ReplyHandler forMeReplyHandler,
                                    QueryUnicaster queryUnicaster,
                                    FileManager fileManager,
                                    ContentManager contentManager,
                                    DHTManager dhtManager,
                                    UploadManager uploadManager,
                                    DownloadManager downloadManager,
                                    UDPService udpService,
                                    SearchResultHandler searchResultHandler,
                                    SocketsManager socketsManager,
                                    HostCatcher hostCatcher,
                                    QueryReplyFactory queryReplyFactory,
                                    StaticMessages staticMessages,
                                    com.google.inject.Provider<MessageDispatcher> messageDispatcher,
                                    MulticastService multicastService,
                                    QueryDispatcher queryDispatcher,
                                    com.google.inject.Provider<ActivityCallback> activityCallback,
                                    ConnectionServices connectionServices,
                                    ApplicationServices applicationServices,
                                    ScheduledExecutorService backgroundExecutor,
                                    com.google.inject.Provider<PongCacher> pongCacher,
                                    com.google.inject.Provider<SimppManager> simppManager,
                                    com.google.inject.Provider<UpdateHandler> updateHandler,
                                    GuidMapManager guidMapManager,
                                    UDPReplyHandlerCache udpReplyHandlerCache,
                                    com.google.inject.Provider<InspectionRequestHandler> inspectionRequestHandlerFactory,
                                    com.google.inject.Provider<UDPCrawlerPingHandler> udpCrawlerPingHandlerFactory,
                                    Statistics statistics,
                                    ReplyNumberVendorMessageFactory replyNumberVendorMessageFactory,
                                    PingRequestFactory pingRequestFactory,
                                    MessageHandlerBinder messageHandlerBinder,
                                    com.google.inject.Provider<OOBHandler> oobHandlerFactory,
                                    com.google.inject.Provider<MACCalculatorRepositoryManager> MACCalculatorRepositoryManager,
                                    com.google.inject.Provider<LimeACKHandler> limeACKHandler,
                                    OutgoingQueryReplyFactory outgoingQueryReplyFactory,
                                    SharedFilesKeywordIndex sharedFilesKeywordIndex,
                                    QRPUpdater qrpUpdater,
                                    URNFilter urnFilter)
Method Detail

respondToPingRequest

protected void respondToPingRequest(PingRequest ping,
                                    ReplyHandler handler)
Responds to a Gnutella ping with cached pongs. This does special handling for both "heartbeat" pings that were sent to ensure that the connection is still live as well as for pings from a crawler.

Specified by:
respondToPingRequest in class MessageRouterImpl
Parameters:
ping - the PingRequest to respond to
handler - the ReplyHandler to send any pongs to

respondToUDPPingRequest

protected void respondToUDPPingRequest(PingRequest request,
                                       InetSocketAddress addr,
                                       ReplyHandler handler)
Responds to a ping request received over a UDP port. This is handled differently from all other ping requests. Instead of responding with cached pongs, we respond with a pong from our node.

Specified by:
respondToUDPPingRequest in class MessageRouterImpl
Parameters:
request - the PingRequest to service
addr - the InetSocketAddress containing the IP and port of the client node
handler - the ReplyHandler that should handle any replies

respondToQueryRequest

protected boolean respondToQueryRequest(QueryRequest queryRequest,
                                        byte[] clientGUID,
                                        ReplyHandler handler)
Description copied from class: MessageRouterImpl
Respond to the query request. Implementations typically will either do nothing (if they don't think a response is appropriate) or call sendQueryReply(QueryReply). This method is called from the default handleQueryRequest.

Specified by:
respondToQueryRequest in class MessageRouterImpl

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.