com.norbl.cbp.ppe.usermonitor
Class MonitorMessage
java.lang.Object
com.norbl.cbp.ppe.usermonitor.MonitorMessage
public class MonitorMessage
- extends java.lang.Object
We communicate with the Monitor
by sending it http POSTs.
It does not send anything back.
This class holds a message. It has methods to create and send
the message as a post and to parse a POST received by the server.
A message consists of a type and one or more parameter (name,value) pairs.
Method Summary |
void |
addVal(java.lang.String name,
java.lang.String val)
If name exists, it's val is replaced. |
java.lang.String |
getVal(java.lang.String name)
|
static MonitorMessage |
parseURI(java.lang.String uri)
|
org.apache.http.entity.StringEntity |
toStringEntity()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MonitorMessage
public MonitorMessage(MonitorMessage.MessageType type)
parseURI
public static MonitorMessage parseURI(java.lang.String uri)
addVal
public void addVal(java.lang.String name,
java.lang.String val)
- If name exists, it's val is replaced.
- Parameters:
name
- val
-
getVal
public java.lang.String getVal(java.lang.String name)
toStringEntity
public org.apache.http.entity.StringEntity toStringEntity()
throws java.io.UnsupportedEncodingException
- Throws:
java.io.UnsupportedEncodingException