|
Enterprise Information Portal APIs |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mm.beans.CMBSearchResults
The CMBSearchResults bean manages search results. For asynchronous searches, CMBSearchResults listens to CMBSearchReplyEvents from CMBQueryService or CMBSearchTemplate. Alternatively, for synchronous searches, results can be passed from CMBQueryService to CMBSearchResults using the following logic:
searchResults.newResults(queryService.getResults());CMBSearchResults emits CMBResultEvent events when a page's number of hits are obtained (see
setPageSize
).
Methods on CMBSearchResults can also be used to read the results
individually, or obtain all hits as an array. CMBItem objects represent each
hit in the search results.
CMBSearchResults supports delayed attribute retrieval. For those servers that support multi-item retrieve (such as CMv8), this feature can be used to efficiently retrieve only attribute information for those hits being displayed to the user. The page size property determines the number of hits that will be retrieved at a time. When an attribute is read from any hit in the hit list, the attributes of that item, and all other items on that page, will be retrieved from the server.
Summary of properties and events:
imported properties traceEnabled, defaulting off, will not veto exported properties none standalone properties pageSize, currentHitItem interested in events CMBSConnectionReplyEvent - to get connection handle CMBSearchReplyEvent - to get results PropertyChangeEvent - to import traceEnabled source of events CMBResultEvent - to broadcast result changes CMBExceptionEvent - to post exception CMBTraceEvent - to let logger trace
Constructor Summary | |
CMBSearchResults()
Default constructor. |
Method Summary | |
void |
addCMBExceptionListener(CMBExceptionListener listener)
CMBExceptionEvent registration method. |
void |
addCMBResultListener(CMBResultListener listener)
CMBResultEvent registration method. |
void |
addCMBTraceListener(CMBTraceListener listener)
CMBTraceEvent registration method. |
void |
appendResults(java.lang.Object resultList)
Adds a new set of search results to current search results. |
void |
clearResults()
Clears current search results from memory. |
CMBConnection |
getConnection()
Gets the connection bean reference. |
int |
getCount()
Gets the total hit count. |
CMBHitItem |
getCurrentHitItem()
Gets the current hit item. |
CMBExceptionEvent |
getExceptionEvent()
Gets the exceptionEvent. |
CMBHitItem[] |
getHitItem()
Gets all the hit items from the search results. |
CMBHitItem |
getHitItem(int index)
Gets a specific hit item by index. |
CMBItem[] |
getItem()
Gets all the items from the search results. |
CMBItem |
getItem(int index)
Gets a specific item by index. |
CMBItem |
getItem(java.lang.String pidString)
Gets specified item. |
CMBItem[] |
getNewItem()
Gets the new items since the last time you asked for new items. |
CMBHitItem |
getNextHitItem()
Gets the next hit item. |
CMBHitItem[] |
getNextRangeHitItem(int range)
Gets the next range of hit item. |
int |
getPageSize()
Gets the default number of hit items in a page. |
java.lang.String |
getPidString()
Gets the current hit item ID. |
CMBResultEvent |
getResultEvent()
Gets the resultEvent. |
CMBTraceEvent |
getTraceEvent()
Gets the traceEvent. |
boolean |
isResultsComplete()
Returns whether the the results are complete. |
boolean |
isTraceEnabled()
Indicates if trace is enabled on the bean. |
void |
newResults(java.lang.Object resultObj)
Adds a new set of search results. |
void |
onCMBConnectionReply(CMBConnectionReplyEvent evt)
Implementation of connection reply service method: update the connection handle accordingly. |
void |
onCMBSearchReply(CMBSearchReplyEvent evt)
Implementation of search reply service method. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
On a property change, imports the traceEnabled property value. |
void |
removeCMBExceptionListener(CMBExceptionListener listener)
CMBExceptionEvent unregistration method. |
void |
removeCMBResultListener(CMBResultListener listener)
CMBResultEvent unregistration method. |
void |
removeCMBTraceListener(CMBTraceListener listener)
CMBTraceEvent unregistration method. |
void |
removeItem(int index)
Removes the hit item at the given index from the hit list. |
void |
resetCurrentHitItem()
Resets the current hit item to the first in the result list. |
void |
resetNewItemIndex()
Resets index of item returned from getNewItem() to the first item. |
void |
setConnection(CMBConnection conn)
Sets the connection handle from the CMBConnection bean. |
void |
setCurrentHitItem(CMBHitItem item)
Sets current hit item. |
void |
setCurrentSearchTemplate(CMBSearchTemplate stObj)
Sets the current search template object. |
void |
setPageSize(int newSize)
Sets the default number of hit items in a page. |
void |
setResultsComplete(boolean newResults)
Sets property flag indicating that results are complete. |
void |
setTraceEnabled(boolean newValue)
Sets whether trace is on or off. |
void |
sort(java.lang.String attribute,
boolean ascending)
Sorts the search results. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CMBSearchResults()
Method Detail |
public void onCMBConnectionReply(CMBConnectionReplyEvent evt)
onCMBConnectionReply
in interface CMBConnectionReplyListener
evt
- a CMBConnectionReplyEventpublic void onCMBSearchReply(CMBSearchReplyEvent evt)
onCMBSearchReply
in interface CMBSearchReplyListener
evt
- a CMBSearchReplyEventpublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
evt
- a property changed eventpublic void addCMBExceptionListener(CMBExceptionListener listener)
listener
- listener to be registeredpublic void removeCMBExceptionListener(CMBExceptionListener listener)
listener
- listener to be unregisteredpublic void addCMBTraceListener(CMBTraceListener listener)
listener
- listener to be registeredpublic void removeCMBTraceListener(CMBTraceListener listener)
listener
- listener to be unregisteredpublic void addCMBResultListener(CMBResultListener listener)
listener
- listener to be registeredpublic void removeCMBResultListener(CMBResultListener listener)
listener
- listener to be unregisteredpublic boolean isTraceEnabled()
public void setResultsComplete(boolean newResults)
newReusults
- new value of results complete flagpublic boolean isResultsComplete()
public void setTraceEnabled(boolean newValue)
newValue
- new trace option valuepublic int getPageSize()
public void setPageSize(int newSize)
newSize
- number of hit itemspublic void setConnection(CMBConnection conn)
conn
- reference of connection beanpublic CMBConnection getConnection()
public int getCount()
public void resetCurrentHitItem()
public CMBHitItem getCurrentHitItem() throws java.lang.ArrayIndexOutOfBoundsException, CMBException
index
- hit item location within current search resultsjava.lang.ArrayIndexOutOfBoundsException
- if index is invalidCMBException
- if there is an error occurred in the Content Server.
Call CMBException.getErrorData() to get the original exception object.public void setCurrentHitItem(CMBHitItem item) throws CMBException
item
- hit itemCMBException
- if item could not be found in the hit list.CMBException
- if there is an error occurred in the Content Server.
Call CMBException.getErrorData() to get the original exception object.public java.lang.String getPidString() throws java.lang.Exception
public CMBHitItem[] getHitItem() throws CMBException
CMBException
- if there is an error occurred in the Content Server.
Call CMBException.getErrorData() to get the original exception object.public CMBHitItem getHitItem(int index) throws java.lang.ArrayIndexOutOfBoundsException, CMBException
index
- hit item location within current search resultsjava.lang.ArrayIndexOutOfBoundsException
- if index is invalidCMBException
- if there is an error occurred in the Content Server.
Call CMBException.getErrorData() to get the original exception object.public CMBHitItem getNextHitItem() throws java.lang.ArrayIndexOutOfBoundsException, CMBException
index
- hit item location within current search results.java.lang.ArrayIndexOutOfBoundsException
- if index is invalid.CMBException
- if there is an error occurred in the Content Server.
Call CMBException.getErrorData() to get the original exception object.public CMBHitItem[] getNextRangeHitItem(int range) throws java.lang.ArrayIndexOutOfBoundsException, CMBException
range
- range of hit itemsjava.lang.ArrayIndexOutOfBoundsException
- if index is invalidCMBException
- if there is an error occurred in the Content Server.
Call CMBException.getErrorData() to get the original exception object.public CMBItem getItem(java.lang.String pidString)
pidString
- item IDpublic void resetNewItemIndex()
getNewItem()
to the first item.public CMBItem[] getNewItem()
index
- item location within current search resultsjava.lang.ArrayIndexOutOfBoundsException
- if index is invalidpublic CMBItem getItem(int index) throws java.lang.ArrayIndexOutOfBoundsException
index
- item location within current search resultsjava.lang.ArrayIndexOutOfBoundsException
- if index is invalidpublic CMBItem[] getItem()
public void removeItem(int index) throws java.lang.ArrayIndexOutOfBoundsException
index
- hit item location within current search results.java.lang.ArrayIndexOutOfBoundsException
- if index is invalid.CMBException
- if an error occurred in the Content Server.
Call CMBException.getErrorData() to get the original exception object.public void newResults(java.lang.Object resultObj) throws CMBNoConnectionException, CMBException
resultObj
- new search results as one of the following types which
is usually the returned type from CMBSearchTemplate.getResults() method.
CMBNoConnectionException
- if setConnection() method has not been called.CMBException
- when an error is received from servers. Call getErrorData() to get reference
to the original exception from OO API.CMBSearchTemplate
public void appendResults(java.lang.Object resultList) throws CMBNoConnectionException, CMBException
resultList
- new search results as one of the following types which
is usually the returned type from CMBSearchTemplate.getResults() method:
CMBNoConnectionException
- if setConnection() method has not been called.CMBException
- when an error is received from servers. Call getErrorData() to get reference
to the original exception from OO API.CMBSearchTemplate
public void clearResults()
public void setCurrentSearchTemplate(CMBSearchTemplate stObj) throws CMBNoConnectionException, CMBException, java.lang.IllegalArgumentException
stObj
- CMBSearchTemplate objectCMBNoConnectionException
- is thrown if CMBConnection bean is not already set.
setConnection() method needs to called first.java.lang.IllegalArgumentException
- is thrown when stObj is null.public void sort(java.lang.String attribute, boolean ascending)
attribute
- the name of the attribute to sort by.ascending
- if true, the sort will be ascending. If false, descending.public CMBResultEvent getResultEvent()
public CMBTraceEvent getTraceEvent()
public CMBExceptionEvent getExceptionEvent()
|
EIP JavaBeans | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |