org.softamis.net.exchange
Interface CommunicationProtocol<D extends java.io.Serializable,K extends java.io.Serializable,V extends java.io.Serializable>

Type Parameters:
D - type of low level data that are sent via network
K - type of keys used to identify registry items
V - type of values stored in the registry
All Known Implementing Classes:
AbstractCommunicationProtocol, JGCommunicationProtocol, UDPCommunicationProtocol

public interface CommunicationProtocol<D extends java.io.Serializable,K extends java.io.Serializable,V extends java.io.Serializable>

Interface defines generic facade for transformation data from/to form used during low level network communications.

Author:
Andrew Sazonov

Method Summary
 D createDataToSend(byte aType, java.lang.String aTo, ItemEntry<K,V> aEntry)
          Converts information stored in ItemEntry into low level data which could be sent in network communication.
 byte fillItemEntry(D aData, ItemEntry<K,V> aEntry)
          Extracts low level data obtained from network notification and wraps them into provided ItemEntry.
 

Method Detail

fillItemEntry

byte fillItemEntry(D aData,
                   ItemEntry<K,V> aEntry)
Extracts low level data obtained from network notification and wraps them into provided ItemEntry.

Parameters:
aData - low level data received with external notification
aEntry - entry that will be filled based on received data
Returns:
type of command received with data.
See Also:
CommunicationHelper

createDataToSend

D createDataToSend(byte aType,
                   java.lang.String aTo,
                   ItemEntry<K,V> aEntry)
Converts information stored in ItemEntry into low level data which could be sent in network communication.

Parameters:
aType - type of notification
aTo -
aEntry - entry to be converted
Returns:
low level data that are ready to be sent via network notification