org.mobicents.mscontrol
Interface MsLink

All Superinterfaces:
java.io.Serializable

public interface MsLink
extends java.io.Serializable

A MsLink represents link between two org.mobicents.media.server.spi.Endpoint Application creates instance of MsLink by calling MsSession.createLink(MsLinkMode) As soon MsLink is created MsSession call's MsLink.fireMsLinkCreated() to fire the Event MsLinkEventID.LINK_CREATED MsLink maintains the reference to MsSession object for life of MsLink

Author:
Oleg Kulikov, amit.bhayani

Method Summary
 void addLinkListener(MsLinkListener listener)
          Adds link listener at MsLink level.
 void addNotificationListener(MsNotificationListener listener)
          Add the MsNotificationListener at MsLink level.
 MsEndpoint[] getEndpoints()
          Returns back the Endpoints names that this link is trying to join
 java.lang.String getId()
          Gets the Link ID
 MsLinkMode getMode()
          Get the MsLinkMode of this MsLink
 MsSession getSession()
          Gets the session to which this links belongs
 MsLinkState getState()
          Returns the state of MsLink
 void join(java.lang.String a, java.lang.String b)
          Joins specified endpoints.
 void release()
          Drops this link
 void removeLinkListener(MsLinkListener listener)
          Removes connection listener.
 void removeNotificationListener(MsNotificationListener listener)
          Remove the instance of MsNotificationListener to no longer receive the events for state change of MsLink
 void setMode(MsLinkMode mode)
          While creating the MsLink, application passes the MsLinkMode.
 

Method Detail

getId

java.lang.String getId()
Gets the Link ID

Returns:
the unique identifier of this MsLink

getState

MsLinkState getState()
Returns the state of MsLink

Returns:
Instance of MsLinkState

getSession

MsSession getSession()
Gets the session to which this links belongs

Returns:
the session object.

join

void join(java.lang.String a,
          java.lang.String b)
Joins specified endpoints.

Parameters:
a - the name of the first endpoint.
b - the name of the second endpoint.

getEndpoints

MsEndpoint[] getEndpoints()
Returns back the Endpoints names that this link is trying to join

Returns:
MsEndpoint[]. Array has precisely two Endpoints that this Link is connecting

getMode

MsLinkMode getMode()
Get the MsLinkMode of this MsLink

Returns:
MsLinkMode

setMode

void setMode(MsLinkMode mode)
While creating the MsLink, application passes the MsLinkMode. At any time if MsLinkMode needs to be changed this method is called passing appropriate MsLinkMode. If the link is already in same mode as that of passed, nothing happens.

Parameters:
mode - MsLinkMode

release

void release()
Drops this link


addLinkListener

void addLinkListener(MsLinkListener listener)
Adds link listener at MsLink level. The registered listener will be called for state change of this MsLink only.
The order is such that MsLinkListener registered at MsProvider will be called before MsLinkListener at MsLink level

Parameters:
listener - the listener object.

removeLinkListener

void removeLinkListener(MsLinkListener listener)
Removes connection listener.

Parameters:
listener - the listener object was added previously.

addNotificationListener

void addNotificationListener(MsNotificationListener listener)
Add the MsNotificationListener at MsLink level. The registered listener will be called for state change of this MsLink only.
The order is such that MsNotificationListener registered at MsProvider will be called before MsNotificationListener at MsLink level

Parameters:
listener - Instance of MsNotificationListener to be registered

removeNotificationListener

void removeNotificationListener(MsNotificationListener listener)
Remove the instance of MsNotificationListener to no longer receive the events for state change of MsLink

Parameters:
listener - Instance of MsNotificationListener to be de-registered


Copyright © 2009. All Rights Reserved.