Interface IConnection
- All Known Implementing Classes:
NettyConnectionAdpater,NettyHttpConnection,NettyTcpConnection
public interface IConnection
The Interface IConnection abstracts any connection to a responder.
- Author:
- JTraber
-
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()Connect.voiddestroy()Destroys connection.voidDisconnect.Gets the context.getHost()Gets the host.intGets the nr of idles in sequence.intgetPort()Gets the port.voidIncrement nr of idles.booleanChecks if is connected.voidReset nr of idles.voidsend(SCMPMessage scmp, ISCMPMessageCallback callback) Send and receive asynchronous operation.voidsetContext(ConnectionContext connectionContext) Sets the context.voidSets the host.voidsetIdleTimeoutSeconds(int idleTimeoutSeconds) Sets the idle timeout.voidsetPort(int port) Sets the port.voidSets the quiet disconnect.
-
Method Details
-
getContext
ConnectionContext getContext()Gets the context.- Returns:
- the context
-
setContext
Sets the context.- Parameters:
connectionContext- the new context
-
setHost
Sets the host.- Parameters:
host- the host
-
getHost
String getHost()Gets the host.- Returns:
- the host
-
setPort
void setPort(int port) Sets the port.- Parameters:
port- the port
-
getPort
int getPort()Gets the port.- Returns:
- the port
-
connect
Connect.- Throws:
Exception- the exception
-
send
Send and receive asynchronous operation.- Parameters:
scmp- the scmpcallback- the callback- Throws:
Exception- the exception
-
disconnect
Disconnect.- Throws:
Exception- the exception
-
destroy
void destroy()Destroys connection. -
isConnected
boolean isConnected()Checks if is connected.- Returns:
- true, if is connected
-
setIdleTimeoutSeconds
void setIdleTimeoutSeconds(int idleTimeoutSeconds) Sets the idle timeout.- Parameters:
idleTimeoutSeconds- the new idle timeout
-
incrementNrOfIdles
void incrementNrOfIdles()Increment nr of idles. -
resetNrOfIdles
void resetNrOfIdles()Reset nr of idles. -
getNrOfIdlesInSequence
int getNrOfIdlesInSequence()Gets the nr of idles in sequence.- Returns:
- the nr of idles in sequence
-
setQuietDisconnect
Sets the quiet disconnect. Disconnect is not logged or does not reply any answer to higher layer.- Throws:
Exception- the exception
-