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(String hostAddress,
int hostPort,
String peerAddress,
int peerPort,
String assocName)
Add Association.
|
Association |
addAssociation(String hostAddress,
int hostPort,
String peerAddress,
int peerPort,
String assocName,
IpChannelType ipChannelType,
String[] extraHostAddresses)
Add Association
|
void |
addManagementEventListener(ManagementEventListener listener)
Adding ManagementEventListener.
|
Server |
addServer(String serverName,
String hostAddress,
int port)
Add new
Server. |
Server |
addServer(String serverName,
String hostAddress,
int port,
IpChannelType ipChannelType,
boolean acceptAnonymousConnections,
int maxConcurrentConnectionsCount,
String[] extraHostAddresses)
Add new
Server. |
Server |
addServer(String serverName,
String hostAddress,
int port,
IpChannelType ipChannelType,
String[] extraHostAddresses)
Add new
Server. |
Association |
addServerAssociation(String peerAddress,
int peerPort,
String serverName,
String assocName)
Add server Association.
|
Association |
addServerAssociation(String peerAddress,
int peerPort,
String serverName,
String assocName,
IpChannelType ipChannelType)
Add server Association.
|
Association |
getAssociation(String assocName)
Get existing Association for passed name
|
Map<String,Association> |
getAssociations()
Get configured Association map with name as key and Association instance
as value
|
int |
getBufferSize()
Get a sending / receiving buffer size per an association (in bytes).
|
int |
getConnectDelay()
Get connection delay.
|
String |
getName()
Returns the name of this
Management instance |
String |
getPersistDir()
Get persist dir
|
ServerListener |
getServerListener()
The AssociationListener set for this Association
|
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(String assocName)
Remove existing Association.
|
void |
removeManagementEventListener(ManagementEventListener listener)
Removing ManagementEventListener.
|
void |
removeServer(String serverName)
Remove existing
Server |
void |
setBufferSize(int bufferSize)
Set a sending / receiving buffer size per an association (in bytes).
|
void |
setConnectDelay(int connectDelay)
Set the connection delay for client side
Association |
void |
setPersistDir(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(String assocName)
Start the existing Association
|
void |
startServer(String serverName)
Start the existing Server
|
void |
stop()
Stop the management.
|
void |
stopAssociation(String assocName)
Stop the existing Association
|
void |
stopServer(String serverName)
Stop the Server.
|
String getName()
Management instanceString getPersistDir()
void setPersistDir(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 Exception
Management is started. If Server and Association
were defined previously, Management should recreate those Server
and Association.Exceptionvoid stop()
throws Exception
Server and
Associtaion.Exceptionboolean isStarted()
void removeAllResourses()
throws Exception
ExceptionServer addServer(String serverName, String hostAddress, int port, IpChannelType ipChannelType, boolean acceptAnonymousConnections, int maxConcurrentConnectionsCount, String[] extraHostAddresses) throws 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 nullException - Exception if management not started or server name already
taken or some other server already has same ip:portServer addServer(String serverName, String hostAddress, int port, IpChannelType ipChannelType, String[] extraHostAddresses) throws 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 nullException - Exception if management not started or server name already
taken or some other server already has same ip:portServer addServer(String serverName, String hostAddress, int port) throws 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 toException - Exception if management not started or server name already
taken or some other server already has same ip:portvoid removeServer(String serverName) throws Exception
ServerserverName - Exception - Exception if no Server with the passed name exist or Server
is started. Before removing server, it should be stoppedvoid startServer(String serverName) throws Exception
serverName - name of the Server to be startedException - Exception if no Server found for given name or Server already
startedvoid stopServer(String serverName) throws Exception
serverName - name of the Server to be stoppedException - 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 ServerAssociation addServerAssociation(String peerAddress, int peerPort, String serverName, String assocName) throws 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 AssociationExceptionAssociation addServerAssociation(String peerAddress, int peerPort, String serverName, String assocName, IpChannelType ipChannelType) throws 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 TCPExceptionAssociation addAssociation(String hostAddress, int hostPort, String peerAddress, int peerPort, String assocName) throws Exception
hostAddress - hostPort - If hostPort==0 this mean the local port will be any vacant portpeerAddress - peerPort - assocName - ExceptionAssociation addAssociation(String hostAddress, int hostPort, String peerAddress, int peerPort, String assocName, IpChannelType ipChannelType, String[] extraHostAddresses) throws 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 nullExceptionvoid removeAssociation(String assocName) throws Exception
assocName - ExceptionAssociation getAssociation(String assocName) throws Exception
assocName - ExceptionMap<String,Association> getAssociations()
void startAssociation(String assocName) throws Exception
assocName - Exceptionvoid stopAssociation(String assocName) throws Exception
assocName - Exceptionint getConnectDelay()
Association dies due to
network failure or any other reason, it should attempt to reconnect after
connectDelay intervalvoid setConnectDelay(int connectDelay)
throws Exception
AssociationconnectDelay - Exceptionint getWorkerThreads()
AssociationListener
methods.void setWorkerThreads(int workerThreads)
throws Exception
AssociationListenerworkerThreads - Exceptionboolean isSingleThread()
void setSingleThread(boolean singleThread)
throws Exception
singleThread - Exceptionint getBufferSize()
Copyright © 2017. All Rights Reserved.