com.cometway.ak
Class AgentRequest

java.lang.Object
  extended by com.cometway.props.Props
      extended by com.cometway.ak.AgentMessage
          extended by com.cometway.ak.AgentRequest
Direct Known Subclasses:
HTTPAgentRequest

public class AgentRequest
extends AgentMessage

Represents a concrete data class used to pass information to and from agents that implement the RequestAgentInterface.


Field Summary
protected  java.io.OutputStream err
           
protected  java.io.OutputStream out
           
protected  java.io.PrintWriter writer
           
 
Fields inherited from class com.cometway.ak.AgentMessage
props
 
Constructor Summary
AgentRequest()
          Creates a request instance using its own Props.
AgentRequest(Props props)
          Creates a request instance referencing the specified Props.
AgentRequest(Props props, java.io.OutputStream out)
          Creates a request instance referencing the specified Props and standard OutputStream.
AgentRequest(Props props, java.io.OutputStream out, java.io.OutputStream err)
          Creates a request instance referencing the specified Props, standard OutputStream, and error OutputStream.
 
Method Summary
 java.io.OutputStream getErrorStream()
          Returns a reference to the error OutputStream.
 java.io.OutputStream getOutputStream()
          Returns a reference to the standard OutputStream.
 java.lang.String getRequestType()
          Returns the type assigned to this request by its sender.
 java.io.Writer getWriter()
          Returns a reference to the Writer assigned to this request.
 boolean isRequestType(java.lang.String request_type)
          Returns true if this request's type matches the specified type; false otherwise.
 void print(java.lang.String s)
          Prints the String to the agent's standard OutputStream using a PrintWriter.
 void println()
          Prints a newline to the agent's standard OutputStream using a PrintWriter.
 void println(java.lang.String s)
          Prints the String followed by a newline to the agent's standard OutputStream using a PrintWriter.
 void setContentType(java.lang.String type)
          Specifies the content type for output to the standard OutputStream.
 
Methods inherited from class com.cometway.ak.AgentMessage
getProps
 
Methods inherited from class com.cometway.props.Props
addListener, append, copy, copyFrom, copyTo, decrementInteger, dump, enableListeners, enumerateKeys, format, getBoolean, getByteArray, getCharacter, getDate, getDate, getDateString, getDouble, getFloat, getHexString, getInteger, getKeys, getLong, getNextKey, getProperty, getProperty, getPropsContainer, getSize, getString, getString, getTokens, getTokens, getTrimmedString, getVector, hasProperty, incrementInteger, insertProps, loadProps, notifyPropsChanged, notifyPropsChangedIgnore, notifyPropsChangedIgnore, parse, propertyMatchesRegEx, readFromFile, regExPropertyMatches, removeAll, removeListener, removeProperty, resumeNotify, saveProps, set, setBoolean, setCharacter, setDefault, setDouble, setFloat, setInteger, setLong, setProperty, setProperty, setProperty, setPropsContainer, suspendNotify, toString, writeToFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

out

protected java.io.OutputStream out

err

protected java.io.OutputStream err

writer

protected java.io.PrintWriter writer
Constructor Detail

AgentRequest

public AgentRequest()
Creates a request instance using its own Props.


AgentRequest

public AgentRequest(Props props)
Creates a request instance referencing the specified Props.


AgentRequest

public AgentRequest(Props props,
                    java.io.OutputStream out)
Creates a request instance referencing the specified Props and standard OutputStream.


AgentRequest

public AgentRequest(Props props,
                    java.io.OutputStream out,
                    java.io.OutputStream err)
Creates a request instance referencing the specified Props, standard OutputStream, and error OutputStream.

Method Detail

getErrorStream

public java.io.OutputStream getErrorStream()
Returns a reference to the error OutputStream.


getOutputStream

public java.io.OutputStream getOutputStream()
Returns a reference to the standard OutputStream.


getRequestType

public java.lang.String getRequestType()
Returns the type assigned to this request by its sender.


getWriter

public java.io.Writer getWriter()
Returns a reference to the Writer assigned to this request.


isRequestType

public boolean isRequestType(java.lang.String request_type)
Returns true if this request's type matches the specified type; false otherwise.


print

public void print(java.lang.String s)
Prints the String to the agent's standard OutputStream using a PrintWriter.


println

public void println()
Prints a newline to the agent's standard OutputStream using a PrintWriter.


println

public void println(java.lang.String s)
Prints the String followed by a newline to the agent's standard OutputStream using a PrintWriter.


setContentType

public void setContentType(java.lang.String type)
Specifies the content type for output to the standard OutputStream.