|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.itim.apps.search.SearchResultsMO
Provides access to an authorized and sortable set of DirectoryObject which may be traversed on a page by page basis. A SearchResultsMO is usually the result of executing a search through a SearchMO and provides access to sets of DirectoryObject in sequential pages through getPage(int pageNo) where pageNo may be equal to (but not greater than) the value returned by getPageCount() if the last page in the set is needed. A SearchResultsMO may be sorted given the name of an attribute whose value to sort the set by and one of SearchMO.ASCENDING_SORT or SearchMO.DESCENDING_SORT to indicate a low to high or high to low sort order. The sort function is provided by sortResults(). Because the SearchResultsMO itself does not hold the result set but instead maintains a reference to a stateful session EJB hosted by the server whose state does include the result set of DirectoryObject, close() provides clients an explicit way to free up EJB resources (i.e., to remove the stateful bean instance) and a way to reclaim server memory after traversal of the set is complete.
Field Summary | |
---|---|
com.ibm.itim.apps.impl.PlatformContextImpl |
platform
The PlatformContext holding platfor connection information. |
javax.security.auth.Subject |
subject
The Subject representing the authenticated caller. |
Constructor Summary | |
---|---|
SearchResultsMO(PlatformContext platform,
javax.security.auth.Subject subject)
Constructs the the managed object with a platform context and a subject. |
Method Summary | |
---|---|
void |
close()
Releases this SearchResultsMO EJB resources (removes the stateful session bean instance associated with this SearchResultsMO). |
java.util.Collection |
getPage(int pageNo)
Returns the specified page of the result set. |
int |
getPageCount()
Returns the number of pages in the result set. |
int |
getPageCount(int lookaheadLimit)
Returns the number of available pages up to a look-ahead limit. |
java.util.Collection |
getResults()
Returns all of the results. |
SearchResultsStatus |
getSearchResultsStatus()
Gets the SearchResultsStatus. |
void |
reverseSortResults()
Reverses the the sorting order of the search results. |
void |
setSearchResults(java.util.Collection results)
Holds the given results in this SearchResultsMO |
void |
setSearchResultsStatus(SearchResultsStatus sResultsStatus)
Sets the SearchResultsStatus. |
void |
sortResults(java.lang.String attribute,
int order)
Resorts by the given sort attribute and order (ascending vs descending). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public javax.security.auth.Subject subject
public com.ibm.itim.apps.impl.PlatformContextImpl platform
Constructor Detail |
public SearchResultsMO(PlatformContext platform, javax.security.auth.Subject subject)
platform
- PlatformContext holding platform connection information.subject
- Subject representing the authenticated caller.Method Detail |
public void setSearchResults(java.util.Collection results) throws java.rmi.RemoteException, ApplicationException
results
- Collection of DirectoryObjectEntity
java.rmi.RemoteException
- thrown if unable to communicate with the
platform
ApplicationException
- if an error prevents the given
results from being associated with a SearchAuthority
bean instance.public int getPageCount() throws java.rmi.RemoteException, ApplicationException, java.lang.IllegalStateException
Performance Note: Users of this method should note that in many cases, the page count cannot be determined by the system without loading the complete result set from the underlying database or directory. This can lead to performance and scaling problems when the result set size is very large. If there is reason to believe that the result set could be large then it is recommended that users take advantage of the getPageCount(int lookaheadLimit) method that allows an upper bound on the amount of lookahead that the system will perform to determine the page count.
java.rmi.RemoteException
- Thrown if unable to communicate with platform.
ApplicationException
- is thrown if a server-side error prevents
this method from returning the number of pages in the result set.
java.lang.IllegalStateException
- if the underlying EJB resource(s) are
unavailable. This generally means that the handle for the
server EJB cannot be found.getPageCount(int)
public int getPageCount(int lookaheadLimit) throws java.rmi.RemoteException, ApplicationException, java.lang.IllegalStateException
lookaheadLimit
- The number of pages to advance through the result
set in order to determine the available page count.
java.rmi.RemoteException
- Thrown if unable to communicate with platform.
ApplicationException
- If there is a problem performing this operation
at the server.
java.lang.IllegalStateException
- if the underlying EJB resource(s) are
unavailable. This generally means that the handle for the
server EJB cannot be found.getPageCount()
public java.util.Collection getPage(int pageNo) throws java.rmi.RemoteException, ApplicationException, java.lang.IllegalStateException
pageNo
- The number of the page to return.
java.rmi.RemoteException
- Thrown if unable to communicate with platform.
ApplicationException
- If there is a problem performing this operation
at the server.
java.lang.IllegalStateException
- if the underlying EJB resource(s) are
unavailable. This generally means that the handle for the
server EJB cannot be found.public java.util.Collection getResults() throws java.rmi.RemoteException, ApplicationException, java.lang.IllegalStateException
java.rmi.RemoteException
- Thrown if unable to communicate with platform.
ApplicationException
- If there is a problem performing this operation
at the server.
java.lang.IllegalStateException
- if the underlying EJB resource(s) are
unavailable. This generally means that the handle for the
server EJB cannot be found.public void sortResults(java.lang.String attribute, int order) throws java.rmi.RemoteException, ApplicationException, java.lang.IllegalStateException
attribute
- Name of the attribute to sort by.order
- Enumeration of the order to sort by. Value may be either
SearchMO.ASCENDING_SORT or SearchMO.DESCENDING_SORT.
java.rmi.RemoteException
- Thrown if unable to communicate with platform.
ApplicationException
- Thrown if unable to resort. This is most
likely caused by either an invalid sort attribute name or
invalid sort order.
java.lang.IllegalStateException
- if the underlying EJB resource(s) are
unavailable. This generally means that the handle for the
server EJB cannot be found.public void reverseSortResults() throws java.rmi.RemoteException, ApplicationException, java.lang.IllegalStateException
java.rmi.RemoteException
- Thrown if unable to communicate with platform.
ApplicationException
- Thrown if unable to resort. This is most
likely caused by either an invalid sort attribute name or
invalid sort order.
java.lang.IllegalStateException
- if the underlying EJB resource(s) are
unavailable. This generally means that the handle for the
server EJB cannot be found.public void close() throws java.rmi.RemoteException, ApplicationException
java.rmi.RemoteException
- Thrown if unable to communicate with platform.
ApplicationException
- Thrown if unable to resort. This is most
likely caused by either an invalid sort attribute name or
invalid sort order.public void setSearchResultsStatus(SearchResultsStatus sResultsStatus)
sResultsStatus
- A SearchResultsStatus instance, or null of not
applicable to the search request.public SearchResultsStatus getSearchResultsStatus()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |