public class SCTPServerConnection extends Object implements IConnection
Modifier | Constructor and Description |
---|---|
|
SCTPServerConnection(Configuration config,
InetAddress localAddress,
int localPort,
IMessageParser parser,
String ref,
NetworkGuard guard) |
|
SCTPServerConnection(Configuration config,
InetAddress remoteAddress,
int remotePort,
InetAddress localAddress,
int localPort,
IMessageParser parser,
String ref,
NetworkGuard guard,
org.mobicents.protocols.api.Server globalServer,
org.mobicents.protocols.api.Association association,
org.mobicents.protocols.api.Management management) |
protected |
SCTPServerConnection(IMessageParser parser,
NetworkGuard guard) |
Modifier and Type | Method and Description |
---|---|
void |
addConnectionListener(IConnectionListener listener)
Append connection listener
|
void |
connect()
Connect with remote host
|
void |
destroy() |
void |
disconnect()
Disconnect wit remote host
|
long |
getCreatedTime()
Return created time
|
String |
getKey()
Return identifier of connection.
|
org.mobicents.protocols.api.Management |
getManagement() |
NetworkGuard |
getParentGuard() |
InetAddress |
getRemoteAddress()
Return remote host address
|
int |
getRemotePort()
Return remote socket port
|
protected SCTPTransportServer |
getServer() |
boolean |
isConnected()
Return true if is connection is valid
|
boolean |
isNetworkInitiated()
Return true if connection is incomming
|
boolean |
isWrapperFor(Class<?> aClass) |
protected void |
logDetails() |
protected void |
onAvpDataException(AvpDataException e) |
protected void |
onConnected() |
protected void |
onDisconnect() |
protected void |
onEvent(org.jdiameter.server.impl.io.sctp.SCTPServerConnection.Event event) |
protected void |
onMessageReceived(ByteBuffer message) |
void |
onNewRemoteConnection(org.mobicents.protocols.api.Server server,
org.mobicents.protocols.api.Association association) |
void |
release()
Clear all attachec resources (close socket)
|
void |
remAllConnectionListener()
Remove all connection listeners
|
void |
remConnectionListener(IConnectionListener listener)
Remove connection listener
|
void |
sendMessage(IMessage message)
Send message to remote host
|
<T> T |
unwrap(Class<T> aClass) |
protected SCTPServerConnection(IMessageParser parser, NetworkGuard guard)
public SCTPServerConnection(Configuration config, InetAddress localAddress, int localPort, IMessageParser parser, String ref, NetworkGuard guard) throws Exception
Exception
public SCTPServerConnection(Configuration config, InetAddress remoteAddress, int remotePort, InetAddress localAddress, int localPort, IMessageParser parser, String ref, NetworkGuard guard, org.mobicents.protocols.api.Server globalServer, org.mobicents.protocols.api.Association association, org.mobicents.protocols.api.Management management) throws Exception
Exception
public long getCreatedTime()
IConnection
getCreatedTime
in interface IConnection
public void connect() throws TransportException
IConnection
connect
in interface IConnection
TransportException
public void disconnect() throws InternalError
IConnection
disconnect
in interface IConnection
InternalError
public org.mobicents.protocols.api.Management getManagement()
public void destroy() throws InternalError
InternalError
public void release() throws IOException
IConnection
release
in interface IConnection
IOException
public void onNewRemoteConnection(org.mobicents.protocols.api.Server server, org.mobicents.protocols.api.Association association)
public NetworkGuard getParentGuard()
public void sendMessage(IMessage message) throws TransportException, OverloadException
IConnection
sendMessage
in interface IConnection
message
- diameter messageTransportException
OverloadException
protected SCTPTransportServer getServer()
public boolean isNetworkInitiated()
IConnection
isNetworkInitiated
in interface IConnection
public boolean isConnected()
IConnection
isConnected
in interface IConnection
public InetAddress getRemoteAddress()
IConnection
getRemoteAddress
in interface IConnection
public int getRemotePort()
IConnection
getRemotePort
in interface IConnection
public void addConnectionListener(IConnectionListener listener)
IConnection
addConnectionListener
in interface IConnection
listener
- listener instancepublic void remAllConnectionListener()
IConnection
remAllConnectionListener
in interface IConnection
public void remConnectionListener(IConnectionListener listener)
IConnection
remConnectionListener
in interface IConnection
listener
- listener instancepublic boolean isWrapperFor(Class<?> aClass) throws InternalException
isWrapperFor
in interface Wrapper
InternalException
public <T> T unwrap(Class<T> aClass) throws InternalException
unwrap
in interface Wrapper
InternalException
public String getKey()
IConnection
getKey
in interface IConnection
protected void onDisconnect() throws AvpDataException
AvpDataException
protected void onMessageReceived(ByteBuffer message) throws AvpDataException
AvpDataException
protected void onAvpDataException(AvpDataException e)
protected void onConnected()
protected void logDetails() throws AvpDataException
AvpDataException
protected void onEvent(org.jdiameter.server.impl.io.sctp.SCTPServerConnection.Event event) throws AvpDataException
AvpDataException
Copyright © 2016. All Rights Reserved.