com.raritantechnologies.federated.z3950
Class Z3950Result

java.lang.Object
  extended bycom.raritantechnologies.federated.z3950.Z3950Result
All Implemented Interfaces:
IResult

public class Z3950Result
extends java.lang.Object
implements IResult

Implementation of IResult for Z39.50 records.


Developed by Raritan Technologies Inc..

Author:
Glenn Robitaille

Constructor Summary
Z3950Result()
           
 
Method Summary
 void addNestedResult(java.lang.String fieldName, IResult nestedResult)
           
 void addNestedResults(java.lang.String fieldName, IResultSet nestedResults)
           
 void addTree(java.lang.String name, TreeRoot tree)
          Methods to add/get associated TreeRoot objects.
 void addValue(java.lang.String field, java.lang.String value)
          Adds a value to a field.
 void clearValue(java.lang.String field)
           
 org.w3c.dom.Document getDOM(ILoginInfo userInfo)
          return a DOM Document object with the field data.
 java.util.Iterator getFieldNames()
          returns an iterator of the field names.
 java.lang.String[] getFullTextFormats(ILoginInfo userInfo)
          returns a list of formats available for the "full text" electronic format formats can be text, html, pdf etc.
 java.lang.String getIDField()
           
 java.util.Iterator getNestedFieldNames()
           
 IResultSet getNestedResults(java.lang.String fieldName)
           
 SearchSource getSearchSource()
          returns the SearchSource object that generated this IResult.
 java.lang.String getSearchSourceName()
           
 java.lang.String getTitleField()
           
 TreeRoot getTree(java.lang.String name)
           
 java.util.Iterator getTreeNames()
           
 java.lang.String getURLField()
           
 java.lang.String getValue(java.lang.String field)
          returns the value of a vield.
 java.lang.String getValue(java.lang.String field, java.lang.String defaultVal)
          returns the value of a result field OR the past defaultVal parameter if the field does not exist.
 java.lang.String[] getValues(java.lang.String field)
          Support for multiple values - returns a String[].
 java.lang.String getXML(ILoginInfo userInfo)
           
 java.lang.String getXML(ILoginInfo userInfo, java.util.Iterator resultFields, java.util.Iterator nestedFields)
           
 boolean hasMultipleValues(java.lang.String field)
           
 boolean hasNestedResults()
          Z3950 Result does not support hierarchical results.
 void setIDField(java.lang.String idField)
           
 void setNestedResults(java.lang.String fieldName, IResultSet nestedResults)
           
 void setSearchSource(SearchSource sSource)
          set/get the name of the SearchSource that this result came from.
 void setSearchSourceName(java.lang.String searchSourceName)
          set/get the name of the SearchSource that this result came from.
 void setTitleField(java.lang.String titleField)
           
 void setURLField(java.lang.String URLField)
           
 void setValue(java.lang.String field, java.lang.String value)
          Sets a new result field.
 void setValues(java.util.Map values)
          Sets field values from a java.util.Map
 java.lang.String toString()
           
 void writeFullText(ILoginInfo userInfo, java.lang.String formatType, java.io.OutputStream toStream)
          filters the full text document for this result to the out put stream toStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Z3950Result

public Z3950Result()
Method Detail

setSearchSource

public void setSearchSource(SearchSource sSource)
set/get the name of the SearchSource that this result came from.


setSearchSourceName

public void setSearchSourceName(java.lang.String searchSourceName)
Description copied from interface: IResult
set/get the name of the SearchSource that this result came from. Note that the set method uses the search source name, not the SearchSource object itself. This is done to prevent memory leaks - the SearchSource is static configuration-bound object, IResults are transient, session-bound objects. Any links to application objects would prevent their garbage collection when the session is destroyed.

Specified by:
setSearchSourceName in interface IResult

getSearchSourceName

public java.lang.String getSearchSourceName()
Specified by:
getSearchSourceName in interface IResult

getSearchSource

public SearchSource getSearchSource()
Description copied from interface: IResult
returns the SearchSource object that generated this IResult. To prevent memory leaks, implementation must not cache the SearchSource object. rather, the method should look up the SearchSource from ConfigurationManager based on the IResult's searchSourceName variable. If IResult classes extend BasicResult, this behavior will be inheritted.

Specified by:
getSearchSource in interface IResult

setValue

public void setValue(java.lang.String field,
                     java.lang.String value)
Description copied from interface: IResult
Sets a new result field. Used for fields that have only one value. Use addValue( ) for fields that can have more than one value.

Specified by:
setValue in interface IResult

clearValue

public void clearValue(java.lang.String field)
Specified by:
clearValue in interface IResult

setValues

public void setValues(java.util.Map values)
Description copied from interface: IResult
Sets field values from a java.util.Map

Specified by:
setValues in interface IResult

addValue

public void addValue(java.lang.String field,
                     java.lang.String value)
Description copied from interface: IResult
Adds a value to a field. used for fields with more than one value. Use setValue( ) for fields that can only have one value.

Specified by:
addValue in interface IResult

getValue

public java.lang.String getValue(java.lang.String field)
Description copied from interface: IResult
returns the value of a vield. For multiple value fields, implementation should return a delimited string.

Specified by:
getValue in interface IResult

getValue

public java.lang.String getValue(java.lang.String field,
                                 java.lang.String defaultVal)
Description copied from interface: IResult
returns the value of a result field OR the past defaultVal parameter if the field does not exist.

Specified by:
getValue in interface IResult

getValues

public java.lang.String[] getValues(java.lang.String field)
Support for multiple values - returns a String[]. if there is only one value String array is of length 1.

Specified by:
getValues in interface IResult

hasMultipleValues

public boolean hasMultipleValues(java.lang.String field)
Specified by:
hasMultipleValues in interface IResult

hasNestedResults

public boolean hasNestedResults()
Z3950 Result does not support hierarchical results.

Specified by:
hasNestedResults in interface IResult

getNestedResults

public IResultSet getNestedResults(java.lang.String fieldName)
Specified by:
getNestedResults in interface IResult

getNestedFieldNames

public java.util.Iterator getNestedFieldNames()
Specified by:
getNestedFieldNames in interface IResult

addNestedResults

public void addNestedResults(java.lang.String fieldName,
                             IResultSet nestedResults)
Specified by:
addNestedResults in interface IResult

setNestedResults

public void setNestedResults(java.lang.String fieldName,
                             IResultSet nestedResults)
Specified by:
setNestedResults in interface IResult

addNestedResult

public void addNestedResult(java.lang.String fieldName,
                            IResult nestedResult)
Specified by:
addNestedResult in interface IResult

getFieldNames

public java.util.Iterator getFieldNames()
Description copied from interface: IResult
returns an iterator of the field names.

Specified by:
getFieldNames in interface IResult

getDOM

public org.w3c.dom.Document getDOM(ILoginInfo userInfo)
Description copied from interface: IResult
return a DOM Document object with the field data.

Specified by:
getDOM in interface IResult

getXML

public java.lang.String getXML(ILoginInfo userInfo)
Specified by:
getXML in interface IResult

getXML

public java.lang.String getXML(ILoginInfo userInfo,
                               java.util.Iterator resultFields,
                               java.util.Iterator nestedFields)
Specified by:
getXML in interface IResult

getFullTextFormats

public java.lang.String[] getFullTextFormats(ILoginInfo userInfo)
Description copied from interface: IResult
returns a list of formats available for the "full text" electronic format formats can be text, html, pdf etc. IResult must determine which formats the SearchSource supports, and which formats are available to the user.

Specified by:
getFullTextFormats in interface IResult

writeFullText

public void writeFullText(ILoginInfo userInfo,
                          java.lang.String formatType,
                          java.io.OutputStream toStream)
Description copied from interface: IResult
filters the full text document for this result to the out put stream toStream. If access is restricted, userInfo is used to login.

Specified by:
writeFullText in interface IResult

toString

public java.lang.String toString()

addTree

public void addTree(java.lang.String name,
                    TreeRoot tree)
Description copied from interface: IResult
Methods to add/get associated TreeRoot objects.

Specified by:
addTree in interface IResult

getTreeNames

public java.util.Iterator getTreeNames()
Specified by:
getTreeNames in interface IResult

getTree

public TreeRoot getTree(java.lang.String name)
Specified by:
getTree in interface IResult

setTitleField

public void setTitleField(java.lang.String titleField)
Specified by:
setTitleField in interface IResult

getTitleField

public java.lang.String getTitleField()
Specified by:
getTitleField in interface IResult

setIDField

public void setIDField(java.lang.String idField)
Specified by:
setIDField in interface IResult

getIDField

public java.lang.String getIDField()
Specified by:
getIDField in interface IResult

setURLField

public void setURLField(java.lang.String URLField)
Specified by:
setURLField in interface IResult

getURLField

public java.lang.String getURLField()
Specified by:
getURLField in interface IResult