org.mobicents.protocols.api
public interface Management
Management class manages the underlying Association and
Server.
Management should persist the state of Server and Association
Management when started looks for file XXX_sctp.xml containing serialized state of underlying
Association and Server. Set the directory path by calling setPersistDir(String) to direct Management to look at specified
directory for underlying serialized file.
If directory path is not set, Management searches for system property sctp.persist.dir to get the path for directory
Even if sctp.persist.dir system property is not set, Management will look at System set property user.dir
| Modifier and Type | Method and Description |
|---|---|
Association |
addAssociation(java.lang.String hostAddress,
int hostPort,
java.lang.String peerAddress,
int peerPort,
java.lang.String assocName)
Add Association
|
Server |
addServer(java.lang.String serverName,
java.lang.String hostAddress,
int port)
Add new
Server. |
Association |
addServerAssociation(java.lang.String peerAddress,
int peerPort,
java.lang.String serverName,
java.lang.String assocName)
Add server Association.
|
Association |
getAssociation(java.lang.String assocName)
Get existing Association for passed name
|
java.util.Map<java.lang.String,Association> |
getAssociations()
Get configured Association map with name as key and Association instance
as value
|
int |
getConnectDelay()
Get connection delay.
|
java.lang.String |
getName()
Returns the name of this
Management instance |
java.lang.String |
getPersistDir()
Get persist dir
|
java.util.List<Server> |
getServers()
Get the list of Servers configured
|
int |
getWorkerThreads()
Number of threads configured to callback
AssociationListener
methods. |
boolean |
isSingleThread()
If set as single thread, number of workers thread set has no effect and
entire protocol stack runs on single thread
|
void |
removeAssociation(java.lang.String assocName)
Remove existing Association.
|
void |
removeServer(java.lang.String serverName)
Remove existing
Server |
void |
setConnectDelay(int connectDelay)
Set the connection delay for client side
Association |
void |
setPersistDir(java.lang.String persistDir)
Directory where the XXX.xml will be searched
|
void |
setSingleThread(boolean singleThread)
Set protocol stack as single thread
|
void |
setWorkerThreads(int workerThreads)
Number of threads configured for callback
AssociationListener |
void |
start()
Start the management.
|
void |
startAssociation(java.lang.String assocName)
Start the existing Association
|
void |
startServer(java.lang.String serverName)
Start the existing Server
|
void |
stop()
Stop the management.
|
void |
stopAssociation(java.lang.String assocName)
Stop the existing Association
|
void |
stopServer(java.lang.String serverName)
Stop the Server.
|
java.lang.String getName()
Management instancejava.lang.String getPersistDir()
void setPersistDir(java.lang.String persistDir)
persistDir - void start()
throws java.lang.Exception
Management is started. If Server and Association
were defined previously, Management should recreate those Server
and Association.java.lang.Exceptionvoid stop()
throws java.lang.Exception
Server and
Associtaion.java.lang.ExceptionServer addServer(java.lang.String serverName, java.lang.String hostAddress, int port) throws java.lang.Exception
Server.serverName - name of the Server. Should be unique namehostAddress - IP address that this server will bind toport - port that this server will bind tojava.lang.Exception - Exception if management not started or server name already
taken or some other server already has same ip:portvoid removeServer(java.lang.String serverName)
throws java.lang.Exception
ServerserverName - java.lang.Exception - Exception if no Server with the passed name exist or Server
is started. Before removing server, it should be stoppedvoid startServer(java.lang.String serverName)
throws java.lang.Exception
serverName - name of the Server to be startedjava.lang.Exception - Exception if no Server found for given name or Server already
startedvoid stopServer(java.lang.String serverName)
throws java.lang.Exception
serverName - name of the Server to be stoppedjava.lang.Exception - Exception if no Server found for given name or any of the
Association within Server still started. All the
Association's must be stopped before stopping Serverjava.util.List<Server> getServers()
Association addServerAssociation(java.lang.String peerAddress, int peerPort, java.lang.String serverName, java.lang.String assocName) throws java.lang.Exception
peerAddress - the peer IP address that this association will accept
connection frompeerPort - the peer port that this association will accept connection
fromserverName - the Server that this association belongs toassocName - unique name of Associationjava.lang.ExceptionAssociation addAssociation(java.lang.String hostAddress, int hostPort, java.lang.String peerAddress, int peerPort, java.lang.String assocName) throws java.lang.Exception
hostAddress - hostPort - peerAddress - peerPort - assocName - java.lang.Exceptionvoid removeAssociation(java.lang.String assocName)
throws java.lang.Exception
assocName - java.lang.ExceptionAssociation getAssociation(java.lang.String assocName) throws java.lang.Exception
assocName - java.lang.Exceptionjava.util.Map<java.lang.String,Association> getAssociations()
void startAssociation(java.lang.String assocName)
throws java.lang.Exception
assocName - java.lang.Exceptionvoid stopAssociation(java.lang.String assocName)
throws java.lang.Exception
assocName - java.lang.Exceptionint getConnectDelay()
Association dies due to
network failure or any other reason, it should attempt to reconnect after
connectDelay intervalvoid setConnectDelay(int connectDelay)
AssociationconnectDelay - int getWorkerThreads()
AssociationListener
methods.void setWorkerThreads(int workerThreads)
AssociationListenerworkerThreads - boolean isSingleThread()
void setSingleThread(boolean singleThread)
singleThread - Copyright © 2012. All Rights Reserved.