cgl.narada.transport.rtp
Class RTPLinkFactory

java.lang.Object
  extended by cgl.narada.transport.rtp.RTPLinkFactory
All Implemented Interfaces:
LinkFactory, TransportDebugFlags

public class RTPLinkFactory
extends Object
implements LinkFactory, TransportDebugFlags

An RTP implementation of the LinkFactory. It can construct both unicast and multicast rtplinks. It provides one method for each.


Field Summary
 
Fields inherited from interface cgl.narada.transport.TransportDebugFlags
IPSecLink_Debug, IPSecLinkFactory_Debug, IPSecReceiverThread_Debug, IPSecSenderThread_Debug, IPSecServerThread_Debug, MulticastLink_Debug, MulticastLinkFactory_Debug, MulticastReceiverThread_Debug, MulticastSenderThread_Debug, NIOTCPLink_Debug, NIOTCPLinkFactory_Debug, NIOTCPReceiverThread_Debug, NIOTCPSenderThread_Debug, NIOTCPServerThread_Debug, PoolTCPLink_Debug, PoolTCPLinkFactory_Debug, PoolTCPLinkReceiver_Debug, PoolTCPLinkSender_Debug, PoolTCPServerThread_Debug, PTCPLink_Debug, PTCPLinkFactory_Debug, PTCPReceiverThread_Debug, PTCPSenderThread_Debug, PTCPServerThread_Debug, ReceiveTask_Debug, RTPLink_Debug, RTPLinkFactory_Debug, RTPReceiverThread_Debug, RTPSenderThread_Debug, SendTask_Debug, TCPLink_Debug, TCPLinkFactory_Debug, TCPReceiverThread_Debug, TCPSenderThread_Debug, TCPServerThread_Debug, TransmissionManager_Debug, TransportHandlerImpl_Debug, UDPLink_Debug, UDPLinkFactory_Debug, UDPReceiverThread_Debug, UDPSenderThread_Debug
 
Constructor Summary
RTPLinkFactory()
           
 
Method Summary
 boolean canManageLinkMigrationOfType(String linkType)
          Indicates if this factory can manage migration of links of a certain type
 void closeAllLinks()
          close the link which has the given id
 boolean closeLink(String linkID)
          close the link which has the given id
 Link createLink(Properties linkProperties)
          does nothing
static String createLinkID(InetAddress remoteAddress, int localPort)
          create a linkId with the given ip address and port number
 MulticastRTPLink createMulticastRTPLink(InetAddress multicastAddress, int port, int publicationTopic, int topicRange)
          construct a multicast rtp link.
 RTPLink createRTPLink(InetAddress remoteAddress, int remotePort, int localPort, int publicationTopic)
          this method construct a unicast rtp link.
 void dispose()
          This method is used to garbage collect any resources associated with the link factory
 Link getLink(String linkID)
          return the link with the given linkID
 String getManagedLinksType()
          Return the type of all the links created/managed by this factory
 TransportHandler getTransportHandler()
           
 void handleInboundRTPLinkRequest(InetAddress remoteAddress, int remotePort)
           
 boolean loadLinkFactoryServices()
          Starts communication services.
 void manageLinkMigration(Link link)
          Used to migrate communications of a link to the one supported by links managed by this factory
 void reportLinkLoss(Link linkLost)
           
 void setLinkFactoryProperties(Properties factoryProperties)
          There is nothing to set.
 void setLinkStatusInterval(long interval)
          Set the interval for checking status of all links managed by this factory to the one specified in the argument
 void setTransportHandler(TransportHandler transportHandler)
          Sets the reference to the transport handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTPLinkFactory

public RTPLinkFactory()
Method Detail

setLinkFactoryProperties

public void setLinkFactoryProperties(Properties factoryProperties)
There is nothing to set.

Specified by:
setLinkFactoryProperties in interface LinkFactory

getManagedLinksType

public String getManagedLinksType()
Return the type of all the links created/managed by this factory

Specified by:
getManagedLinksType in interface LinkFactory

createLink

public Link createLink(Properties linkProperties)
                throws TransportException
does nothing

Specified by:
createLink in interface LinkFactory
Throws:
TransportException

createLinkID

public static String createLinkID(InetAddress remoteAddress,
                                  int localPort)
create a linkId with the given ip address and port number

Parameters:
remoteAddress -
localPort -

createRTPLink

public RTPLink createRTPLink(InetAddress remoteAddress,
                             int remotePort,
                             int localPort,
                             int publicationTopic)
                      throws Exception
this method construct a unicast rtp link.

Parameters:
remoteAddress - the ip address of the remote party.
remotePort - the port number of the remote client
localPort - the udp port on the broker to receive packages from this client
publicationTopic - the topic number to publish the received messages.
Returns:
the initialized rtp link.
Throws:
Exception

createMulticastRTPLink

public MulticastRTPLink createMulticastRTPLink(InetAddress multicastAddress,
                                               int port,
                                               int publicationTopic,
                                               int topicRange)
                                        throws Exception
construct a multicast rtp link. it will listen on a multicast address and publish the received streams on the broker. it can also sends streams from broker to the multicast address by subscribing to topics.

Parameters:
multicastAddress - the multicast ip address
port - multicast port number.
publicationTopic - the base topic number to publish. firts stream will be published on this topics.
topicRange - the maximum number of topics to use to publish messages.
Throws:
Exception

closeAllLinks

public void closeAllLinks()
close the link which has the given id


closeLink

public boolean closeLink(String linkID)
close the link which has the given id


getLink

public Link getLink(String linkID)
return the link with the given linkID


setLinkStatusInterval

public void setLinkStatusInterval(long interval)
Set the interval for checking status of all links managed by this factory to the one specified in the argument

Specified by:
setLinkStatusInterval in interface LinkFactory

loadLinkFactoryServices

public boolean loadLinkFactoryServices()
                                throws TransportException
Starts communication services. In this case what we do is start the RTPListener thread, which listens to datagram packets arriving at the RTPListenerPort

Specified by:
loadLinkFactoryServices in interface LinkFactory
Throws:
TransportException

canManageLinkMigrationOfType

public boolean canManageLinkMigrationOfType(String linkType)
Indicates if this factory can manage migration of links of a certain type

Specified by:
canManageLinkMigrationOfType in interface LinkFactory

manageLinkMigration

public void manageLinkMigration(Link link)
                         throws TransportException
Used to migrate communications of a link to the one supported by links managed by this factory

Specified by:
manageLinkMigration in interface LinkFactory
Throws:
TransportException

setTransportHandler

public void setTransportHandler(TransportHandler transportHandler)
Sets the reference to the transport handler. This is done during the loadLinkFactory() operation within the transport handler implementations.

Specified by:
setTransportHandler in interface LinkFactory

dispose

public void dispose()
This method is used to garbage collect any resources associated with the link factory

Specified by:
dispose in interface LinkFactory

handleInboundRTPLinkRequest

public void handleInboundRTPLinkRequest(InetAddress remoteAddress,
                                        int remotePort)

reportLinkLoss

public void reportLinkLoss(Link linkLost)

getTransportHandler

public TransportHandler getTransportHandler()


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