public abstract class BaseConnection extends Object implements Connection
| Constructor and Description |
|---|
BaseConnection(int id,
org.restcomm.media.scheduler.PriorityQueueScheduler scheduler)
Creates basic connection implementation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ConnectionListener listener) |
void |
bind()
Initiates transition from NULL to HALF_OPEN state.
|
void |
close()
Initiates transition from any state to state NULL.
|
abstract AudioComponent |
getAudioComponent() |
String |
getDescriptor() |
Endpoint |
getEndpoint() |
int |
getId() |
boolean |
getIsLocal()
Gets whether connection should be bound to local or remote interface.
|
String |
getLocalDescriptor() |
ConnectionMode |
getMode()
Gets the current mode of this connection.
|
abstract OOBComponent |
getOOBComponent() |
String |
getRemoteDescriptor() |
ConnectionState |
getState() |
String |
getTextualId() |
void |
join()
Initiates transition from HALF_OPEN to OPEN state.
|
protected abstract void |
onClosed()
Called when connection is moving from OPEN state to NULL state.
|
protected abstract void |
onCreated()
Called when connection created.
|
protected abstract void |
onFailed()
Called if failure has bean detected during transition.
|
protected abstract void |
onOpened()
Called when connected moved to OPEN state.
|
protected void |
releaseConnection(ConnectionType connectionType) |
void |
removeListener(ConnectionListener listener) |
abstract void |
setConnectionFailureListener(ConnectionFailureListener connectionFailureListener)
Sets connection failure listener.
|
void |
setEndpoint(Endpoint endpoint) |
void |
setIsLocal(boolean isLocal)
Sets whether connection should be bound to local or remote interface.
|
void |
setMode(ConnectionMode mode)
Modify mode of this connection for all known media types.
|
abstract void |
setOtherParty(byte[] descriptor)
Joins endpoint which executes this connection with other party.
|
abstract void |
setOtherParty(Connection other)
Joins endpoint wich executes this connection with other party.
|
abstract void |
setOtherParty(Text descriptor)
Joins endpoint which executes this connection with other party.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgenerateCname, generateOffer, getBytesReceived, getBytesTransmitted, getCname, getJitter, getPacketsReceived, getPacketsTransmitted, isAvailablepublic BaseConnection(int id,
org.restcomm.media.scheduler.PriorityQueueScheduler scheduler)
id - the unique identifier of this connection within endpoint.endpoint - the endpoint owner of this connection.public abstract AudioComponent getAudioComponent()
public abstract OOBComponent getOOBComponent()
public int getId()
getId in interface Connectionpublic String getTextualId()
getTextualId in interface Connectionpublic ConnectionState getState()
getState in interface Connectionpublic String getDescriptor()
getDescriptor in interface Connectionpublic String getLocalDescriptor()
getLocalDescriptor in interface Connectionpublic String getRemoteDescriptor()
getRemoteDescriptor in interface Connectionpublic void setEndpoint(Endpoint endpoint)
setEndpoint in interface Connectionpublic Endpoint getEndpoint()
getEndpoint in interface Connectionpublic void addListener(ConnectionListener listener)
addListener in interface Connectionpublic void removeListener(ConnectionListener listener)
removeListener in interface Connectionpublic void bind()
throws Exception
Exceptionpublic void join()
throws Exception
Exceptionpublic void close()
public ConnectionMode getMode()
getMode in interface Connectionpublic void setMode(ConnectionMode mode) throws ModeNotSupportedException
setMode in interface Connectionmode - the new mode of the connection.ModeNotSupportedExceptionpublic abstract void setConnectionFailureListener(ConnectionFailureListener connectionFailureListener)
setConnectionFailureListener in interface Connectionprotected abstract void onCreated()
throws Exception
Exceptionprotected abstract void onOpened()
throws Exception
Exceptionprotected abstract void onClosed()
protected abstract void onFailed()
public abstract void setOtherParty(Connection other) throws IOException
setOtherParty in interface Connectionother - the connection executed by other party endpoint.IOExceptionpublic abstract void setOtherParty(byte[] descriptor)
throws IOException
setOtherParty in interface Connectiondescriptor - the SDP descriptor of the other party.IOExceptionpublic abstract void setOtherParty(Text descriptor) throws IOException
setOtherParty in interface Connectiondescriptor - the SDP descriptor of the other party.IOExceptionpublic boolean getIsLocal()
Supported only for RTP connections.
getIsLocal in interface Connectionpublic void setIsLocal(boolean isLocal)
Supported only for RTP connections.
setIsLocal in interface Connectionprotected void releaseConnection(ConnectionType connectionType)
Copyright © 2017 TeleStax, Inc.. All Rights Reserved.