|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.net.SecureConnection
public class SecureConnection
SecureConnection is a small wrapper for NetConnection objects, which provides automatic encoding/decoding of messages. objects as Encoded objects.
Encoded,
NetConnection| Constructor Summary | |
|---|---|
SecureConnection(NetConnection con,
SynchronousKey key)
|
|
| Method Summary | |
|---|---|
void |
close()
|
NetConnection |
getEmbeddedConnection()
|
Handshake |
getHandshake()
returns the identification type object for this connection; this signature is the same on both sides of the connection. |
SynchronousKey |
getKey()
|
Socket |
getSocket()
returns the underlying Socket of this connection |
boolean |
isActive()
returns whether this NetConnection is currently active |
Object |
readMessage()
extracts the encoded object from the Encoded object received |
void |
sendMessage(Object message)
every message will be encoded before it is sent unless it is already an Encoded object |
void |
setKey(SynchronousKey key)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SecureConnection(NetConnection con,
SynchronousKey key)
| Method Detail |
|---|
public SynchronousKey getKey()
public void setKey(SynchronousKey key)
public NetConnection getEmbeddedConnection()
public void close()
throws IOException
close in interface CloseableIOExceptionpublic Handshake getHandshake()
NetConnection
getHandshake in interface NetConnectionpublic Socket getSocket()
NetConnection
getSocket in interface NetConnectionpublic boolean isActive()
NetConnection
isActive in interface NetConnection
public Object readMessage()
throws IOException,
ClassNotFoundException
readMessage in interface NetConnectionIOException - also if the key is incorrect when an Encoded
message was received
ClassNotFoundException
public void sendMessage(Object message)
throws IOException
sendMessage in interface NetConnectionIOException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||