|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ProtocolSession
The ProtocolSession interface should be implemented by a class that implement the send/reception part of the Multi-master replication protocol. This interface is designed to make easy the move from one format of the ReplicationMessage on the wire to another format.
Method Summary | |
---|---|
void |
close()
This method is called when the session with the remote must be closed. |
long |
getLastPublishTime()
Gets the time the last replication message was published on this session. |
long |
getLastReceiveTime()
Gets the time the last replication message was received on this session. |
java.lang.String |
getRemoteAddress()
Retrieve the IP address of the remote server. |
boolean |
isEncrypted()
Determine whether the session is using a security layer. |
void |
publish(ReplicationMessage msg)
This method is called when a ReplicationMessage must be sent to the remote entity. |
ReplicationMessage |
receive()
Attempt to receive a ReplicationMessage. |
void |
setSoTimeout(int timeout)
Set a timeout value. |
void |
stopEncryption()
Stop using the security layer, if there is any. |
Method Detail |
---|
void close() throws java.io.IOException
java.io.IOException
- If an error happen during the close process.void publish(ReplicationMessage msg) throws java.io.IOException
msg
- The ReplicationMessage that must be sent.
java.io.IOException
- If an IO error happen during the publish process.ReplicationMessage receive() throws java.io.IOException, java.lang.ClassNotFoundException, java.util.zip.DataFormatException
java.io.IOException
- When error happened durin IO process.
java.lang.ClassNotFoundException
- When the data received does extend the
ReplicationMessage class.
java.util.zip.DataFormatException
- When the data received is not formatted as a
ReplicationMessage.void stopEncryption()
boolean isEncrypted()
java.lang.String getRemoteAddress()
void setSoTimeout(int timeout) throws java.net.SocketException
timeout
- the specified timeout, in milliseconds.
java.net.SocketException
- if there is an error in the underlying protocol,
such as a TCP error.long getLastPublishTime()
long getLastReceiveTime()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |