|
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.CMBQueryService
The CMBQueryService bean provides EIP federated query functions. It is used implicitly by the CMBSearchTemplate bean to perform template-based searches on filled-in templates. It can also be called directly to perform searches using query strings. (See the Java API documentation for information on query string syntax.)
Searches may either be initiated through method calls or via events. When using methods:
setQueryString
.
runQuery
or runQueryWithCursor
methods to initiate
the search.
getResults
to obtain the results of synchronous searches. For
asynchronous searches, CMBSearchReplyEvents are generated.
An instance of CMBQueryService can be obtained from CMBConnection bean using
CMBConnection.getQueryService()
method.
Summary of properties and events:
imported properties traceEnabled, defaulting off, will not veto exported properties none standalone properties asynch, default is on, search is asynchronous timeout, default is off, no query timeout. maxResults, default is zero, unlimited interested in events CMBSConnectionReplyEvent - to get connection handle CMBSearchRequestEvent - to perform functions PropertyChangeEvent - to import traceEnabled source of events CMBSearchReplyEvent - to reply the request CMBExceptionEvent - to post exception CMBTraceEvent - to let logger trace
CMBConnection
,
CMBSearchTemplate
,
CMBSearchResults
, Serialized FormInner Class Summary | |
class |
CMBQueryService.QueryCriterion
This class defines a query criterion. |
class |
CMBQueryService.QueryParameter
This class defines a query parameter. |
Constructor Summary | |
CMBQueryService()
Creates a new instance of CMBQueryService object with default values |
Method Summary | |
void |
addCMBExceptionListener(CMBExceptionListener listener)
CMBExceptionEvent registration method. |
void |
addCMBSearchReplyListener(CMBSearchReplyListener aListener)
CMBSearchReplyEvent registration method. |
void |
addCMBTraceListener(CMBTraceListener listener)
CMBTraceEvent registration method. |
void |
cancelQuery()
Cancels the current requested query |
void |
clearQuery()
Clears the current query values |
java.lang.String |
generateQueryExpression(java.lang.String entityName,
CMBQueryService.QueryCriterion[] criteria,
short queryType,
boolean matchAllCriteria)
Generate a string which is the query expression for the given datastore type. |
int |
getCallbackThreshold()
Gets the callback threshold value |
CMBConnection |
getConnection()
Gets the connection bean reference. |
CMBExceptionEvent |
getExceptionEvent()
To support VisualCafe 3.0 "Add Interaction..." |
int |
getMaxResults()
Gets the maximum number of hits returned from each query. |
CMBSearchTemplate |
getQueryObject()
Gets a search template that has been set in this query service |
CMBQueryService.QueryParameter[] |
getQueryParameters()
Gets additional query parameters (for query string only) |
java.lang.String |
getQueryString()
Gets the query string currently being used by query service. |
short |
getQueryType()
Gets query type (for query string only) |
java.lang.Object |
getResults()
Gets the collection of result items |
CMBSearchReplyEvent |
getSearchReplyEvent()
To support VisualCafe 3.0 "Add Interaction..." |
int |
getTimeout()
Gets the search timeout |
CMBTraceEvent |
getTraceEvent()
To support VisualCafe 3.0 "Add Interaction..." |
boolean |
isAsynchSearch()
Checks to see if the query synchronous or asynchronous. |
boolean |
isMultiValueOperator(java.lang.String operator)
Determine if a given operator takes multi-value arguments. |
boolean |
isRangeOperator(java.lang.String operator)
Determine if a given operator is a range operator, meaning that it expects two values to search against: an upper and a lower bound. |
boolean |
isSearchCancelled()
Checks to see if the query has been cancelled |
boolean |
isTraceEnabled()
Checks to see if trace is enabled |
void |
onCMBConnectionReply(CMBConnectionReplyEvent evt)
Implementation of Connection reply service method. |
void |
onCMBSearchRequest(CMBSearchRequestEvent evt)
Implementation of search request service method. |
void |
removeCMBExceptionListener(CMBExceptionListener listener)
CMBExceptionEvent unregistration method. |
void |
removeCMBSearchReplyListener(CMBSearchReplyListener aListener)
CMBSearchReplyEvent unregistration method. |
void |
removeCMBTraceListener(CMBTraceListener listener)
CMBTraceEvent unregistration method. |
void |
runQuery()
Starts search. |
void |
runQuery(CMBSearchTemplate stObj)
Starts search with a given search template object |
void |
runQueryWithCursor()
Starts search with cursor. |
void |
runQueryWithCursor(CMBSearchTemplate stObj)
Starts search with cursor with a given search template object |
void |
setAsynchSearch(boolean asynch)
Sets the query option to be either synchronous or asynchronous |
void |
setCallbackThreshold(int value)
Sets to cancel the current query |
void |
setConnection(CMBConnection connBean)
Sets the connection bean reference. |
void |
setMaxResults(int max)
Sets the maximum number of hits returned from each query. |
void |
setQueryObject(CMBSearchTemplate stObj)
Sets search template before request a query service |
void |
setQueryString(java.lang.String qryString,
short qryType)
Sets the query string and type to be used for subsequent query operations |
void |
setQueryString(java.lang.String qryString,
short qryType,
CMBQueryService.QueryParameter[] qryParams)
Sets the query string, type, and parameters to be used for subsequent query operations |
void |
setTimeout(int timeout)
Sets the search timeout |
void |
setTraceEnabled(boolean enabled)
Sets to cancel the current query |
void |
vetoableChange(java.beans.PropertyChangeEvent evt)
Check if property allows to be changed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CMBQueryService()
Method Detail |
public void setConnection(CMBConnection connBean)
connBean
- the reference to the CMBConnection object.public CMBConnection getConnection()
public boolean isAsynchSearch()
public void setAsynchSearch(boolean asynch)
asynch
- if this value is true then the query will be done
asynchronously, and synchronously otherwise.public boolean isSearchCancelled()
public int getCallbackThreshold()
public void setCallbackThreshold(int value)
value
- the number of hits returned from the server(s) for each callbackpublic boolean isTraceEnabled()
public void setTraceEnabled(boolean enabled)
enabled
- If true, trace is enabled. If false, trace is disabled.public int getTimeout()
public void setTimeout(int timeout)
timeout
- maximum search time outpublic int getMaxResults()
public void setMaxResults(int max)
max
- maximum of number hits.public java.lang.String generateQueryExpression(java.lang.String entityName, CMBQueryService.QueryCriterion[] criteria, short queryType, boolean matchAllCriteria) throws CMBException
String
- entityName The entity the search will be performed onCMBQueryService.QueryCriterion[]
- criteria - An array of query criteria objects that describe
the criteria names, operators, values, and types for the search. The constructor for the QueryCriterion object
is as follows:
QueryCriterion(String criterionName, String operator, String[] values)
queryType
- The type of the query syntax. Must be one of the following:
boolean
- matchAllCriteria - A boolean value indicating whether to match
all criteria or any criteria on the search.
CMBQueryService.QueryCriterion
public boolean isMultiValueOperator(java.lang.String operator)
operator
- The operator to testpublic boolean isRangeOperator(java.lang.String operator)
operator
- The operator to testpublic void runQuery() throws CMBConnectFailedException, CMBNoConnectionException, CMBInvalidQueryException, CMBException
CMBNoConnectionException
- if there is no CMBConnection bean set.
Call setConnection() before calling any methods in this bean.CMBConnectFailedException
- if
CMBInvalidQueryException
- current query is not valid.CMBException
- if error occurred in the server while logging on.
Call CMBException.getErrorData() to get the original exception object.public void runQueryWithCursor() throws CMBConnectFailedException, CMBNoConnectionException, CMBInvalidQueryException, CMBException
CMBNoConnectionException
- if there is no CMBConnection bean set.
Call setConnection() before calling any methods in this bean.CMBConnectFailedException
- if
CMBInvalidQueryException
- if current query is not valid.CMBException
- if error occurred in the server while logging on.
Call CMBException.getErrorData() to get the original exception object.public void runQuery(CMBSearchTemplate stObj) throws CMBConnectFailedException, CMBNoConnectionException, CMBException
CMBNoConnectionException
- if there is no CMBConnection bean set.
Call setConnection() before calling any methods in this bean.CMBConnectFailedException
- if
CMBException
- if error occurred in the server while logging on.
Call CMBException.getErrorData() to get the original exception object.public void runQueryWithCursor(CMBSearchTemplate stObj) throws CMBConnectFailedException, CMBNoConnectionException, CMBException
stObj
- search template objectCMBNoConnectionException
- if there is no CMBConnection bean set.
Call setConnection() before calling any methods in this bean.CMBConnectFailedException
- if
CMBException
- if error occurred in the server while logging on.
Call CMBException.getErrorData() to get the original exception object.public void clearQuery()
public void cancelQuery() throws CMBNoConnectionException, CMBException
CMBNoConnectionException
- when there is no connectionCMBException
- if query is currently not set or server error.
If the exception came from the server, call CMBException.getErrorData()
to get original exception object.public java.lang.Object getResults() throws CMBNoConnectionException, CMBException
CMBNoConnectionException
- when there is no connectionCMBException
- if query is currently not set or server error.
If the exception came from the server, call CMBException.getErrorData()
to get original exception object.CMBSearchResults
public void setQueryString(java.lang.String qryString, short qryType)
qryString
- The query stringqryType
- The type of query syntax the string has.
public void setQueryString(java.lang.String qryString, short qryType, CMBQueryService.QueryParameter[] qryParams)
qryString
- The query stringqryType
- The type of query syntax the string has.
qryParams
- Additional query parameters as specified by the datastore type,
or null if no additional query parameters.public void setQueryObject(CMBSearchTemplate stObj)
stObj
- an instant of CMBSearchTemplate beanpublic java.lang.String getQueryString()
getQueryType
to get the query string format.public short getQueryType()
public CMBQueryService.QueryParameter[] getQueryParameters()
public CMBSearchTemplate getQueryObject()
public void onCMBConnectionReply(CMBConnectionReplyEvent evt)
onCMBConnectionReply
in interface CMBConnectionReplyListener
evt
- a CMBConnectionReplyEventpublic void onCMBSearchRequest(CMBSearchRequestEvent evt)
onCMBSearchRequest
in interface CMBSearchRequestListener
evt
- a CMBSearchRequestEventpublic void addCMBSearchReplyListener(CMBSearchReplyListener aListener)
aListener
- a CMBSearchReplyListener object to be addedpublic void removeCMBSearchReplyListener(CMBSearchReplyListener aListener)
aListener
- a listener to be unregisteredpublic 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 vetoableChange(java.beans.PropertyChangeEvent evt) throws java.beans.PropertyVetoException
evt
- a property changed eventjava.beans.PropertyVetoException
- if property value is invalidpublic CMBSearchReplyEvent getSearchReplyEvent()
public CMBTraceEvent getTraceEvent()
public CMBExceptionEvent getExceptionEvent()
|
EIP JavaBeans | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |