|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.aselect.system.communication.server.raw.RawMessageCreator
public class RawMessageCreator
Message creator which uses CGI messages.
Description:
The RAW implementation of IMessageCreatorInterface
.
Processes and sends CGI URL encoded API calls.
Concurrency issues:
-
Constructor Summary | |
---|---|
RawMessageCreator(SystemLogger systemLogger)
Creates a new instance. |
Method Summary | |
---|---|
java.util.Hashtable |
convertCGIMessage(java.lang.String sMessage)
Convert a CGI string. |
java.lang.String[] |
getArray(java.lang.String sName)
get an array parameter from a CGI query string message. |
java.lang.String |
getParam(java.lang.String sName)
get a parameter from a CGI query string message. |
boolean |
init(IProtocolRequest oRequest,
IProtocolResponse oResponse)
Initializes the RawMessageCreator. |
boolean |
send()
Send the repsonse as a CGI URL encoded query string. |
boolean |
setParam(java.lang.String sName,
java.lang.String sValue)
set a parameter as a CGI query string message. |
boolean |
setParam(java.lang.String sName,
java.lang.String[] saValue)
set an array parameter as a CGI query string message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RawMessageCreator(SystemLogger systemLogger)
RawMessageCreator
. Sets the logger.
RawMessageCreator
should be created.
systemLogger
should be initialized.
systemLogger
- The logger that should be
used for system log entries.Method Detail |
---|
public boolean init(IProtocolRequest oRequest, IProtocolResponse oResponse) throws ASelectCommunicationException
RawMessageCreator
:
oRequest
should contain a valid request.oResponse
should contain a valid response.
init
in interface IMessageCreatorInterface
oRequest
- The request to create an input message from.oResponse
- The response to write the output message to.
ASelectCommunicationException
- if communication fails.IMessageCreatorInterface.init(org.aselect.system.communication.server.IProtocolRequest, org.aselect.system.communication.server.IProtocolResponse)
public java.lang.String getParam(java.lang.String sName) throws ASelectCommunicationException
getParam
in interface IInputMessage
sName
- The name of the parameter to return.
ASelectCommunicationException
- If parameter retrieving fails.IInputMessage.getParam(java.lang.String)
public java.lang.String[] getArray(java.lang.String sName) throws ASelectCommunicationException
getArray
in interface IInputMessage
sName
- The name of the parameter to return.
ASelectCommunicationException
- If parameter retrieving fails.IInputMessage.getArray(java.lang.String)
public boolean setParam(java.lang.String sName, java.lang.String sValue) throws ASelectCommunicationException
setParam
in interface IOutputMessage
sName
- The name of the parametersValue
- The value of the parameter
ASelectCommunicationException
- If communication fails.IOutputMessage.setParam(java.lang.String, java.lang.String)
public boolean setParam(java.lang.String sName, java.lang.String[] saValue) throws ASelectCommunicationException
setParam
in interface IOutputMessage
sName
- The name of the parametersaValue
- The values of the parameter
ASelectCommunicationException
- If communication fails.IOutputMessage.setParam(java.lang.String, java.lang.String[])
public java.util.Hashtable convertCGIMessage(java.lang.String sMessage) throws ASelectCommunicationException
key=value&key=value
etc. tuples (aka a CGI request string) into a hashtable for much easier
processing. This method supports CGI array parameters.
Hashtable
is threadsafe.
sMessage
should be a valid request string.
sMessage
- A CGI request string.
Hashtable
.
ASelectCommunicationException
- if decoding of value fails or internal error occurs.public boolean send() throws ASelectCommunicationException
send
in interface IOutputMessage
ASelectCommunicationException
- If communication fails.IOutputMessage.send()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |