Package org.jitsi.service.neomedia
Class AbstractSrtpControl<T extends SrtpControl.TransformEngine>
- java.lang.Object
-
- org.jitsi.service.neomedia.AbstractSrtpControl<T>
-
- All Implemented Interfaces:
SrtpControl
- Direct Known Subclasses:
DtlsControlImpl,NullSrtpControl,SDesControlImpl,ZrtpControlImpl
public abstract class AbstractSrtpControl<T extends SrtpControl.TransformEngine> extends Object implements SrtpControl
Provides an abstract, base implementation ofSrtpControlto facilitate implementers.- Author:
- Lyubomir Marinov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jitsi.service.neomedia.SrtpControl
SrtpControl.TransformEngine
-
-
Field Summary
Fields Modifier and Type Field Description protected TtransformEngine-
Fields inherited from interface org.jitsi.service.neomedia.SrtpControl
RTP_SAVP, RTP_SAVPF
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSrtpControl(SrtpControlType srtpControlType)Initializes a new AbstractSrtpControl instance with a specific SrtpControlType.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcleanup(Object user)Cleans up this SrtpControl and its TransformEngine.protected abstract TcreateTransformEngine()Initializes a new TransformEngine instance to be associated with and used by this SrtpControl instance.protected voiddoCleanup()Prepares thisSrtpControlfor garbage collection.SrtpControlTypegetSrtpControlType()Gets the SrtpControlType of this instance.SrtpListenergetSrtpListener()Returns the SrtpListener which listens for security events.TgetTransformEngine()Returns the transform engine currently used by this stream.voidregisterUser(Object user)Registers user as an instance which is currently using this SrtpControl.voidsetMasterSession(boolean masterSession)When in multistream mode, enables the master session.voidsetMultistream(SrtpControl master)Sets the multistream data, which means that the master stream has successfully started and this will start all other streams in this session.voidsetSrtpListener(SrtpListener srtpListener)Sets a SrtpListener that will listen for security events.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jitsi.service.neomedia.SrtpControl
getSecureCommunicationStatus, requiresSecureSignalingTransport, setConnector, start
-
-
-
-
Field Detail
-
transformEngine
protected T extends SrtpControl.TransformEngine transformEngine
-
-
Constructor Detail
-
AbstractSrtpControl
protected AbstractSrtpControl(SrtpControlType srtpControlType)
Initializes a new AbstractSrtpControl instance with a specific SrtpControlType.- Parameters:
srtpControlType- the SrtpControlType of the new instance
-
-
Method Detail
-
cleanup
public void cleanup(Object user)
Cleans up this SrtpControl and its TransformEngine. InvokesdoCleanup()if there are no more users (advertised viaregisterUser(Object)) of thisSrtpControl.- Specified by:
cleanupin interfaceSrtpControl- Parameters:
user- the Object which requests the clean-up and is supposedly currently using thisSrtpControl(i.e. has already usedSrtpControl.registerUser(Object)).
-
createTransformEngine
protected abstract T createTransformEngine()
Initializes a new TransformEngine instance to be associated with and used by this SrtpControl instance.- Returns:
- a new TransformEngine instance to be associated with and used by this SrtpControl instance
-
doCleanup
protected void doCleanup()
Prepares thisSrtpControlfor garbage collection.
-
getSrtpControlType
public SrtpControlType getSrtpControlType()
Gets the SrtpControlType of this instance.- Specified by:
getSrtpControlTypein interfaceSrtpControl- Returns:
- the SrtpControlType of this instance
-
getSrtpListener
public SrtpListener getSrtpListener()
Returns the SrtpListener which listens for security events.- Specified by:
getSrtpListenerin interfaceSrtpControl- Returns:
- the SrtpListener which listens for security events
-
getTransformEngine
public T getTransformEngine()
Returns the transform engine currently used by this stream.- Specified by:
getTransformEnginein interfaceSrtpControl- Returns:
- the RTP stream transformation engine
-
setMasterSession
public void setMasterSession(boolean masterSession)
When in multistream mode, enables the master session. The implementation of AbstractSrtpControl does nothing because support for multistream mode is the exception rather than the norm.- Specified by:
setMasterSessionin interfaceSrtpControl- Parameters:
masterSession- whether current control, controls the master session.
-
setMultistream
public void setMultistream(SrtpControl master)
Sets the multistream data, which means that the master stream has successfully started and this will start all other streams in this session. The implementation of AbstractSrtpControl does nothing because support for multistream mode is the exception rather than the norm.- Specified by:
setMultistreamin interfaceSrtpControl- Parameters:
master- The security control of the master stream.
-
setSrtpListener
public void setSrtpListener(SrtpListener srtpListener)
Sets a SrtpListener that will listen for security events.- Specified by:
setSrtpListenerin interfaceSrtpControl- Parameters:
srtpListener- the SrtpListener that will receive the events
-
registerUser
public void registerUser(Object user)
Registers user as an instance which is currently using this SrtpControl.- Specified by:
registerUserin interfaceSrtpControl- Parameters:
user- theObjectwhich is currently using thisSrtpControl
-
-