|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.greenstone.gs3client.data.ResponseData
public abstract class ResponseData
Represents the data in a response XML message that is returned as either a Browse or Query (Search) request. Subclasses therefore are BrowseResponseData and QueryResponseData. This class maintains a Map of (nodeID, NodeData ref) pairs representing the resulting <classifierNode>s and <documentNode>s that can be returned when executing a SINGLE browse or query request.
Field Summary | |
---|---|
protected java.util.Map |
nodeIDsToNodes
map of (nodeIDs, references to associated NodeData) pairs, stored in the order they are contained in the response XML messages (the order in which data objects are parsed and created for them) |
Constructor Summary | |
---|---|
ResponseData()
Default constructor, creates the nodeIDsToNodes map |
Method Summary | |
---|---|
void |
clear()
Clears/resets this ResponseData object of all data, so that it can be reused to process future Browse and Query requests. |
java.util.Map |
getIDToNodeMapping()
|
NodeData |
getNodeForID(java.lang.String ID)
Given an nodeID, returns the NodeData object with that nodeID, if any. |
void |
setContentForDocs(org.w3c.dom.Element messageTag)
After a DocumentContentRetrieve request for one or more documents has returned a response, this method - when given the response XML - will set the nodeContents of each document in the response (as long as those documents already have an associated DocumentNodeData object instantiated, which should/would always be the case). |
boolean |
setMetadataForDocuments(org.w3c.dom.Element messageTag)
This method sets the metadata for one or even all <documentNode> data objects contained in the Map nodeIDsToNodes, using the <message> element parameter (which is returned upon a documentMetadataRetrieve request. |
protected boolean |
setMetadataForNodes(org.w3c.dom.Element messageTag,
java.lang.String NODE_ELEM)
This method can be called after a DocumentMetadataRetrieve request has returned a response. |
abstract void |
setResponseData(org.w3c.dom.Element responseMsgTag)
Subclasses must implement this method to parse the <message><response></response></message> that is returned upon executing a browse or query request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map nodeIDsToNodes
Constructor Detail |
---|
public ResponseData()
Method Detail |
---|
public abstract void setResponseData(org.w3c.dom.Element responseMsgTag)
responseMsgTag
- the XMl response message Element whose data will
be parsed and stored in the ResponseData subclasspublic void clear()
public java.util.Map getIDToNodeMapping()
public NodeData getNodeForID(java.lang.String ID)
ID
- is the nodeID whose NodeData object is requestedpublic void setContentForDocs(org.w3c.dom.Element messageTag)
messageTag
- is the DocumentContentRetrieve XML response message
containing the document contents for one or more documentNodesprotected boolean setMetadataForNodes(org.w3c.dom.Element messageTag, java.lang.String NODE_ELEM)
NODE_ELEM
- can be either GSXML defined constant for
<ClassifierNode> or <DocumentNode>messageTag
- is the DocumentMetadataRetrieve XML response message
containing the metadata for one or more documentNodes/classifierNodes
as specified by NODE_ELEMpublic boolean setMetadataForDocuments(org.w3c.dom.Element messageTag)
messageTag
- is the DocumentMetadataRetrieve XML response message
containing the metadata for one or more documentNodes
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |