|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.infoengine.SAK.IeService
public class IeService
Use the Server Access Kit (SAK) to access the Info*Engine Server programmatically.
The SAK, embodied in the IeService Object, is a Java object that provides access to the Info*Engine server. It executes Info*Engine templates and tasks. It allows the caller to obtain the raw output from these, and it also supports creation and management of an internal collection of Info*Engine group objects.
To use the SAK, you must instantiate an IeService object and then use the IeService object to initiate Info*Engine requests by supplying the URLs of templates and tasks. After initiating a request and providing optional parameter names and values, you can use the IeService object to obtain an input stream. From the input stream, you can read the result of the request, or if a task is initiated, you can request that the results of the task be added to an internally maintained collection of Info*Engine group objects. By using the IeService object methods that provide access to the internal collection, you can obtain groups, elements, and attributes from the collection.
| Constructor Summary | |
|---|---|
IeService()
Create an instance that is not associated with any particular server. |
|
IeService(java.lang.String serverUri)
Create an instance assocated with an Info*Engine server identified by the specified URI. |
|
| Method Summary | |
|---|---|
void |
addAttributeValue(java.lang.String gName,
int index,
java.lang.String attName,
java.lang.Object attValue)
add an attribute value to a group |
void |
addGroup(Group group)
Adds a group to the internal collection. |
void |
beginRequest(java.lang.String templatePath)
Initiate a request to the Info*Engine server. |
java.lang.Object |
clone()
Returns a shallow copy of the object. |
Att |
getAttribute(java.lang.String groupName,
int index,
java.lang.String attrName)
Return a named attribute of an element selected by index. |
Att |
getAttribute(java.lang.String groupName,
java.lang.String keyName,
java.lang.String keyValue,
java.lang.String attrName)
Return a named attribute of an element selected by attribute name and value. |
java.util.Enumeration |
getAttributeNames(java.lang.String name,
int index)
Return the names of the attributes of an element of a group. |
java.lang.String |
getAttributeValue(java.lang.String groupName,
int index,
java.lang.String attrName)
Return the value of a named attribute of an element selected by index. |
java.lang.String |
getAttributeValue(java.lang.String groupName,
java.lang.String keyName,
java.lang.String keyValue,
java.lang.String attrName)
Return the value of a named attribute of an element selected by attribute name and value. |
java.util.Vector |
getAttributeValues(java.lang.String groupName,
int index,
java.lang.String attrName)
Return the values of a named attribute of an element selected by index. |
java.util.Vector |
getAttributeValues(java.lang.String groupName,
java.lang.String keyName,
java.lang.String keyValue,
java.lang.String attrName)
Return the values of a named attribute of an element selected by attribute name and value. |
IeCollection |
getCollection()
Return the object that holds the internal collection of Info*Engine group objects. |
java.util.Vector |
getColumn(java.lang.String groupName,
java.lang.String attrName)
Return all of the values of a named attribute of all elements of a group. |
java.lang.String |
getContentType()
Return the MIME content type associated with the server response. |
int |
getElementCount(java.lang.String name)
Return the number of elements in a group. |
java.util.Enumeration |
getElements(java.lang.String name)
Return the elements of a group as an Enumeration. |
boolean |
getEnableExceptions()
Return an indication of whether exceptions will be thrown when returned from tasks have any groups that contain status values indicating failures. |
Group |
getGroup()
Return a group from the internal collection, as an Info*Engine Group object. |
Group |
getGroup(java.lang.String name)
Return a group from the internal collection, as an Info*Engine Group object. |
java.util.Enumeration |
getGroupNames()
Return the names of the groups contained in the internal collection. |
java.lang.String |
getGroupXML(java.lang.String name)
Return a group from the internal collection, as a String in Info*Engine format. |
java.io.InputStream |
getInputStream()
Return an input stream containing the server's response to the request. |
java.util.Locale |
getLocale()
Return the locale that is currently associated with this service object. |
java.lang.String |
getMessage(java.lang.String name)
Return the message string associated with a group. |
Content |
getNextContent()
Return the next MIME content object from the server response stream. |
java.util.Vector |
getRow(java.lang.String groupName,
int index)
Return all of the values of an element of a group. |
int |
getStatus(java.lang.String name)
Return the status value associated with a group. |
java.util.Map<java.lang.String,Group> |
getVdbAsMap()
Generates a snapshot of the current VDB as a java map where the key is the group name and the value is the group object. |
void |
removeAllGroups()
Remove all groups from the collection. |
void |
removeGroup(java.lang.String name)
Remove a group from the collection. |
void |
sendCollection()
Send the internal collection to the server. |
void |
sendContent(java.lang.String contentType,
java.lang.String name,
java.lang.String filename,
java.io.InputStream is)
Send content of the request to the server. |
void |
sendGroup(java.lang.String name)
Send a group from the internal collection to the server. |
void |
sendParameter(java.lang.String name,
java.lang.String value)
Send a parameter of the request to the server. |
void |
setAttributeValue(java.lang.String gName,
int index,
java.lang.String attName,
java.lang.Object attValue)
set an attribute value in a group |
void |
setCollection(IeCollection collection)
Sets the object that holds the internal collection of Info*Engine group objects. |
void |
setCredentials(java.lang.String name,
java.lang.String password)
Establish the name and password of the user for which requests will be made. |
void |
setEnableExceptions(boolean enable)
Enable or disable the throwing of exceptions when tasks return groups that contain status values indicating failures. |
void |
setLanguagePreferences(java.lang.String languagePreferences)
Establish the language preferences that will be used by Info*Engine in selecting an appropriate locale for each request. |
void |
setLocale(java.util.Locale locale)
Establish the locale that will be used in generating localized messages such as error messages. |
void |
setServerUri(java.lang.String serverUri)
Establish the URI of the server to which requests will be sent. |
java.lang.String |
toString()
Read all of the content objects returned in the server response and concatenate their String representations. |
void |
updateCollection()
Get the next Content object from the server response stream and merge the Info*Engine group objects contained within it into the internal collection. |
void |
updateCollection(Content content)
Merge the Info*Engine group objects contained within a Content object into the internal collection. |
void |
updateCollection(IeCollection collection)
Merge the Info*Engine groups contained within a specified collection into the internal collection. |
void |
writeNextContent(java.io.OutputStream os)
Write the next Content object to an output stream. |
void |
writeNextContent(java.io.Writer writer)
Write the next Content object to a Writer. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IeService()
public IeService(java.lang.String serverUri)
serverUri - the URI of the server with which this instance
will be associated| Method Detail |
|---|
public void setServerUri(java.lang.String serverUri)
serverUri - the URI of the server to which requests will be sent
public void setCredentials(java.lang.String name,
java.lang.String password)
name - the username of the userpassword - the user's passwordpublic void setLanguagePreferences(java.lang.String languagePreferences)
languagePreferences - the language preferences, encoded as for an
HTTP Accept-Language headerpublic void setLocale(java.util.Locale locale)
locale - the locale to be used in generating localized messagespublic java.util.Locale getLocale()
public void beginRequest(java.lang.String templatePath)
throws IeServiceException
templatePath - the pathname of a template or task.
IeServiceException - if the request was not initiated
successfully
public void sendParameter(java.lang.String name,
java.lang.String value)
throws IeServiceException
name - the name of the parametervalue - the value of the parameter
IeServiceException - if the parameter was not sent
successfully
public void sendGroup(java.lang.String name)
throws IeServiceException
name - the name of the group to send
IeServiceException - if the content was not sent
successfully
public void sendCollection()
throws IeServiceException
IeServiceException - if the content was not sent
successfully
public void sendContent(java.lang.String contentType,
java.lang.String name,
java.lang.String filename,
java.io.InputStream is)
throws IeServiceException
contentType - the MIME type of the contentname - the name of the contentfilename - the file name, if any, associated with the contentis - the input stream containing the content
IeServiceException - if the content was not sent
successfully
public java.io.InputStream getInputStream()
throws IeServiceException
IeServiceException - if the input stream could not be
obtained successfully, possibly
because the request failed
public java.lang.String getContentType()
throws IeServiceException
IeServiceException - if the content type could not be
obtained successfully, possibly because
the request failed
public Content getNextContent()
throws IeServiceException
IeServiceException - if the next content object was not
obtained successfully, possibly because
the request failed
public void writeNextContent(java.io.OutputStream os)
throws IeServiceException
os - the output stream on which to write the content
IeServiceException - if the next content object was not
obtained successfully, or the output
was not written successfully
public void writeNextContent(java.io.Writer writer)
throws IeServiceException
writer - the Writer on which to write the content
IeServiceException - if the next content object was not
obtained successfully, or the output
was not written successfullypublic void setEnableExceptions(boolean enable)
enable - true if the throwing of exceptions is to be enabled,
false if the throwing of exception is to be disabled.public boolean getEnableExceptions()
public java.util.Map<java.lang.String,Group> getVdbAsMap()
public IeCollection getCollection()
public void setCollection(IeCollection collection)
collection - The Info*Engine collection
public void updateCollection()
throws IeServiceException
IeServiceException - if the collection was not updated
successfully, possibly because the
request failed, so no XML objects were
obtained from the server
public void updateCollection(Content content)
throws IeServiceException
content - the Content object to be merged
IeServiceException - if the collection was not updated
successfully, possibly because the
Content object did not contain a
valid set of Info*Engine groups
public void updateCollection(IeCollection collection)
throws IeServiceException
collection - the external collection to be merged into the
internal collection
IeServiceException - if the collection was not updated
successfully, possibly because the
request failed, so no XML objects were
obtained from the serverpublic java.util.Enumeration getGroupNames()
public Group getGroup()
name - The name of the group to return. If null is specified,
the last group in the collection is returned.
public Group getGroup(java.lang.String name)
name - The name of the group to return. If null is specified,
the last group in the collection is returned.
public void addGroup(Group group)
group - the Info*Engine group to addpublic java.lang.String getGroupXML(java.lang.String name)
name - the name of the group to return
public int getElementCount(java.lang.String name)
name - the name of the group
public java.util.Enumeration getElements(java.lang.String name)
name - the name of the group
public java.util.Enumeration getAttributeNames(java.lang.String name,
int index)
name - the name of the groupindex - the index of the element
public Att getAttribute(java.lang.String groupName,
int index,
java.lang.String attrName)
groupName - the name of the group from which to retrieve the
attributeindex - the index of the element to select from the groupattrName - the name of the attribute to retrieve from the group
public Att getAttribute(java.lang.String groupName,
java.lang.String keyName,
java.lang.String keyValue,
java.lang.String attrName)
groupName - the name of the group from which to retrieve the
attributekeyName - the name of the attribute used as a key to select an
element from the group.keyValue - the value of the attribute used as a key to select an
element from the groupattrName - the name of the attribute to return from the selected
element
public java.util.Vector getAttributeValues(java.lang.String groupName,
int index,
java.lang.String attrName)
groupName - the name of the group from which to retrieve the
attribute valuesindex - the index of the element to select from the groupattrName - the name of the attribute from which to retrieve values
public java.util.Vector getAttributeValues(java.lang.String groupName,
java.lang.String keyName,
java.lang.String keyValue,
java.lang.String attrName)
groupName - the name of the group from which to retrieve the
attribute valueskeyName - the name of the attribute used as a key to select an
element from the groupkeyValue - the value of the attribute used as a key to select an
element from the groupattrName - the name of the attribute from which to retrieve values
public java.lang.String getAttributeValue(java.lang.String groupName,
int index,
java.lang.String attrName)
groupName - the name of the group from which to get the valueindex - the index of the element to select from the groupattrName - the name of the attribute from which to retrieve a
value
public java.lang.String getAttributeValue(java.lang.String groupName,
java.lang.String keyName,
java.lang.String keyValue,
java.lang.String attrName)
groupName - the name of the group from which to get the valuekeyName - the name of the attribute used as a key to select an
element from the groupkeyValue - the value of the attribute used as a key to select an
element from the groupattrName - the name of the attribute from which to retrieve a
value
public java.util.Vector getRow(java.lang.String groupName,
int index)
groupName - the name of the groupindex - the index of the element
public java.util.Vector getColumn(java.lang.String groupName,
java.lang.String attrName)
groupName - the name of the groupattrName - the name of the attribute
public int getStatus(java.lang.String name)
name - the name of the group
public java.lang.String getMessage(java.lang.String name)
name - the name of the group
public void removeGroup(java.lang.String name)
name - the name of the group to removepublic void removeAllGroups()
public java.lang.String toString()
toString in class java.lang.Object
public final java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException
public void setAttributeValue(java.lang.String gName,
int index,
java.lang.String attName,
java.lang.Object attValue)
gName - - the name of the groupindex - - the element index to add the attribute inattName - - the name of the attribute to setattValue - - the attribute value
public void addAttributeValue(java.lang.String gName,
int index,
java.lang.String attName,
java.lang.Object attValue)
gName - - the name of the groupindex - - the element index to add the attribute inattName - - the name of the attribute to setattValue - - the attribute value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||