org.openspml.message
Class SearchResponse

java.lang.Object
  |
  +--org.openspml.message.SpmlResponse
        |
        +--org.openspml.message.SearchResponse

public class SearchResponse
extends SpmlResponse

A class used to represent a searchResponse element.


Fields inherited from class org.openspml.message.SpmlResponse
ERROR_CUSTOM_ERROR, ERROR_MALFORMED_REQUEST, ERROR_NO_SUCH_IDENTIFIER, ERROR_NO_SUCH_REQUEST, ERROR_UNSUPPORTED_IDENTIFIER_TYPE, ERROR_UNSUPPORTED_OPERATION, RESULT_FAILURE, RESULT_PENDING, RESULT_SUCCESS
 
Constructor Summary
SearchResponse()
           
 
Method Summary
 void addResult(SearchResult sr)
           
 java.util.List getResults()
           
 void removeAttributes(java.util.List names)
          Remove response attributes with certain names.
 void setResults(java.util.List l)
           
 void sort()
           
 void sort(java.lang.String attname)
          Convenience method to sort the list of SearchResult objects.
 
Methods inherited from class org.openspml.message.SpmlResponse
addExtendedErrorMessage, createResponseForRequest, createResponseForRequest, dumpFile, getError, getErrorMessage, getExtendedErrorMessages, getOperationalAttribute, getOperationalAttributes, getOperationalAttributeValue, getRequestId, getResult, isFailure, parseResponse, parseResponse, parseResponse, removeOperationalAttribute, setError, setErrorMessage, setErrorMessage, setOperationalAttribute, setOperationalAttribute, setOperationalAttributes, setOperationalAttributes, setRequestId, setResult, throwErrors, toXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchResponse

public SearchResponse()
Method Detail

setResults

public void setResults(java.util.List l)

addResult

public void addResult(SearchResult sr)

getResults

public java.util.List getResults()

sort

public void sort(java.lang.String attname)
Convenience method to sort the list of SearchResult objects. If the attribute name is "identifier", the sort will be based on the _identifer field of the SearchResult, otherwise by one of the Attributes returned in the result. This can be used for display purposes but is also handy for unit tests since the XML will be emitted in a predictable order for comparison against expected results.

sort

public void sort()

removeAttributes

public void removeAttributes(java.util.List names)
Remove response attributes with certain names. This can be used with unit tests to remove attributes with non-deterministic values like dates or generated passwords, prior to the serialization of the response. The xml can then be compared against an expected result captured at another time.