context.arch.comm
Interface CommunicationsMulticast

All Known Implementing Classes:
HTTPMulticastUDPSocket

public interface CommunicationsMulticast

This interface specifies all the methods a CommunicationsMulticast object must support allowing the details of the specific protocol used to be abstracted away.

See Also:
CommunicationsObject

Method Summary
 java.lang.String addProtocol(java.lang.String data, java.lang.String url, java.lang.String type)
          This abstract method adds the protocol to a request to be sent
 java.lang.String getProtocol()
          Abstract method to get the communications protocol being used
 void handleIncomingRequest(java.net.DatagramPacket packet)
          This abstract method handles incoming datagram packet
 void quit()
          Abstract method to call when stopping a CommunicationsServer object
 void sendMessage(java.lang.String message)
          This abstract method sends a message
 void start()
          Abstract method to call when starting a CommunicationsServer object
 RequestData stripProtocol(java.net.DatagramPacket packet)
          This abstract method strips the protocol away from the received request
 

Method Detail

start

public void start()
Abstract method to call when starting a CommunicationsServer object


quit

public void quit()
Abstract method to call when stopping a CommunicationsServer object


getProtocol

public java.lang.String getProtocol()
Abstract method to get the communications protocol being used

Returns:
the protocol being used

stripProtocol

public RequestData stripProtocol(java.net.DatagramPacket packet)
                          throws ProtocolException
This abstract method strips the protocol away from the received request

Parameters:
packet - The datagram packet the message is being received in
Returns:
the message with the protocol stripped away
Throws:
ProtocolException - thrown if protocol can't be stripped away
See Also:
#addProtocol(String)

addProtocol

public java.lang.String addProtocol(java.lang.String data,
                                    java.lang.String url,
                                    java.lang.String type)
                             throws ProtocolException
This abstract method adds the protocol to a request to be sent

Parameters:
data - The request to add the protocol to
Returns:
the request with the protocol added
Throws:
ProtocolException - thrown if protocol can't be added
See Also:
stripProtocol(DatagramPacket)

handleIncomingRequest

public void handleIncomingRequest(java.net.DatagramPacket packet)
This abstract method handles incoming datagram packet

Parameters:
packet - The datagram packet containing the message

sendMessage

public void sendMessage(java.lang.String message)
This abstract method sends a message

Parameters:
message - The message to send
Returns:
the packet to send