|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.infoengine.edasql.RequestContext
This class provides a wrapper to the Info*Engine server classes and data for the adapter developed with JADK. It encapsulates the input task, output task, user webject, and the request classes for the adapter developers to focus on their back end information system issues. It provides rich set of methods and functions to communicate with the Info*Engine server and to handle the various other needs for the adapter.
Field Summary | |
(package private) static String |
ID
|
static Hashtable |
jadkGlobalHashtable
|
private com.infoengine.log.LogWriter |
logWriter
|
private Request |
myRequest
|
private String |
myResource
|
private Task |
myTask
|
private Webject |
myWebject
|
private Task |
resultTask
|
private String |
serviceName
|
static String[] |
TYPES
|
private String |
webjectPath
|
Constructor Summary | |
RequestContext(Request request,
String servName,
com.infoengine.log.LogWriter log)
Constructor for the RequestContext. |
|
RequestContext(Request request,
String servName,
com.infoengine.log.LogWriter log,
IeMultipartOutputStream out)
Constructor for the RequestContext. |
|
RequestContext(Request request,
String servName,
String myRes,
com.infoengine.log.LogWriter log)
Constructor for the RequestContext. |
|
RequestContext(Request request,
String servName,
String myRes,
com.infoengine.log.LogWriter log,
IeMultipartOutputStream out)
Constructor for the RequestContext. |
Method Summary | |
void |
addMetaValue(String name,
String value)
Adds the specified meta name and value to the webject. |
void |
addOutputGroup(Group grp)
Add an output group to the output task. |
void |
addParam(Param param)
Add the parameter to the input webject. |
void |
addVdb(Group grp)
|
void |
addVdb(String str)
|
void |
addWebjectOutput(String str)
Adds the output message to this webject. |
void |
clearAllGlobalObjects()
Remove all the names and the associated global objects in the global table. |
void |
clearParams()
Remove all parameters from the input webject. |
Enumeration |
getAllGlobalObjects()
Get a list of all the global objects that were saved. |
String |
getClassName()
Return a value of the class parameter from a webject. |
Object |
getGlobalObject(String name)
Get the global object with the name. |
Enumeration |
getGlobalObjectKeys()
Get a list of all the names that were saved previously for the global objects. |
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 the group_in name that your defined from your input XML webject. |
Enumeration |
getGroupInNames()
Return a list of group_in names that you defined from the webject. |
Group |
getGroupOut()
Get the output group from the output task. |
Group |
getGroupOut(String name)
Get a named output group from the output task. |
String |
getGroupOutName()
Return the group_out name that you defined from your XML webject. |
Enumeration |
getGroupOutNames()
Return a list of group_out names that you defined with your input XML webject. |
Enumeration |
getInputGroups()
Get a list of all input groups for this task. |
String |
getLocalizedMessage(String message,
Object[] obj)
|
com.infoengine.log.LogWriter |
getLogWriter()
Return the LogWriter object to the adapter. |
Enumeration |
getMessages()
Get all the error messages attached to the output task. |
String |
getMetaValue(String name)
Gets the specified meta value from the input webject. |
Enumeration |
getOutputGroups()
Get an enumerated list of output groups from the output task. |
IeMultipartOutputStream |
getOutputStream()
Return the IeMultipartOutputStream from the Info*Engine server. |
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 from the input webject. |
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 from the input webject. |
String |
getParamValue(String name,
String defaulty)
Return the value of a named parameter from the input webject. |
Enumeration |
getParamValues(String name)
Return all values of a named parameter for this webject. |
String |
getPassword()
Return the password if you have set it with the setPassword method previously. |
Properties |
getProperties()
Get a list of Properties that you passed or set with 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 the key in the property list. |
Request |
getRequest()
Return the current request object received from Info*Engine server. |
IeRequest |
getResponse()
Return the IeRequest object to the Info*Engine server. |
Task |
getResultTask()
Return the output task. |
String |
getServiceName()
Return the service name. |
int |
getStatus()
Get the status of the output task. |
Task |
getTask()
Get the current input task. |
String |
getUserName()
Return a webject's user name if you have set one with the setPassword method. |
Webject |
getWebject()
Get the current input webject. |
String |
getWebjectName()
Return the name of the current input webject, such as Query-Objects, Create-Objects, etc. |
Enumeration |
getWebjectOutput()
Gets any output messages generated by this webject. |
String |
getWebjectPath()
Get the adapter webject class file path. |
String |
getWebjectType()
Get the current webject type. |
boolean |
isLogVerbose()
Check whether the logging is in 'verbose' mode. |
void |
logWrite(Object X)
Write the content of object to the log file. |
void |
logWrite(String message,
Object[] obj)
Write a message string with possible variables in the object to the log file. |
void |
logWrite(Throwable X)
Write a throwable object to the log file. |
void |
print(Object X)
Output the object to the log file. |
void |
readBlobStream(OutputStream fos)
Read the next content object BLOB from the input stream to the output stream provided. |
Vector |
readGroupIn()
Read the metadata from group-in into the vector-hashtable-vector structure. |
Vector |
readGroupIn(String GroupInName)
Read the metadata from group-in into the vector-hashtable-vector structure. |
Object |
removeGlobalObject(String name)
Remove the global object previously saved with the name. |
void |
removeParam(Param param)
Remove a parameter from the input webject. |
void |
removeParams(String name)
Remove all parameters from the input webject that have the specified key name. |
void |
setClassName(String cls)
Set the class name with your XML webject. |
void |
setGlobalObject(String name,
Object obj)
Set a global object with the name for the adapter to retrive later. |
void |
setGlobalObject(String name,
Object obj,
boolean override)
Set a global object with the name for the adapter to retrive later. |
void |
setOutputStream(IeMultipartOutputStream output)
Set the IeMultipartOutputStream to the input task. |
void |
setParam(Param param)
Set a new parameter to the input webject. |
void |
setPassword(String pwd)
The password that you would like it to replace the existing one from your webject. |
void |
setProperties(Properties propers)
Deprecated. |
void |
setRequest(Request rqt)
Set the request object from the Info*Engine server and uses this request to create the input task with the webject. |
void |
setRequest(Request rqt,
boolean override)
Set the request object in the RequestContext and uses this request to create the input task. |
void |
setResultTask(Task tsk)
Set the output task. |
void |
setServiceName(String svcName)
Set the service name for current adapter so all the properties will be associated with the svcName. |
void |
setTask(Task tsk)
Set the input task. |
void |
setUserName(String uid)
Set the webject's user ID that replaces the existing one inside your webject. |
void |
setWebject(Webject webj)
Set the webject object for adapter to use. |
void |
setWebjectName(String name)
Set the name of the current input webject. |
void |
setWebjectPath(String path)
Set the location of the adapter webject class files so that they can be dynamically loaded at runtime. |
boolean |
webjectNameMatch(String webName)
Check to see if the current webject's name equals the one passed in. |
void |
writeBlobStream(InputStream fis,
String filename,
String contentType)
Write one content object of a MIME multipart of object to the output stream to be sent to the browser. |
void |
writeGroupOut(Hashtable htab)
Write the metadata from the vector-hashtable-vector structure to the output group. |
void |
writeGroupOut(Hashtable htab,
String GroupOutName)
Write the metadata from the vector-hashtable-vector structure to the output group. |
void |
writeGroupOut(Vector nodeVec)
Write the metadata from the vector-hashtable-vector structure to the output group. |
void |
writeGroupOut(Vector nodeVec,
String GroupOutName)
Write the metadata from the vector-hashtable-vector structure to the output group. |
void |
writeGroupOut2(Hashtable htab)
Write the metadata from the vector-hashtable-vector structure to the output group. |
void |
writeGroupOut2(Hashtable htab,
String GroupOutName)
Write the metadata from the vector-hashtable-vector structure to the output group. |
void |
writeGroupOut2(Vector nodeVec)
Write the metadata from the vector-hashtable-vector structure to the output group. |
void |
writeGroupOut2(Vector nodeVec,
String GroupOutName)
Write the metadata from the vector-hashtable-vector structure to the output group. |
void |
writeObject(ResultSet rset)
writeObject will pass the ResultSet to Info*Engine to build the VDB. |
void |
writeStatus(String str)
Deprecated. |
void |
writeStatus(String message,
int status)
This method is the new replacement of the writeStatus. |
void |
writeStatus(String message,
Object[] obj,
int status)
This method is the new replacement of the writeStatus. |
void |
writeStatus(String str,
String GroupOutName)
Deprecated. |
void |
writeStatus(String message,
String GroupOutName,
int status)
This method is the new replacement of the writeStatus. |
void |
writeStatus(String message,
String GroupOutName,
Object[] obj,
int status)
This method is the new replacement of the writeStatus. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final String ID
private String serviceName
private com.infoengine.log.LogWriter logWriter
private String webjectPath
private String myResource
private Request myRequest
private Webject myWebject
private Task myTask
private Task resultTask
public static Hashtable jadkGlobalHashtable
public static String[] TYPES
Constructor Detail |
public RequestContext(Request request, String servName, com.infoengine.log.LogWriter log)
request
- This is the Request object passed to the adapter
from the Info*Engine server.servName
- The service name that is defined with your server
properties file. This is also used as an adapter
instance name in your XML webject.log
- The logWriter object for logging purposes for your
adapter.public RequestContext(Request request, String servName, String myRes, com.infoengine.log.LogWriter log)
request
- This is the Request object passed to the adapter
from the Info*Engine server.servName
- The service name that is defined with your server
properties file. This is also used as an adapter
instance name in your XML webject.myRes
- This is the base name of your resource bundle. You
may either pass the name here or the adapter will
try to get .myResourceBundle from your properties
file. The .resourcePath can be specified as well,
otherwise, it will assume the resource bundle files
are using the same path as the adapter classes.log
- The logWriter object for logging purposes for your
adapter.public RequestContext(Request request, String servName, com.infoengine.log.LogWriter log, IeMultipartOutputStream out)
request
- This is the Request object passed to the adapter
from the Info*Engine server.servName
- The service name that is defined with your server
properties file. This is also used as an adapter
instance name in your XML webject.log
- The logWriter object for logging purposes for your
adapter.out
- No longer in use. You get IeMultipartOutputStream
with a call to getOutputStream. See the definition
for this method below.public RequestContext(Request request, String servName, String myRes, com.infoengine.log.LogWriter log, IeMultipartOutputStream out)
request
- This is the Request object passed to the adapter
from the Info*Engine server.servName
- The service name that is defined with your server
properties file. This is also used as an adapter
instance name in your XML webject.myRes
- This is the base name of your resource bundle. You
may either pass the name here or the adapter will
try to get .myResourceBundle from your properties
file. The .resourcePath can be specified as well,
otherwise, it will assume the resource bundle files
are using the same path as the adapter classes.log
- The logWriter object for logging purposes for your
adapter.out
- No longer in use. You get IeMultipartOutputStream
with a call to getOutputStream. See the definition
for this method below.Method Detail |
public void setRequest(Request rqt)
rqt
- The request object you would like to replace the
old request for your adapter.public void setRequest(Request rqt, boolean override)
rqt
- The request object you would like to replace the
old request for your adapter.override
- Ture to override the previous input webject. False
to keep the old webject parameters.public Request getRequest()
public IeMultipartOutputStream getOutputStream()
public void setOutputStream(IeMultipartOutputStream output)
public com.infoengine.log.LogWriter getLogWriter()
public void logWrite(Object X)
X
- The object to be sent to the log file.public void logWrite(Throwable X)
X
- The throwable object to be sent to the log.public void logWrite(String message, Object[] obj)
message
- The string message or message ID from your resource
bundle that your would like to output to the log file.obj
- The variable for your output along with the message.public String getLocalizedMessage(String message, Object[] obj)
public void print(Object X)
X
- The object to be sent to the log file.public boolean isLogVerbose()
public void setTask(Task tsk)
tsk
- The task object that you want to replace your input
task. This action also replace the webject along
with the input task so the new webject is used by
the adapter.public Task getTask()
public void setResultTask(Task tsk)
tsk
- The task object that you want to replace the output
task. Once replaced, all the output will be
associated with this task to send to the Info*Engine
server.public Task getResultTask()
public void setWebject(Webject webj)
webj
- The webject object that will be used by the adapter.
This will result the new paramters and values being
used.public Webject getWebject()
public String getWebjectType()
public boolean webjectNameMatch(String webName)
webName
- The name of the match check webject.
public void setProperties(Properties propers)
propers
- The Properties that you would like to save for
I*E 4.0. It is ignored with post I*E 4.0 server.public Properties getProperties()
public String getProperty(String serviceName, String key)
serviceName
- The serviceName for the adapter.key
- The property key used to get the property value.
public String getProperty(String serviceName, String key, String defValue)
serviceName
- The serviceName for the adapter.key
- The property key.defValue
- The default value if no value found with the
specified key.
public void setWebjectPath(String path)
path
- The parameter containing the webject's path.public String getWebjectPath()
public String getWebjectName()
public void setWebjectName(String name)
name
- The parameter containing the webject's name. In
general, if you pass a name 'Query-XYZ", then you
will need to implement the IeQueryXyz adapter
webject to avoid a runtime error.public String getPassword()
public void setPassword(String pwd)
pwd
- The parameter containing the password.public String getUserName()
public void setUserName(String uid)
uid
- The parameter containing the user ID.public String getClassName()
public void setClassName(String cls)
cls
- The value to replace the existing 'CLASS' value
from your input XML webject.public String getGroupInName()
public Enumeration getGroupInNames()
public String getGroupOutName()
public Enumeration getGroupOutNames()
public void clearParams()
public void addParam(Param param)
param
- The param object to be added.public void setParam(Param param)
param
- A new parameter.public void removeParam(Param param)
param
- The parameter to be removed.public void removeParams(String name)
name
- All param objects with the key equals to the name
to be removed.public String getParamValue(String name)
name
- The name of the desired parameter.
public String getParamValue(String name, String defaulty)
name
- The name of the desired parameter.defaulty
- The default value to use if the parameter is not
defined.
public Enumeration getParamValues(String name)
name
- The name of the desired parameter.
public Param getParam(String name)
name
- The name of the desired parameter.
public Enumeration getParams(String name)
name
- The name of the desired parameters.
public Enumeration getParamNames()
public String getMetaValue(String name)
name
- The name of the desired meta value.
public void addMetaValue(String name, String value)
name
- The name of the new meta value.value
- The value of the named meta.public void setGlobalObject(String name, Object obj)
name
- The name of object for later retrieval.obj
- The object that you want to save off for later
use by the adapter.public void setGlobalObject(String name, Object obj, boolean override)
name
- The name of object for later retrieval.obj
- The object that you want to saved off for later
use.override
- True will enable to override, false will keep the
existing value without overridding.public Object getGlobalObject(String name)
name
- The name that you used to save the global object.
public Object removeGlobalObject(String name)
name
- The name that was saved with the global object to
be removed.
public Enumeration getGlobalObjectKeys()
public Enumeration getAllGlobalObjects()
public void clearAllGlobalObjects()
public Enumeration getWebjectOutput()
public void addWebjectOutput(String str)
str
- An output string generated by this webject.public int getStatus()
public Enumeration getMessages()
public Enumeration getInputGroups()
public Group getGroupIn()
public Group getGroupIn(String name)
name
- The name of the desired input group.
public void addVdb(String str)
public void addVdb(Group grp)
public void addOutputGroup(Group grp)
grp
- A group object to be added as output group to the
output task.public Group getGroupOut()
public Group getGroupOut(String name)
name
- The name of the desired output group.
public Enumeration getOutputGroups()
public IeRequest getResponse()
public void setServiceName(String svcName)
svcName
- The name of the service.public String getServiceName()
public void writeStatus(String str)
str
- The error message you would like for output
to the browser.public void writeStatus(String str, String GroupOutName)
str
- The error message you would like for output
to the browser.GroupOutName
- The name of the Group out you would like to use.public void writeStatus(String message, int status)
message
- The message you would like to output to the browser.status
- The integer value that you would like Info*Engine
server to know the type of message.public void writeStatus(String message, String GroupOutName, int status)
message
- The message you would like to output to the browser.GroupOutName
- The name of the Group Out you would like to use.status
- The integer value that you would like Info*Engine
server to know the type of message.public void writeStatus(String message, Object[] obj, int status)
message
- The message you would like to output to the browser.obj
- The varialbe that you would like to be replaced in
your resource bundle.status
- The integer value that you would like Info*Engine
server to know the type of message.public void writeStatus(String message, String GroupOutName, Object[] obj, int status)
message
- The message you would like to output to the browser.GroupOutName
- The name of the Group Out you would like to use.obj
- The varialbe that you would like to be replaced in
your resource bundle.status
- The integer value that you would like Info*Engine
server to know the type of message.public void writeBlobStream(InputStream fis, String filename, String contentType)
fis
- Any input stream type containing the file or the
binary data as content data.filename
- The string name that you would like to provide for the
Content-Disposition header for the content
object.contentType
- The mimetype of the contend object as provided by
your with a file or binary data.public void readBlobStream(OutputStream fos)
fos
- Any output stream on which to write the BLOB.public void writeGroupOut(Hashtable htab)
htab
- The hash table containing simple metadata, usually from
the backend information system, that you would like to
send to the output group.public void writeGroupOut(Hashtable htab, String GroupOutName)
htab
- The hash table containing simple metadata, usually from
the backend information system, that you would like to
send to the output group.GroupOutName
- The name of the output group. You can assign
any string value to give the output group a name. This
name will be used to replace the GROUP_OUT parameter
if you defined one in your input webject.public void writeGroupOut(Vector nodeVec)
nodeVec
- The head vector structure containing a table, usually
from the backend, that you would like to send to the
Info*Engine server for output.public void writeGroupOut(Vector nodeVec, String GroupOutName)
nodeVec
- The head vector containing a table, usually from
the backend information system, that you would like to
send to the output group.GroupOutName
- The name of the output group. You can assign
any string value to give the output group a name. This
name will be used to replace the GROUP_OUT parameter
if you defined one in your input webject.public void writeGroupOut2(Vector nodeVec)
nodeVec
- The head vector structure containing a table, usually
from the backend, that you would like to send to the
Info*Engine server for output.public void writeGroupOut2(Vector nodeVec, String GroupOutName)
nodeVec
- The head vector containing a table, usually from
the backend information system, that you would like to
send to the output group.GroupOutName
- The name of the output group. You can assign
any string value to give the output group a name. This
name will be used to replace the GROUP_OUT parameter
if you defined one in your input webject.public void writeGroupOut2(Hashtable htab)
htab
- The hash table containing simple metadata, usually from
the backend information system, that you would like to
send to the output group.public void writeGroupOut2(Hashtable htab, String GroupOutName)
htab
- The hash table containing simple metadata, usually from
the backend information system, that you would like to
send to the output group.GroupOutName
- The name of the output group. You can assign
any string value to give the output group a name. This
name will be used to replace the GROUP_OUT parameter
if you defined one in your input webject.public void writeObject(ResultSet rset) throws SQLException
rset
- The result set containing simple metadata, usually from
the backend information system, that you would like to
send to the output VDB.
SQLException
public Vector readGroupIn()
public Vector readGroupIn(String GroupInName)
GroupInName
- The name of the group-in that you defined in
your input webject.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |