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.
|
Association |
addAssociation(java.lang.String hostAddress,
int hostPort,
java.lang.String peerAddress,
int peerPort,
java.lang.String assocName,
IpChannelType ipChannelType,
java.lang.String[] extraHostAddresses)
Add Association
|
void |
addManagementEventListener(ManagementEventListener listener)
Adding ManagementEventListener.
|
Server |
addServer(java.lang.String serverName,
java.lang.String hostAddress,
int port)
Add new
Server. |
Server |
addServer(java.lang.String serverName,
java.lang.String hostAddress,
int port,
IpChannelType ipChannelType,
boolean acceptAnonymousConnections,
int maxConcurrentConnectionsCount,
java.lang.String[] extraHostAddresses)
Add new
Server. |
Server |
addServer(java.lang.String serverName,
java.lang.String hostAddress,
int port,
IpChannelType ipChannelType,
java.lang.String[] extraHostAddresses)
Add new
Server. |
Association |
addServerAssociation(java.lang.String peerAddress,
int peerPort,
java.lang.String serverName,
java.lang.String assocName)
Add server Association.
|
Association |
addServerAssociation(java.lang.String peerAddress,
int peerPort,
java.lang.String serverName,
java.lang.String assocName,
IpChannelType ipChannelType)
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
|
ServerListener |
getServerListener()
The AssociationListener set for this Association
|
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
|
boolean |
isStarted()
returns true if Management is started
|
void |
removeAllResourses()
This method stops and removes all registered servers and associations
Management should be started
Use this method only for test purposes or after total crashes
|
void |
removeAssociation(java.lang.String assocName)
Remove existing Association.
|
void |
removeManagementEventListener(ManagementEventListener listener)
Removing ManagementEventListener.
|
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 |
setServerListener(ServerListener serverListener)
The
AssociationListener to be registered for this Association |
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 - ServerListener getServerListener()
void setServerListener(ServerListener serverListener)
AssociationListener to be registered for this AssociationassociationListener - void addManagementEventListener(ManagementEventListener listener)
listener - void removeManagementEventListener(ManagementEventListener listener)
listener - 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.Exceptionboolean isStarted()
void removeAllResourses()
throws java.lang.Exception
java.lang.ExceptionServer addServer(java.lang.String serverName, java.lang.String hostAddress, int port, IpChannelType ipChannelType, boolean acceptAnonymousConnections, int maxConcurrentConnectionsCount, java.lang.String[] extraHostAddresses) 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 toipChannelType - IP channel type: SCTP or TCPacceptAnonymousConnections - true: this Server accepts Anonymous connections, false: nomaxConcurrentConnectionsCount - A count of concurrent connections that can accept a Server. 0 means an unlimited count.extraHostAddresses - When SCTP multi-homing configuration extra IP addresses can be put here
If multi-homing absence this parameter can be nulljava.lang.Exception - Exception if management not started or server name already
taken or some other server already has same ip:portServer addServer(java.lang.String serverName, java.lang.String hostAddress, int port, IpChannelType ipChannelType, java.lang.String[] extraHostAddresses) throws java.lang.Exception
Server. Server can not accept anonymous connections.serverName - name of the Server. Should be unique namehostAddress - IP address that this server will bind toport - port that this server will bind toipChannelType - IP channel type: SCTP or TCPextraHostAddresses - When SCTP multi-homing configuration extra IP addresses can be put here
If multi-homing absence this parameter can be nulljava.lang.Exception - Exception if management not started or server name already
taken or some other server already has same ip:portServer addServer(java.lang.String serverName, java.lang.String hostAddress, int port) throws java.lang.Exception
Server. IP channel type is SCTP. Server can not accept anonymous connections.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 addServerAssociation(java.lang.String peerAddress, int peerPort, java.lang.String serverName, java.lang.String assocName, IpChannelType ipChannelType) 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 AssociationipChannelType - IP channel type: SCTP or TCPjava.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 - If hostPort==0 this mean the local port will be any vacant portpeerAddress - peerPort - assocName - java.lang.ExceptionAssociation addAssociation(java.lang.String hostAddress, int hostPort, java.lang.String peerAddress, int peerPort, java.lang.String assocName, IpChannelType ipChannelType, java.lang.String[] extraHostAddresses) throws java.lang.Exception
hostAddress - hostPort - If hostPort==0 this mean the local port will be any vacant portpeerAddress - peerPort - assocName - ipChannelType - IP channel type: SCTP or TCPextraHostAddresses - When SCTP multi-homing configuration extra IP addresses can be put here
If multi-homing absence this parameter can be nulljava.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.