com.infoengine.ebai
Class RequestContext

java.lang.Object
  extended bycom.infoengine.ebai.RequestContext

public class RequestContext
extends Object

Description...

 Examples...
 


Field Summary
static Hashtable ebaiGlobalHashtable
           
(package private) static String ID
           
private  com.infoengine.log.LogWriter logWriter
           
private  Request myRequest
           
private  Task myTask
           
private  Webject myWebject
           
private  IeMultipartOutputStream output
           
private  Task resultTask
           
protected  StringBuffer scratch
           
private  String serviceName
           
private  String webjectPath
           
 
Constructor Summary
RequestContext(Request request, String servName, com.infoengine.log.LogWriter log)
          Construct the RequestContext.
 
Method Summary
 void addInputGroup(Group grp)
          Add an input group to this task.
 void addMetaValue(String name, String value)
          Adds the specified meta name and value to this webject.
 void addOutputGroup(Group grp)
          Add an output group to this task.
 void addOutputString(String str)
          Add an output string to this task.
protected  void addParam(Param param)
          Receive a parameter and add the parameter to this webject.
 void addWebjectOutput(String str)
          Adds an output message to this webject.
 void clearAllGlobalObjects()
           
protected  void clearParams()
          Remove all parameters from this webject.
 Enumeration getAllGlobalObjects()
           
 String getClassName()
          Return a class name from a webject.
 Object getGlobalObject(String name)
           
 Enumeration getGlobalObjectKeys()
           
 Group getGroupIn()
          Get the default input group for this task.
 Group getGroupIn(String name)
          Get a named input group for this task.
 String getGroupInName()
          Return a group in name from a webject.
 Enumeration getGroupInNames()
          Return a list of group in names from a webject.
 Group getGroupOut()
          Get the output group from this task.
 Group getGroupOut(String name)
          Get a named output group from this task.
 String getGroupOutName()
          Return a group out name from a webject.
 Enumeration getGroupOutNames()
          Return a list of group out names from a webject.
 Group getInputGroup(String name)
          Get an input group from this task.
 Enumeration getInputGroups()
          Get a list of all input groups for this task.
 com.infoengine.log.LogWriter getLogWriter()
          Get this logwriter's name.
 Enumeration getMessages()
          Get the error messages attached to this task.
 String getMetaValue(String name)
          Gets the specified meta value from this webject.
 Group getOutputGroup(String name)
          Get a named output group from this task.
 Enumeration getOutputGroups()
          Get an Enumerated list of output groups from this task.
protected  Param getParam(String name)
          Get a named parameter for this webject.
 Enumeration getParamNames()
          Gets a unique list of names of all the parameters that are defined for this webject.
protected  Enumeration getParams(String name)
          Get all the parameters for this webject that have a specified name.
 String getParamValue(String name)
          Get the value of a named parameter for this webject.
 String getParamValue(String name, String defaulty)
          Return the value of a named parameter for this webject.
 Enumeration getParamValues(String name)
          Return all values of a named parameter for this webject.
 String getPassword()
          Return a webject's password.
 Properties getProperties()
          Get a list of Properties that you passed or set to the adapter.
 String getProperty(String serviceName, String key)
          Searches for the property for the specified service name and key in the property list.
 String getProperty(String serviceName, String key, String defValue)
          Searches for the property for the specified service name and key in the property list.
 Request getRequest()
          Return the constructed request.
 IeRequest getResponse()
           
 Task getResultTask()
           
 String getServiceName()
          Return the service name.
 int getStatus()
          Get the status of this task
 Task getTask()
          Get the current task.
 String getUserName()
          Return a webject's user name.
 Webject getWebject()
          Get the current webject.
 String getWebjectName()
          Return a webject's name.
 Enumeration getWebjectOutput()
          Gets any output generated by this webject.
 String getWebjectPath()
          If a webject path exists, it is returned.
 boolean isLogVerbose()
          Check if the log file exists.
 void logWrite(Object X)
          Write to the log file.
protected  void logWrite(String message, Object[] obj)
           
 void logWrite(Throwable X)
          Write an exception to the log file.
 void print(Object X)
          Write the parameter to the PrintWriter stream.
 void readBlobStream(OutputStream fos)
          Put the file or binary data into the output stream.
 Vector readGroupIn()
          Read the metadata from group-in into the vector structure.
 Vector readGroupIn(String GroupInName)
          Read the metadata from group-in into the vector structure.
 Object removeGlobalObject(String name)
           
 void removeInputGroup(Group grp)
          Remove an input group from this task.
 void removeInputGroups()
          Remove all input groups from this task.
protected  void removeParam(Param param)
          Remove a parameter from this webject.
 void removeParams(String name)
          Remove all parameters from this webject that have the specified name.
 void setClassName(String cls)
          Receive a string and set a class name with a webject.
 void setGlobalObject(String name, Object obj)
           
 void setGlobalObject(String name, Object obj, boolean override)
           
protected  void setMessage(String message, Object[] obj, int status)
           
protected  void setParam(Param param)
          Set a new parameter to this webject.
 void setPassword(String pwd)
          Receive a string and set the webject's password.
 void setProperties(Properties propers)
          This method does nothing but is provided for compatibility with IE 4.0
protected  void setRequest(Request rqt)
          Initialize the main wrapper variables.
 void setResultTask(Task tsk)
           
 void setServiceName(String svName)
          Initialize the service name.
 void setTask(Task tsk)
          Receive a task and get the webject name.
 void setUserName(String uid)
          Receive a string and set the webject's user ID.
 void setWebject(Webject webj)
          Receive a webject and initialize the webject instance.
 void setWebjectName(String name)
          Receive a string and set the webject's name.
 void setWebjectPath(String path)
          Receive a path and set the webject path.
 boolean webjectNameMatch(String webType)
          Check to see if the current webject's name equals the one passed in.
 void writeBlobStream(InputStream fis, String filename, String contentType)
          Stream the binary file back to your browser through the output stream.
 void writeGroupOut(Hashtable htab)
          Write the metadata from the hash table structure into the group out.
 void writeGroupOut(Hashtable htab, String GroupOutName)
          Write the metadata from the hash table structure into the named group out.
 void writeGroupOut(Vector nodeVec)
          Write the metadata from the vector structure into the group out.
 void writeGroupOut(Vector nodeVec, String GroupOutName)
          Write the metadata from the vector structure into the named group out.
 void writeGroupOut2(Vector nodeVec)
          Write the metadata from the vector structure into the group out.
 void writeGroupOut2(Vector nodeVec, String GroupOutName)
          Write the metadata from the vector structure into the group out.
 void writeStatus(String status)
          write some status
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

static final String ID
See Also:
Constant Field Values

serviceName

private String serviceName

output

private IeMultipartOutputStream output

logWriter

private com.infoengine.log.LogWriter logWriter

webjectPath

private String webjectPath

myRequest

private Request myRequest

myWebject

private Webject myWebject

myTask

private Task myTask

resultTask

private Task resultTask

ebaiGlobalHashtable

public static Hashtable ebaiGlobalHashtable

scratch

protected StringBuffer scratch
Constructor Detail

RequestContext

public RequestContext(Request request,
                      String servName,
                      com.infoengine.log.LogWriter log)
Construct the RequestContext.

Method Detail

setRequest

protected void setRequest(Request rqt)
Initialize the main wrapper variables.


getRequest

public Request getRequest()
Return the constructed request.

Returns:
The constructed request.

getLogWriter

public com.infoengine.log.LogWriter getLogWriter()
Get this logwriter's name.

Returns:
The logwriter's current name.

logWrite

public void logWrite(Object X)
Write to the log file.

Parameters:
X - The parameter to be sent to the log

logWrite

protected void logWrite(String message,
                        Object[] obj)

logWrite

public void logWrite(Throwable X)
Write an exception to the log file.

Parameters:
X - The parameter/exception to be sent to the log

print

public void print(Object X)
Write the parameter to the PrintWriter stream.

Parameters:
X - The parameter to be sent to the PrintWriter

isLogVerbose

public boolean isLogVerbose()
Check if the log file exists.

Returns:
The logwriter's existence.

setTask

public void setTask(Task tsk)
Receive a task and get the webject name.

Parameters:
tsk - The parameter containing the task and webject information.

getTask

public Task getTask()
Get the current task.

Returns:
The current task.

setResultTask

public void setResultTask(Task tsk)

getResultTask

public Task getResultTask()

setWebject

public void setWebject(Webject webj)
Receive a webject and initialize the webject instance.

Parameters:
webj - The parameter containing the webject information.

getWebject

public Webject getWebject()
Get the current webject.

Returns:
The current webject.

webjectNameMatch

public boolean webjectNameMatch(String webType)
Check to see if the current webject's name equals the one passed in.

Parameters:
webType - The name of the match check webject.
Returns:
True or False based on name match.

setProperties

public void setProperties(Properties propers)
This method does nothing but is provided for compatibility with IE 4.0

Parameters:
propers - The Properties that you would like to save.

getProperties

public Properties getProperties()
Get a list of Properties that you passed or set to the adapter.

Returns:
The Properties for use by the adapter.

getProperty

public String getProperty(String serviceName,
                          String key)
Searches for the property for the specified service name and key in the property list.

Parameters:
serviceName - The serviceName for the adapter.
key - The property key.
Returns:
The value in this property list corresponding to the specified key.

getProperty

public String getProperty(String serviceName,
                          String key,
                          String defValue)
Searches for the property for the specified service name and key in the property list.

Parameters:
serviceName - The serviceName for the adapter.
key - The property key.
defValue - The default value if no value found with the specified key.
Returns:
The value in this property list corresponding to the specified key.

setWebjectPath

public void setWebjectPath(String path)
Receive a path and set the webject path.

Parameters:
path - The parameter containing the webject's path.

getWebjectPath

public String getWebjectPath()
If a webject path exists, it is returned.

Returns:
The webject's path.

setGlobalObject

public void setGlobalObject(String name,
                            Object obj,
                            boolean override)

setGlobalObject

public void setGlobalObject(String name,
                            Object obj)

getGlobalObject

public Object getGlobalObject(String name)

removeGlobalObject

public Object removeGlobalObject(String name)

getGlobalObjectKeys

public Enumeration getGlobalObjectKeys()

getAllGlobalObjects

public Enumeration getAllGlobalObjects()

clearAllGlobalObjects

public void clearAllGlobalObjects()

getWebjectName

public String getWebjectName()
Return a webject's name.

Returns:
The webject's name.

setWebjectName

public void setWebjectName(String name)
Receive a string and set the webject's name.

Parameters:
name - The parameter containing the webject's name.

getPassword

public String getPassword()
Return a webject's password.

Returns:
The webject's password.

setPassword

public void setPassword(String pwd)
Receive a string and set the webject's password.

Parameters:
pwd - The parameter containing the webject's password.

getUserName

public String getUserName()
Return a webject's user name.

Returns:
The webject's user name.

setUserName

public void setUserName(String uid)
Receive a string and set the webject's user ID.

Parameters:
uid - The parameter containing the webject's user ID.

getClassName

public String getClassName()
Return a class name from a webject.

Returns:
The class name.

setClassName

public void setClassName(String cls)
Receive a string and set a class name with a webject.

Parameters:
cls - The parameter containing the class name.

getGroupInName

public String getGroupInName()
Return a group in name from a webject.

Returns:
The group in name.

getGroupInNames

public Enumeration getGroupInNames()
Return a list of group in names from a webject.

Returns:
An enumerated list of group in names.

getGroupOutName

public String getGroupOutName()
Return a group out name from a webject.

Returns:
The group out name.

getGroupOutNames

public Enumeration getGroupOutNames()
Return a list of group out names from a webject.

Returns:
An enumerated list of group out names.

clearParams

protected void clearParams()
Remove all parameters from this webject.


addParam

protected void addParam(Param param)
Receive a parameter and add the parameter to this webject.

Parameters:
param - The parameter to be added.

setParam

protected void setParam(Param param)
Set a new parameter to this webject.

Parameters:
param - A new parameter.

removeParam

protected void removeParam(Param param)
Remove a parameter from this webject.

Parameters:
param - The parameter to be removed.

removeParams

public void removeParams(String name)
Remove all parameters from this webject that have the specified name.

Parameters:
name - The name of the parameters to be removed.

getParamValue

public String getParamValue(String name)
Get the value of a named parameter for this webject.

Parameters:
name - The name of the desired parameter.
Returns:
The named parameter's value, or an empty string (if not defined).

getParamValue

public String getParamValue(String name,
                            String defaulty)
Return the value of a named parameter for this webject.

Parameters:
name - The name of the desired parameter.
defaulty - The default value to use if the parameter is not defined.
Returns:
The named parameter's value, or the default value (if not defined).

getParamValues

public Enumeration getParamValues(String name)
Return all values of a named parameter for this webject.

Parameters:
name - The name of the desired parameter.
Returns:
A list of the named parameter's values.

getParam

protected Param getParam(String name)
Get a named parameter for this webject.

Parameters:
name - The name of the desired parameter.
Returns:
The named parameter's value, or null if not defined.

getParams

protected Enumeration getParams(String name)
Get all the parameters for this webject that have a specified name.

Parameters:
name - The name of the desired parameters. A null name gets all parameters.
Returns:
The list of parameters.

getParamNames

public Enumeration getParamNames()
Gets a unique list of names of all the parameters that are defined for this webject.

Returns:
The unique list of names.

getMetaValue

public String getMetaValue(String name)
Gets the specified meta value from this webject.

Parameters:
name - The name of the desired meta value.
Returns:
The value of the named meta, or null if not defined.

addMetaValue

public void addMetaValue(String name,
                         String value)
Adds the specified meta name and value to this webject.

Parameters:
name - The name of the new meta value.
value - The value of the named meta.

getWebjectOutput

public Enumeration getWebjectOutput()
Gets any output generated by this webject.

Returns:
A list of strings generated by this webject.

addWebjectOutput

public void addWebjectOutput(String str)
Adds an output message to this webject.

Parameters:
str - An output string generated by this webject.

getStatus

public int getStatus()
Get the status of this task

Returns:
The integer value representing the status of the message; zero is 'status=ok'.

getMessages

public Enumeration getMessages()
Get the error messages attached to this task.

Returns:
An Enumerated list that has all the error/warning messages.

removeInputGroup

public void removeInputGroup(Group grp)
Remove an input group from this task.

Parameters:
grp - The group of objects to be removed.

removeInputGroups

public void removeInputGroups()
Remove all input groups from this task.


addInputGroup

public void addInputGroup(Group grp)
Add an input group to this task.

Parameters:
grp - A group of objects for input to this task.

getInputGroup

public Group getInputGroup(String name)
Get an input group from this task.

Parameters:
name - The name of the group to get.
Returns:
The input group.

getInputGroups

public Enumeration getInputGroups()
Get a list of all input groups for this task.

Returns:
The input groups.

getGroupIn

public Group getGroupIn()
Get the default input group for this task.

Returns:
The default input group.

getGroupIn

public Group getGroupIn(String name)
Get a named input group for this task.

Parameters:
name - The name of the desired input group.
Returns:
The named input group.

addOutputString

public void addOutputString(String str)
Add an output string to this task.

Parameters:
str - The string output of this task.

addOutputGroup

public void addOutputGroup(Group grp)
Add an output group to this task.

Parameters:
grp - A group of objects output by this task.

getGroupOut

public Group getGroupOut()
Get the output group from this task.

Returns:
The default output group.

getGroupOut

public Group getGroupOut(String name)
Get a named output group from this task.

Parameters:
name - The name of the desired output group.
Returns:
The named output group.

getOutputGroup

public Group getOutputGroup(String name)
Get a named output group from this task.

Parameters:
name - The name of the desired output group.
Returns:
The named output group.

getOutputGroups

public Enumeration getOutputGroups()
Get an Enumerated list of output groups from this task.

Returns:
An Enumerated list of named output groups.

getResponse

public IeRequest getResponse()

setServiceName

public void setServiceName(String svName)
Initialize the service name.

Parameters:
svName - The name of the service.

getServiceName

public String getServiceName()
Return the service name.

Returns:
The name of the service.

writeStatus

public void writeStatus(String status)
write some status

Parameters:
status - The status string you would like for output

setMessage

protected void setMessage(String message,
                          Object[] obj,
                          int status)

writeBlobStream

public void writeBlobStream(InputStream fis,
                            String filename,
                            String contentType)
Stream the binary file back to your browser through the output stream.

Parameters:
fis - Any input stream type containing file or binary data.
filename - The file name needed to be streamed back.
contentType - The mimetype of the file or binary data.

readBlobStream

public void readBlobStream(OutputStream fos)
Put the file or binary data into the output stream.

Parameters:
fos - Any output stream that you want your data to put into.

writeGroupOut

public void writeGroupOut(Hashtable htab)
Write the metadata from the hash table structure into the group out.

Parameters:
htab - The hash table structure containing the metadata from the backend.

writeGroupOut

public void writeGroupOut(Hashtable htab,
                          String GroupOutName)
Write the metadata from the hash table structure into the named group out.

Parameters:
htab - The hash table structure containing the metadata from the backend.
GroupOutName - The name of the group-out

writeGroupOut

public void writeGroupOut(Vector nodeVec)
Write the metadata from the vector structure into the group out.

Parameters:
nodeVec - The vector structure containing the metadata from the backend.

writeGroupOut

public void writeGroupOut(Vector nodeVec,
                          String GroupOutName)
Write the metadata from the vector structure into the named group out.

Parameters:
nodeVec - The vector structure containing the metadata from the backend.
GroupOutName - The name of the group-out

writeGroupOut2

public void writeGroupOut2(Vector nodeVec)
Write the metadata from the vector structure into the group out.

Parameters:
nodeVec - The vector structure containing the metadata from the backend.

writeGroupOut2

public void writeGroupOut2(Vector nodeVec,
                           String GroupOutName)
Write the metadata from the vector structure into the group out.

Parameters:
nodeVec - The vector structure containing the metadata from the backend.

readGroupIn

public Vector readGroupIn()
Read the metadata from group-in into the vector structure.

Returns:
The vector structure with data from group-in.

readGroupIn

public Vector readGroupIn(String GroupInName)
Read the metadata from group-in into the vector structure.

Parameters:
GroupInName - The name of the group-in.
Returns:
The vector structure with data from group-in.