public class Request extends Object implements Message
Requests are meant for controlling the agent, not for asking an agent nor sending an agent any sort of data.
The following implementation details of this class are subject to change at any time.
Request objects are serialized over the command channel in the following format: ------------------------- | A | TYPE | B | PARAMS | ------------------------- A is an 32 bit integer representing the length - in bytes - of TYPE. TYPE is a byte array representing the string of the request type (e.g. "RESPONSE_EXPECTED") B is a 32 bit integer representing the number of request parameters which follow. PARAMS (if B > 0) is a variable length stream of the following format: It is a simple encoding of name => value pairs. ----------------------------------------------------------------------------------------------- | I_1 | K_1 | P_1 | V_1 | ... | I_(n-1) | K_(n-1) | P_(n-1) | V_(n-1) | I_n | K_n | P_n | V_n | ----------------------------------------------------------------------------------------------- I_n A 32 bit integer representing the length - in bytes - of the n'th parameter name. K_n A 32 bit integer representing the length - in bytes - of the n'th parameter value. P_n A byte array representing the string of the n'th parameter name. V_n A byte array representing the string of the n'th parameter value.
Modifier and Type | Class and Description |
---|---|
static class |
Request.RequestType |
Message.MessageType
Modifier and Type | Field and Description |
---|---|
static String |
AUTH_TOKEN |
static String |
CLIENT_TOKEN |
static String |
UNKNOWN_HOSTNAME |
Constructor and Description |
---|
Request(Request.RequestType type,
InetSocketAddress target) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(RequestResponseListener listener) |
Collection<RequestResponseListener> |
getListeners() |
String |
getParameter(String name) |
Collection<String> |
getParameterNames() |
String |
getReceiver() |
InetSocketAddress |
getTarget() |
Message.MessageType |
getType() |
void |
removeListener(RequestResponseListener listener) |
void |
setParameter(String name,
String value) |
void |
setReceiver(String clazz) |
String |
toString() |
public static final String UNKNOWN_HOSTNAME
public static final String CLIENT_TOKEN
public static final String AUTH_TOKEN
public Request(Request.RequestType type, InetSocketAddress target)
public Message.MessageType getType()
public Collection<String> getParameterNames()
public void setReceiver(String clazz)
public String getReceiver()
public InetSocketAddress getTarget()
public void addListener(RequestResponseListener listener)
public void removeListener(RequestResponseListener listener)
public Collection<RequestResponseListener> getListeners()
Copyright © 2013. All rights reserved.