cgl.narada.samples.nbNative.tds
Class NBMediaConnector

java.lang.Object
  extended by cgl.narada.samples.nbNative.tds.NBMediaConnector
All Implemented Interfaces:
NBEventListener, NBRecoveryListener, ReplayServiceListener, javax.media.rtp.RTPConnector

public class NBMediaConnector
extends Object
implements javax.media.rtp.RTPConnector, NBEventListener, NBRecoveryListener, ReplayServiceListener


Field Summary
protected  TransportHandler transportHandler
           
 
Constructor Summary
NBMediaConnector(String ip, int brkPort, int entityID)
           
NBMediaConnector(String ip, int brkPort, int entityID, int topicNumber)
           
 
Method Summary
 void close()
           
 void closeBrokerConnection()
           
 javax.media.protocol.PushSourceStream getControlInputStream()
          Returns an input stream to receive the RTCP data.
 javax.media.rtp.OutputDataStream getControlOutputStream()
          Returns an output stream to send the RTCP data.
 javax.media.protocol.PushSourceStream getDataInputStream()
          Returns an input stream to receive the RTP data.
 javax.media.rtp.OutputDataStream getDataOutputStream()
          Returns an output stream to send the RTP data.
 int getReceiveBufferSize()
          Get the receive buffer size set on the RTP data channel.
 double getRTCPBandwidthFraction()
          Return the RTCP bandwidth fraction.
 double getRTCPSenderBandwidthFraction()
          Return the RTCP sender bandwidth fraction.
 int getSendBufferSize()
          Get the send buffer size set on the RTP data channel.
 void initializeBrokerCommunications(Properties props, String commType)
           
 void initializeReceiver()
           
 void initializeReceiverWithTDS()
           
 void initializeTransmitter()
           
 void initiateReplay(long start, long stop)
           
 boolean isClient()
           
 void onEvent(NBEvent nbEvent)
          Upon the receipt of an event which has satisfied all the constraints, if any were provided, that needed to be satisfied prior to delivery
 void onRecovery(NBRecoveryNotification recoveryNotification)
          Upon completion of the attempt to recover, this method is invoked on the listener that was registered with the
 void onReplay(ReplayEvent replayEvent)
           
 void onReplayResponse(ReplayResponse replayResponse)
           
 void publishEvent(byte[] data, int offset, int length, String tpcName)
           
 void setPublishEnabled(boolean toPublish)
          Enable or diable publishing of streams
 void setReceiveBufferSize(int size)
          Set the receive buffer size of the RTP data channel.
 void setSendBufferSize(int size)
          Set the send buffer size of the RTP data channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transportHandler

protected TransportHandler transportHandler
Constructor Detail

NBMediaConnector

public NBMediaConnector(String ip,
                        int brkPort,
                        int entityID,
                        int topicNumber)

NBMediaConnector

public NBMediaConnector(String ip,
                        int brkPort,
                        int entityID)
Method Detail

initializeBrokerCommunications

public void initializeBrokerCommunications(Properties props,
                                           String commType)
                                    throws ServiceException
Throws:
ServiceException

initializeReceiver

public void initializeReceiver()
                        throws ServiceException
Throws:
ServiceException

initializeReceiverWithTDS

public void initializeReceiverWithTDS()
                               throws ServiceException
Throws:
ServiceException

initiateReplay

public void initiateReplay(long start,
                           long stop)
                    throws ServiceException
Throws:
ServiceException

onReplay

public void onReplay(ReplayEvent replayEvent)
Specified by:
onReplay in interface ReplayServiceListener

onReplayResponse

public void onReplayResponse(ReplayResponse replayResponse)
Specified by:
onReplayResponse in interface ReplayServiceListener

initializeTransmitter

public void initializeTransmitter()
                           throws ServiceException
Throws:
ServiceException

onEvent

public void onEvent(NBEvent nbEvent)
Description copied from interface: NBEventListener
Upon the receipt of an event which has satisfied all the constraints, if any were provided, that needed to be satisfied prior to delivery

Specified by:
onEvent in interface NBEventListener

onRecovery

public void onRecovery(NBRecoveryNotification recoveryNotification)
Upon completion of the attempt to recover, this method is invoked on the listener that was registered with the

Specified by:
onRecovery in interface NBRecoveryListener

setPublishEnabled

public void setPublishEnabled(boolean toPublish)
Enable or diable publishing of streams


publishEvent

public void publishEvent(byte[] data,
                         int offset,
                         int length,
                         String tpcName)
                  throws ServiceException,
                         NBEventException
Throws:
ServiceException
NBEventException

isClient

public boolean isClient()

close

public void close()
Specified by:
close in interface javax.media.rtp.RTPConnector

closeBrokerConnection

public void closeBrokerConnection()
                           throws ServiceException
Throws:
ServiceException

getDataInputStream

public javax.media.protocol.PushSourceStream getDataInputStream()
Returns an input stream to receive the RTP data.

Specified by:
getDataInputStream in interface javax.media.rtp.RTPConnector

getDataOutputStream

public javax.media.rtp.OutputDataStream getDataOutputStream()
Returns an output stream to send the RTP data.

Specified by:
getDataOutputStream in interface javax.media.rtp.RTPConnector

getControlInputStream

public javax.media.protocol.PushSourceStream getControlInputStream()
Returns an input stream to receive the RTCP data.

Specified by:
getControlInputStream in interface javax.media.rtp.RTPConnector

getControlOutputStream

public javax.media.rtp.OutputDataStream getControlOutputStream()
Returns an output stream to send the RTCP data.

Specified by:
getControlOutputStream in interface javax.media.rtp.RTPConnector

setReceiveBufferSize

public void setReceiveBufferSize(int size)
                          throws IOException
Set the receive buffer size of the RTP data channel. This is only a hint to the implementation. The actual implementation may not be able to do anything to this.

Specified by:
setReceiveBufferSize in interface javax.media.rtp.RTPConnector
Throws:
IOException

getReceiveBufferSize

public int getReceiveBufferSize()
Get the receive buffer size set on the RTP data channel. Return -1 if the receive buffer size is not applicable for the implementation.

Specified by:
getReceiveBufferSize in interface javax.media.rtp.RTPConnector

setSendBufferSize

public void setSendBufferSize(int size)
                       throws IOException
Set the send buffer size of the RTP data channel. This is only a hint to the implementation. The actual implementation may not be able to do anything to this.

Specified by:
setSendBufferSize in interface javax.media.rtp.RTPConnector
Throws:
IOException

getSendBufferSize

public int getSendBufferSize()
Get the send buffer size set on the RTP data channel. Return -1 if the send buffer size is not applicable for the implementation.

Specified by:
getSendBufferSize in interface javax.media.rtp.RTPConnector

getRTCPBandwidthFraction

public double getRTCPBandwidthFraction()
Return the RTCP bandwidth fraction. This value is used to initialize the RTPManager. Check RTPManager for more detauls. Return -1 to use the default values.

Specified by:
getRTCPBandwidthFraction in interface javax.media.rtp.RTPConnector

getRTCPSenderBandwidthFraction

public double getRTCPSenderBandwidthFraction()
Return the RTCP sender bandwidth fraction. This value is used to initialize the RTPManager. Check RTPManager for more detauls. Return -1 to use the default values.

Specified by:
getRTCPSenderBandwidthFraction in interface javax.media.rtp.RTPConnector


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