|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcontext.arch.comm.protocol.MulticastUDPSocket
context.arch.comm.protocol.HTTPMulticastUDPSocket
This object is able to connect to a multicast group and to send multicast messages
| Field Summary | |
static boolean |
DEBUG
Debug flag. |
static java.lang.String |
GET
HTTP GET request type |
static java.lang.String |
POST
HTTP POST request type |
static java.lang.String |
PROTOCOL
The protocol being used is HTTP |
| Fields inherited from interface context.arch.comm.protocol.MulticastConstants |
DEFAULT_MULTICAST_ADDRESS, DEFAULT_MULTICAST_PORT, TTL_CONTINENT, TTL_COUNTRY, TTL_COUNTY, TTL_LOCAL_NETWORK, TTL_SITE, TTL_TRANSMITTER, TTL_WORLDWIDE |
| Constructor Summary | |
HTTPMulticastUDPSocket(CommunicationsObject object)
Basic constructor for HTTPMulticastSocket that calls MulticastUDPSocket |
|
| Method Summary | |
java.lang.String |
addProtocol(java.lang.String data,
java.lang.String url)
This method adds the HTTP protocol for a POST request (POST is the default) |
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)
Stub method that handles incoming HTTP multicast packets. |
void |
quit()
Abstract method to call when stopping a CommunicationsServer object |
void |
sendMessage(java.lang.String message)
This abstract method sends a request |
RequestData |
stripProtocol(java.net.DatagramPacket packet)
This abstract method strips the protocol away from the received request |
| Methods inherited from class context.arch.comm.protocol.MulticastUDPSocket |
getMulticastGroup, getMulticastPort, getTTL, run, sendPacket, setTTL, start, stopServer |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface context.arch.comm.CommunicationsMulticast |
start |
| Field Detail |
public static boolean DEBUG
public static final java.lang.String PROTOCOL
public static final java.lang.String GET
public static final java.lang.String POST
| Constructor Detail |
public HTTPMulticastUDPSocket(CommunicationsObject object)
object - Handle of the generic instantiating communications objectMulticastUDPSocket| Method Detail |
public void handleIncomingRequest(java.net.DatagramPacket packet)
handleIncomingRequest in interface CommunicationsMulticasthandleIncomingRequest in class MulticastUDPSocketpacket - DatagramPacket to receive HTTP data inCommunicationsObject.handleIncomingRequest(java.net.DatagramPacket)public void quit()
quit in interface CommunicationsMulticastpublic java.lang.String getProtocol()
getProtocol in interface CommunicationsMulticast
public RequestData stripProtocol(java.net.DatagramPacket packet)
throws ProtocolException
stripProtocol in interface CommunicationsMulticastpacket - The datagram packet the message is being received in
ProtocolException - thrown if protocol can't be stripped away#addReplyProtocol(String),
CommunicationsClient#addRequestProtocol(String,String),
CommunicationsClient#stripReplyProtocol(java.net.Socket)
public java.lang.String addProtocol(java.lang.String data,
java.lang.String url)
throws ProtocolException
ProtocolException
public java.lang.String addProtocol(java.lang.String data,
java.lang.String url,
java.lang.String type)
throws ProtocolException
addProtocol in interface CommunicationsMulticastdata - The request to add the protocol to
ProtocolException - thrown if protocol can't be added#stripReplyProtocol(Socket),
CommunicationsServer.stripRequestProtocol(Socket),
CommunicationsServer.addReplyProtocol(String)public void sendMessage(java.lang.String message)
sendMessage in interface CommunicationsMulticastmessage - The message to send
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||