|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.softamis.net.exchange.support.AbstractCommunicationProtocol<byte[],K,V,java.lang.String>
org.softamis.net.exchange.udp.UDPCommunicationProtocol<K,V>
K - type of keys used to identify registry itemsV - type of values stored in the registrypublic class UDPCommunicationProtocol<K extends java.io.Serializable,V extends java.io.Serializable>
Default implementation of CommunicationProtocol if
multicasting UDP is used as underlying network transport protocol.
RegistryEventProcessor| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_DATAGRAM_SIGNATURE
Default signature for notifications that are sent as part of network protocol. |
protected static org.apache.commons.logging.Log |
fLog
|
protected java.lang.String |
fOwnID
ID used to identify source of datagaram packets that are sent. |
| Fields inherited from class org.softamis.net.exchange.support.AbstractCommunicationProtocol |
|---|
DEFAULT_COMPRESSION_MODE, fDatagramSignature, fUseCompression, MSG_EXCEPTION_CLOSING_STREAM |
| Constructor Summary | |
|---|---|
UDPCommunicationProtocol()
|
|
| Method Summary | |
|---|---|
protected MessageContent<K,V,java.lang.String> |
createMessageContent(byte aType,
java.lang.String aTo,
ItemEntry<K,V> aEntry)
Creates MessageContent which will be converted into form used by underlying network
communication based on provided parameters. |
protected byte[] |
doCreateDataToSend(MessageContent<K,V,java.lang.String> aContent)
Converts given MessageContent to form used by underlying network communication |
static boolean |
equals(java.lang.String aFirst,
java.lang.String aSecond)
|
protected java.lang.String |
generateOwnID()
Generates ID that is used to determine destination of the message. |
protected MessageContent<K,V,java.lang.String> |
getDatagramFromReceivedData(byte[] aReceivedData)
Constructs MessageContent from underlying network data. |
protected byte[] |
getLocalAddress()
Utility method that allows to obtain local address. |
protected boolean |
isNotOwnDatagaram(MessageContent<K,V,java.lang.String> aDatagram)
Determines whether notification was obtained from external source and is not result of own notification |
| Methods inherited from class org.softamis.net.exchange.support.AbstractCommunicationProtocol |
|---|
closeStream, closeStream, createDataToSend, createMessageContentToRead, fillEntryByMessageContent, fillItemEntry, getDatagram, getDatagramSignature, getDataToSend, isUseCompression, setDatagramSignature, setUseCompression |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.commons.logging.Log fLog
protected java.lang.String fOwnID
isNotOwnDatagaram(org.softamis.net.exchange.support.MessageContent) public static final java.lang.String DEFAULT_DATAGRAM_SIGNATURE
| Constructor Detail |
|---|
public UDPCommunicationProtocol()
| Method Detail |
|---|
protected boolean isNotOwnDatagaram(MessageContent<K,V,java.lang.String> aDatagram)
isNotOwnDatagaram in class AbstractCommunicationProtocol<byte[],K extends java.io.Serializable,V extends java.io.Serializable,java.lang.String>aDatagram - data to receive
public static boolean equals(java.lang.String aFirst,
java.lang.String aSecond)
protected MessageContent<K,V,java.lang.String> getDatagramFromReceivedData(byte[] aReceivedData)
MessageContent from underlying network data.
getDatagramFromReceivedData in class AbstractCommunicationProtocol<byte[],K extends java.io.Serializable,V extends java.io.Serializable,java.lang.String>aReceivedData - raw data obtained in network notification
protected MessageContent<K,V,java.lang.String> createMessageContent(byte aType,
java.lang.String aTo,
ItemEntry<K,V> aEntry)
MessageContent which will be converted into form used by underlying network
communication based on provided parameters.
createMessageContent in class AbstractCommunicationProtocol<byte[],K extends java.io.Serializable,V extends java.io.Serializable,java.lang.String>aType - type of notificationaTo - destination of notificationaEntry - Item data
protected byte[] doCreateDataToSend(MessageContent<K,V,java.lang.String> aContent)
MessageContent to form used by underlying network communication
doCreateDataToSend in class AbstractCommunicationProtocol<byte[],K extends java.io.Serializable,V extends java.io.Serializable,java.lang.String>aContent - given message content
CommunicationHelperprotected byte[] getLocalAddress()
generateOwnID()protected java.lang.String generateOwnID()
getLocalAddress(),
fOwnID,
isNotOwnDatagaram(org.softamis.net.exchange.support.MessageContent)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||