cgl.narada.transport
Interface TransportHandler

All Known Implementing Classes:
TransportHandlerImpl

public interface TransportHandler

The transport handler interface provides an intermediary between the protocol layers and the underlying transport implementations. Among the operations supported by the transport handler interface are the ability to


Method Summary
 void closeAllLinks()
          Close all links that have been initiated by the hosting node
 void closeLinks(Object naradaBrokeringId)
          Eliminate all links associated with communicating with the specified naradaBrokering id
 void closeLinks(String linkId)
          Close all links associated with the specified Id.
 void dataReceived(byte[] data, Object linkIdentifier)
          Upon receipt of data at a link that has an assigned NaradaBrokering identifier, this is the method that is used.
 void dataReceived(byte[] data, String linkIdentifier)
          byte[] signifies the data received over a communication link.
 void disposeAllCommunicationResources()
           
 String[] enumerateLinks()
          Enumerate the list of links available.
 String[] getListOfCommunicationProtocolsSupported()
          Provides a list of transport services that are supported by the node
 PerformanceMeasurement getMeasurementService()
          Retrieves the management service
 Hashtable getRegisteredLinks()
           
 Hashtable getSupportedTransportProtocols()
          Gets the list of registered transport protocols along with the property list associated with these protocols.
 TransmissionManager getTransmissionManager()
          Retrieve the TransmissionManager, which keeps track of ongoing transmissions.
 void loadCommunicationsOfType(Properties properties, String communicationsType)
          Used to load a specific communications handler
 void manageLinkLoss(Link link)
          This method is to be invoked by link factories to report communication failure in one of the links (reported in argument) that it manages
 boolean manageLinkMigrationRequest(Link link, String migrateTo)
          This method is to be invoked by link to request migration of transport protocols for one of its managed links
 void mapLinkToBrokerNode(String linkId, Object naradaBrokeringId, Object brokerConnectionIdentifier)
          This method is invoked from the protocol layers, after assigning a NaradaBrokering id
 void mapLinkToClientNode(String linkId, Object naradaBrokeringId, Object clientIdentifier)
          This method is invoked from the protocol layers, after assigning a NaradaBrokering id
 void registerLink(LinkFactory linkFactory, Link link)
          This method is invoked by a link factory when it has successfully set up a connection based on the specific transport protocol.
 void sendData(byte[] data, Object naradaBrokeringId)
          Used to send a stream of bytes to a NaradaBrokering node
 void sendData(byte[] data, Object naradaBrokeringId, String dataType)
          Used to send a stream of bytes to a NaradaBrokering node.
 void sendData(byte[] data, Object naradaBrokeringId, String linkType, String dataType)
          Used to send a stream of bytes to a NaradaBrokering node, using a specified communication type.
 void sendData(byte[] data, String unitializedNode)
          Send data to an unitialized node (or a node to which connection is initiated for the first time).
 void sendData(byte[] data, String unitializedNode, String dataType)
          Send data to an unitialized node (or a node to which connection is initiated for the first time).
 void setLinkStatusIntervals(LinkFactory connectionHandler, long pingIntervals)
          Sets the interval size for a connection status checks for links managed by a specific link factory.
 void setLinkStatusIntervals(long pingIntervals)
          This is used to set the interval size at which tests on connection status need to be performed.
 void setupAlternateLink(Properties linkProperties, Object naradaBrokeringId, String linkType, long keepAliveTime)
          Used by the protocol layers to setup alternate links for communication based on the type of data that is being routed.
 String setupLink(Properties linkProperties, String linkType)
          This is used to setup a communication link between 2 NaradaBrokering end points.
 void shutdown()
           
 

Method Detail

setLinkStatusIntervals

void setLinkStatusIntervals(long pingIntervals)
This is used to set the interval size at which tests on connection status need to be performed.


setLinkStatusIntervals

void setLinkStatusIntervals(LinkFactory connectionHandler,
                            long pingIntervals)
Sets the interval size for a connection status checks for links managed by a specific link factory.


getListOfCommunicationProtocolsSupported

String[] getListOfCommunicationProtocolsSupported()
Provides a list of transport services that are supported by the node


loadCommunicationsOfType

void loadCommunicationsOfType(Properties properties,
                              String communicationsType)
                              throws TransportException
Used to load a specific communications handler

Throws:
TransportException

registerLink

void registerLink(LinkFactory linkFactory,
                  Link link)
This method is invoked by a link factory when it has successfully set up a connection based on the specific transport protocol.


manageLinkLoss

void manageLinkLoss(Link link)
This method is to be invoked by link factories to report communication failure in one of the links (reported in argument) that it manages


manageLinkMigrationRequest

boolean manageLinkMigrationRequest(Link link,
                                   String migrateTo)
This method is to be invoked by link to request migration of transport protocols for one of its managed links


dataReceived

void dataReceived(byte[] data,
                  String linkIdentifier)
byte[] signifies the data received over a communication link. When this particular method is invoked it signifies a handshake. When a link has been assigned a NaradaBrokering identifier this method will not be invoked by the link. Certain data pertaining to the initialization of the link, checking for the status of the link etc. are not routed up to the transport handler.


dataReceived

void dataReceived(byte[] data,
                  Object linkIdentifier)
Upon receipt of data at a link that has an assigned NaradaBrokering identifier, this is the method that is used.


setupLink

String setupLink(Properties linkProperties,
                 String linkType)
                 throws TransportException
This is used to setup a communication link between 2 NaradaBrokering end points. The communication link type is specified in the arguments

Throws:
TransportException

setupAlternateLink

void setupAlternateLink(Properties linkProperties,
                        Object naradaBrokeringId,
                        String linkType,
                        long keepAliveTime)
                        throws TransportException
Used by the protocol layers to setup alternate links for communication based on the type of data that is being routed. Such alternate links also have a keepAlive timer associated with them, which ensure the garbage collection of the link after the time has expired

Throws:
TransportException

sendData

void sendData(byte[] data,
              String unitializedNode)
              throws TransportException
Send data to an unitialized node (or a node to which connection is initiated for the first time).

Throws:
TransportException

sendData

void sendData(byte[] data,
              Object naradaBrokeringId)
              throws TransportException
Used to send a stream of bytes to a NaradaBrokering node

Throws:
TransportException

sendData

void sendData(byte[] data,
              String unitializedNode,
              String dataType)
              throws TransportException
Send data to an unitialized node (or a node to which connection is initiated for the first time). This method also includes information regarding the type (audio/video/xml-attachments etc.) of the data encapsulated within the data stream.

Throws:
TransportException

sendData

void sendData(byte[] data,
              Object naradaBrokeringId,
              String dataType)
              throws TransportException
Used to send a stream of bytes to a NaradaBrokering node. This method also includes information regarding the type (audio/video/xml-attachments etc.) of the data encapsulated within the data stream.

Throws:
TransportException

sendData

void sendData(byte[] data,
              Object naradaBrokeringId,
              String linkType,
              String dataType)
              throws TransportException
Used to send a stream of bytes to a NaradaBrokering node, using a specified communication type. The alternate link should have already been set up prior to the invocation of this method. This method also includes information regarding the type (audio/video/xml-attachments etc.) of the data encapsulated within the data stream.

Throws:
TransportException

enumerateLinks

String[] enumerateLinks()
Enumerate the list of links available. What is returned is the linkID of all the links originating from this node. Returns NULL if no links are available.


closeLinks

void closeLinks(Object naradaBrokeringId)
Eliminate all links associated with communicating with the specified naradaBrokering id


closeLinks

void closeLinks(String linkId)
Close all links associated with the specified Id.


closeAllLinks

void closeAllLinks()
Close all links that have been initiated by the hosting node


disposeAllCommunicationResources

void disposeAllCommunicationResources()

mapLinkToClientNode

void mapLinkToClientNode(String linkId,
                         Object naradaBrokeringId,
                         Object clientIdentifier)
This method is invoked from the protocol layers, after assigning a NaradaBrokering id


mapLinkToBrokerNode

void mapLinkToBrokerNode(String linkId,
                         Object naradaBrokeringId,
                         Object brokerConnectionIdentifier)
This method is invoked from the protocol layers, after assigning a NaradaBrokering id


getMeasurementService

PerformanceMeasurement getMeasurementService()
Retrieves the management service


getRegisteredLinks

Hashtable getRegisteredLinks()

shutdown

void shutdown()

getSupportedTransportProtocols

Hashtable getSupportedTransportProtocols()
Gets the list of registered transport protocols along with the property list associated with these protocols.


getTransmissionManager

TransmissionManager getTransmissionManager()
Retrieve the TransmissionManager, which keeps track of ongoing transmissions.



For comments and suggestions please send e-mail to The NaradaBrokering Project