cgl.narada.samples.security
Class NBMediaConnector

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

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


Field Summary
protected  TransportHandler transportHandler
           
 
Constructor Summary
NBMediaConnector(String ip, int brkPort, int entityID)
           
NBMediaConnector(String ip, int brkPort, int entityID, int topicNo)
           
 
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.
 String getControlTopic()
           
 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.
 String getDataTopic()
           
 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 initializeTransmitter(String sig, String mode, String padding, String _data, SecureTopicKeyResponse dataToken, String _control, SecureTopicKeyResponse controlToken, PrivateKey priv)
           
 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 publishEvent(byte[] data, int offset, int length, String tpcName)
           
 void setEncryptedControlTopicUUID(String encryptedControlTopicUUID)
           
 void setEncryptedDataTopicUUID(String encryptedDataTopicUUID)
           
 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.
 void subscribe(String _data, SecureTopicKeyResponse r2, PublicKey rootCAPubKey)
           
 
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 topicNo)

NBMediaConnector

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

initializeBrokerCommunications

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

getControlTopic

public String getControlTopic()
Returns:
Returns the controlTopic.

getDataTopic

public String getDataTopic()
Returns:
Returns the dataTopic.

subscribe

public void subscribe(String _data,
                      SecureTopicKeyResponse r2,
                      PublicKey rootCAPubKey)
               throws ServiceException
Throws:
ServiceException

initializeTransmitter

public void initializeTransmitter(String sig,
                                  String mode,
                                  String padding,
                                  String _data,
                                  SecureTopicKeyResponse dataToken,
                                  String _control,
                                  SecureTopicKeyResponse controlToken,
                                  PrivateKey priv)
                           throws ServiceException
Throws:
ServiceException

setEncryptedControlTopicUUID

public void setEncryptedControlTopicUUID(String encryptedControlTopicUUID)
Parameters:
encryptedControlTopicUUID - The encryptedControlTopicUUID to set.

setEncryptedDataTopicUUID

public void setEncryptedDataTopicUUID(String encryptedDataTopicUUID)
Parameters:
encryptedDataTopicUUID - The encryptedDataTopicUUID to set.

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

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