Enterprise Information Portal APIs

com.ibm.mm.beans
Class CMBSearchTemplate

java.lang.Object
  |
  +--com.ibm.mm.beans.CMBSearchTemplate
All Implemented Interfaces:
CMBConnectionReplyListener, CMBSearchRequestListener, java.util.EventListener, java.io.Serializable, java.beans.VetoableChangeListener

public class CMBSearchTemplate
extends java.lang.Object
implements java.io.Serializable, java.beans.VetoableChangeListener, CMBConnectionReplyListener, CMBSearchRequestListener

The CMBSearchTemplate bean provides template-based search functions. Instances of CMBSearchTemplate are obtained from the CMBSchemaManagement bean. Search criteria can then be filled in and a search performed using this bean.

Summary of properties and events:

   imported properties   traceEnabled, defaulting off, will not veto
   exported properties   none
   standalone properties asynchSearch: default is on, search is asynchronous
                         timeout: default is off, no query timeout.
                         skipServer: default is CMB_ST_SKIP_WITH_PROMPT
                         textSingleCharWildcard: default is "?"
                         textMultiCharsWildcard: default is "*"
                         parmFieldWildcard: default is "%"
   listener to events    CMBConnectionReplyEvent  - to get connection handle
                         CMBSearchRequestEvent    - to perform search functions
                         PropertyChangeEvent      - to import traceEnabled
   source of events      CMBSearchReplyEvent      - to send search results to listeners
                         CMBExceptionEvent        - to post an exception
                         CMBTraceEvent            - to add info to the trace log
 

Since:
6.1
See Also:
CMBConnection, CMBSchemaManagement, Serialized Form

Constructor Summary
CMBSearchTemplate()
          Creates a new instance of CMBSearchTemplate object with default values.
 
Method Summary
 void addCMBExceptionListener(CMBExceptionListener listener)
          The CMBExceptionEvent registration method.
 void addCMBSearchReplyListener(CMBSearchReplyListener aListener)
          The CMBSearchReplyEvent registration method.
 void addCMBTraceListener(CMBTraceListener listener)
          The CMBTraceEvent registration method.
 void addSTCriterion(CMBSTCriterion newCrit, boolean isQueryable, boolean isDisplayable)
          Adds new CMBSTCriterion object to this search template
 void cancelQuery()
          Cancels the current requested query.
 void clearQuery()
          Clears the current query values.
 java.util.Vector getAllCriteria()
          Gets a list of all criteria, both search criteria and display criteria.
 CMBConnection getConnection()
          Gets the connection bean reference.
 short getCriterionDefaultOp(java.lang.String critName)
          Gets the search criterion's default search operator.
 java.lang.String[] getCriterionDefaultValues(java.lang.String critName)
          Gets a list of default search values of a given search criterion name.
 java.lang.String[] getCriterionDisplayName()
          Gets a list of display attribute names.
 java.lang.String getCriterionDisplayName(int index)
          Gets the index for a criterion's display name.
 java.lang.String getCriterionDisplayName(java.lang.String critName)
          Gets the display name for a search criterion.
 java.lang.String[] getCriterionName()
          Gets a list of criteria names including search and display criteria.
 java.lang.String getCriterionName(int index)
          Gets the name of search criterion at index.
 java.lang.String[] getCriterionPredefinedValues(java.lang.String critName)
          Gets the list of predefined values.
 short[] getCriterionValidOps(java.lang.String critName)
          Gets the list of valid search operators.
 java.util.Vector getDisplayCriteria()
          Gets a list of ordered display criteria.
 CMBSTCriterion getDisplayCriterion(int index)
          Gets a display criteria at index
 java.lang.String getEntityName()
          Gets the name of the federated entity associated with this search template.
 CMBExceptionEvent getExceptionEvent()
          To support VisualCafe 3.0 "Add Interaction..."
 java.lang.String getItemAttrName()
          Gets the default attribute name to be use as the item name
 int getMaxResults()
          Gets the maximum number of hits returned from each query.
 java.lang.String getName()
          Gets the search template name.
 java.lang.String getParmFieldWildcard()
          Gets the wildcard character for parametric search.
 java.lang.Object getResults()
          Gets the collection of result items.
 java.util.Vector getSearchCriteria()
          Gets a list of search criteria in order.
 CMBSTCriterion[] getSearchCriterion()
          Gets a list of search criteria in order.
 CMBSTCriterion getSearchCriterion(int index)
          Gets a search criteria at index.
 short getSearchCriterionOperator(java.lang.String critName)
          Gets the search operator.
 java.lang.String[] getSearchCriterionValues(java.lang.String critName)
          Gets the search criteria values.
 CMBSearchReplyEvent getSearchReplyEvent()
          To support VisualCafe 3.0 "Add Interaction..."
 short getSkipServer()
          Gets the skipServer property.
 java.lang.String getTextMultiCharsWildcard()
          Gets the multiple characters wildcard for text search.
 java.lang.String getTextSingleCharWildcard()
          Gets the single character wildcard for text search.
 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 isTraceEnabled()
          Checks to see if trace is enabled.
 java.lang.String[] listSearchCriteriaNames()
          Gets a list of criteria names including searchable and displayable.
 java.lang.String[] listServersSkipped()
          Gets a list of skipped server names for the previous search.
 void onCMBConnectionReply(CMBConnectionReplyEvent evt)
          Implementation of the connection reply service method.
 void onCMBSearchRequest(CMBSearchRequestEvent evt)
          Implementation of the search request service method.
 void removeCMBExceptionListener(CMBExceptionListener listener)
          The CMBExceptionEvent unregistration method.
 void removeCMBSearchReplyListener(CMBSearchReplyListener aListener)
          The CMBSearchReplyEvent unregistration method.
 void removeCMBTraceListener(CMBTraceListener listener)
          The CMBTraceEvent unregistration method.
 void removeSTCriterion(java.lang.String critName)
          Removes a CMBSTCriterion object from this search template.
 void runQuery()
          Starts a search.
 CMBSearchResults runQueryAndGetResults()
          Starts a search - for use in a program and JSP.
 CMBResultSetCursor runQueryWithCursor()
          Starts a search with cursor.
 void setAsynchSearch(boolean asynch)
          Sets the query option to be either synchronous or asynchronous.
 void setConnection(CMBConnection connObj)
          Sets the connection bean reference.
 void setEntityName(java.lang.String name)
          Sets the federated entity associated with this search template.
 void setMaxResults(int max)
          Sets the maximum number of hits returned from each query.
 void setName(java.lang.String name)
          Sets the search template name.
 void setParmFieldWildcard(java.lang.String wildcard)
          Sets the wildcard character for parametric search.
 void setSearchCriterion(java.lang.String critName, short searchOp, java.lang.String[] values)
          Sets the values for the search criteria.
 void setSkipServer(short option)
          Sets the skipServer property.
 void setTextMultiCharsWildcard(java.lang.String wildcard)
          Sets multiple characters wildcard for text search.
 void setTextSingleCharWildcard(java.lang.String wildcard)
          Sets single character wildcard for text search.
 void setTimeout(int timeout)
          Sets the search timeout.
 void setTraceEnabled(boolean enabled)
          Sets to cancel the current query.
 void skipServer(java.lang.String serverName)
          Skips the given server and continues with the search.
 java.lang.String toString()
          Return a meaningful string representation of the bean
 void vetoableChange(java.beans.PropertyChangeEvent evt)
          Checks if a property allows being changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CMBSearchTemplate

public CMBSearchTemplate()
Creates a new instance of CMBSearchTemplate object with default values.
Method Detail

setConnection

public void setConnection(CMBConnection connObj)
Sets the connection bean reference. This method must be called before any additional functions in this bean can be utilized.
Parameters:
connObj - the reference to the CMBConnection object.

getConnection

public CMBConnection getConnection()
Gets the connection bean reference.
Returns:
the reference to the CMBConnection object.

getName

public java.lang.String getName()
Gets the search template name.
Returns:
name the search template

setName

public void setName(java.lang.String name)
Sets the search template name.
Parameters:
name - the name of the search template

setEntityName

public void setEntityName(java.lang.String name)
                   throws CMBException
Sets the federated entity associated with this search template.
Parameters:
name - federated entity name
Throws:
CMBException - when error occurs in the server

getEntityName

public java.lang.String getEntityName()
                               throws CMBException
Gets the name of the federated entity associated with this search template.
Returns:
federated entity name
Throws:
CMBException - when error occurs at the content server

isAsynchSearch

public boolean isAsynchSearch()
Checks to see if the query synchronous or asynchronous. Default valuse is true, i.e., the query will be done asynchronously.
Returns:
true if search is asynchronous and false otherwise

setAsynchSearch

public void setAsynchSearch(boolean asynch)
Sets the query option to be either synchronous or asynchronous.
Parameters:
asynch - if this value is true then the query will be done asynchronously, and synchronously otherwise.

getTextSingleCharWildcard

public java.lang.String getTextSingleCharWildcard()
Gets the single character wildcard for text search. This method returns a blank string if wildcards are not supported.
Returns:
single char wildcard

setTextSingleCharWildcard

public void setTextSingleCharWildcard(java.lang.String wildcard)
Sets single character wildcard for text search. This is only used by federated search templates; other search templates do not support setting wildcards.
Parameters:
wildcard - single character wildcard
See Also:
DKSearchTemplateFed

getTextMultiCharsWildcard

public java.lang.String getTextMultiCharsWildcard()
Gets the multiple characters wildcard for text search. This method returns a blank string if wildcards are not supported.
Returns:
multiple characters wildcard

setTextMultiCharsWildcard

public void setTextMultiCharsWildcard(java.lang.String wildcard)
Sets multiple characters wildcard for text search. This is only used by federated search templates; other search templates do not support setting wildcards.
Parameters:
wildcard - multiple characters wildcard
See Also:
DKSearchTemplateFed

getParmFieldWildcard

public java.lang.String getParmFieldWildcard()
Gets the wildcard character for parametric search. This method returns a blank string if wildcards are not supported.
Returns:
parametric wildcard

setParmFieldWildcard

public void setParmFieldWildcard(java.lang.String wildcard)
Sets the wildcard character for parametric search. This is only used by federated search templates; other search templates do not support setting wildcards.
Parameters:
wildcard - parametric field wildcard
See Also:
DKSearchTemplateFed

isTraceEnabled

public boolean isTraceEnabled()
Checks to see if trace is enabled.
Returns:
true if trace is enabled, false otherwise

setTraceEnabled

public void setTraceEnabled(boolean enabled)
Sets to cancel the current query.
Parameters:
cancelled - if true, cancel the current query

getTimeout

public int getTimeout()
Gets the search timeout.
Returns:
timeout

setTimeout

public void setTimeout(int timeout)
Sets the search timeout.
Parameters:
timeout - maximum search time out

getSkipServer

public short getSkipServer()
Gets the skipServer property.
Returns:
short value of one of the following:
  • CMB_ST_SKIP_ALWAYS
  • CMB_ST_SKIP_NEVER
  • CMB_ST_SKIP_WITH_PROMPT

setSkipServer

public void setSkipServer(short option)
Sets the skipServer property.
Parameters:
option - skip server value

getMaxResults

public int getMaxResults()
Gets the maximum number of hits returned from each query.
Returns:
the maximum number of hits. Default is -1, no maximum.

setMaxResults

public void setMaxResults(int max)
Sets the maximum number of hits returned from each query. If it is a federated search, this is the maximum hits from each of the content servers that participate in the search. Default is -1, all hits will be returned.

Note: if you are running your query against Extended Search servers, you must set this maximum value in order to get reasonable query performance.

Parameters:
max - maximum of number hits.

skipServer

public void skipServer(java.lang.String serverName)
Skips the given server and continues with the search.
Parameters:
serverName - name of the server to skip

listServersSkipped

public java.lang.String[] listServersSkipped()
Gets a list of skipped server names for the previous search.
Returns:
an array of server names

runQuery

public void runQuery()
              throws CMBConnectFailedException,
                     CMBNoConnectionException,
                     CMBInvalidQueryException,
                     CMBException
Starts a search.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBConnectFailedException - if
  • CMB_CONNECT_INVALID_USERID_PASSWD: invalid user ID/password
  • CMB_CONNECT_SERVER_UNAVAILABLE: server was not available or an error occur at the server while logging on
CMBInvalidQueryException - if this there is a malformed search operator/values.
CMBException - if an error occurred at the server while logging on. Call CMBException.getErrorData() to get the original exception object.

runQueryWithCursor

public CMBResultSetCursor runQueryWithCursor()
                                      throws CMBConnectFailedException,
                                             CMBNoConnectionException,
                                             CMBInvalidQueryException,
                                             CMBException
Starts a search with cursor.
Returns:
CMBResultSetCursor object.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBConnectFailedException - if
  • CMB_CONNECT_INVALID_USERID_PASSWD: invalid userID/password
  • CMB_CONNECT_SERVER_UNAVAILABLE: server was not available or an error occur at the server while logging on
CMBInvalidQueryException - if this there is a malformed search operator/values.
CMBException - if an error occurred at the server while logging on. Call CMBException.getErrorData() to get the original exception object.

runQueryAndGetResults

public CMBSearchResults runQueryAndGetResults()
                                       throws CMBConnectFailedException,
                                              CMBNoConnectionException,
                                              CMBInvalidQueryException,
                                              CMBException
Starts a search - for use in a program and JSP. This assumes synchronous search with result set cursor.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBConnectFailedException - if
  • CMB_CONNECT_INVALID_USERID_PASSWD: invalid user ID/password
  • CMB_CONNECT_SERVER_UNAVAILABLE: server was not available or an error occur at server while logging on
CMBInvalidQueryException - if this there is a malformed search operator/values.
CMBException - if an error occurred at the server while logging on. Call CMBException.getErrorData() to get the original exception object.

clearQuery

public void clearQuery()
Clears the current query values.

cancelQuery

public void cancelQuery()
                 throws CMBException,
                        CMBNoConnectionException
Cancels the current requested query.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - if an error occurred at the server while logging on. Call CMBException.getErrorData() to get the original exception object.

getResults

public java.lang.Object getResults()
Gets the collection of result items.
Returns:
a search results in one of the following type:
  • Vector: if it is asynchronous search. It's a vector of com.ibm.mm.sdk.common.DKDDO objects.
  • com.ibm.mm.sdk.common.DKResults: if it is a synchronous search. CMBSearchResults will know how to handle this results collection type. Therefore you do not need to understand DKResults object, just hand it to CMBSearchResults.newResults() or CMBSearchResults.appendResults() to handle.
  • CMBResultSetCursor - if it is a search with result set cursor
See Also:
CMBSearchResults

getSearchCriterionValues

public java.lang.String[] getSearchCriterionValues(java.lang.String critName)
                                            throws CMBNoConnectionException,
                                                   CMBException
Gets the search criteria values.
Parameters:
critName - name of search attribute
Returns:
an array of one or more search values for this search attribute. If yhe search attribute name is invalid, a empty array is returned.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getSearchCriterionOperator

public short getSearchCriterionOperator(java.lang.String critName)
                                 throws CMBNoConnectionException,
                                        CMBException
Gets the search operator.
Parameters:
critName - name of search attribute
Returns:
the search operator. If the search attribute name is invalid, -1 is returned.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

setSearchCriterion

public void setSearchCriterion(java.lang.String critName,
                               short searchOp,
                               java.lang.String[] values)
                        throws CMBNoConnectionException,
                               CMBException,
                               java.lang.IllegalArgumentException
Sets the values for the search criteria.
Parameters:
critName - name of search attribute
searchOp - search operator
values - an array of one or more search values
Throws:
java.lang.IllegalArgumentException - if the search criterion name is invalid.
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getCriterionName

public java.lang.String[] getCriterionName()
                                    throws CMBNoConnectionException,
                                           CMBException
Gets a list of criteria names including search and display criteria.
Returns:
an array of criteria names
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

listSearchCriteriaNames

public java.lang.String[] listSearchCriteriaNames()
                                           throws CMBNoConnectionException,
                                                  CMBException
Gets a list of criteria names including searchable and displayable.
Returns:
an array of criteria names. Empty array will be returned if there no criteria.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getCriterionName

public java.lang.String getCriterionName(int index)
                                  throws java.lang.ArrayIndexOutOfBoundsException,
                                         CMBNoConnectionException,
                                         CMBException
Gets the name of search criterion at index.
Parameters:
index - index of search orders
Returns:
name of search criterion; null is returned if this template has no criteria.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.
java.lang.ArrayIndexOutOfBoundsException - if index is invalid

getCriterionDisplayName

public java.lang.String[] getCriterionDisplayName()
                                           throws CMBNoConnectionException,
                                                  CMBException
Gets a list of display attribute names.
Returns:
an array of display names. An empty array is returned if there is no display criteria.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getCriterionDisplayName

public java.lang.String getCriterionDisplayName(int index)
                                         throws java.lang.ArrayIndexOutOfBoundsException,
                                                CMBNoConnectionException,
                                                CMBException
Gets the index for a criterion's display name.
Parameters:
index - index of display orders
Returns:
display name of a criterion
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getCriterionDisplayName

public java.lang.String getCriterionDisplayName(java.lang.String critName)
                                         throws CMBNoConnectionException,
                                                CMBException
Gets the display name for a search criterion.
Parameters:
critName - criterion name
Returns:
display name of a search criterion. Null will be returned if critName is invalid.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred from the Content Server. Call CMBException.getErrorData() to get the original exception object.

getCriterionDefaultOp

public short getCriterionDefaultOp(java.lang.String critName)
                            throws CMBNoConnectionException,
                                   CMBException
Gets the search criterion's default search operator.
Parameters:
critName - name of search criterion
Returns:
default search operator; -1 is returned if search criterion name is invalid.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getCriterionValidOps

public short[] getCriterionValidOps(java.lang.String critName)
                             throws CMBNoConnectionException,
                                    CMBException
Gets the list of valid search operators.
Parameters:
critName - name of search criterion
Returns:
an array of valid search operators. If the input search criterion name is invalid, the array is empty.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getCriterionDefaultValues

public java.lang.String[] getCriterionDefaultValues(java.lang.String critName)
                                             throws CMBNoConnectionException,
                                                    CMBException
Gets a list of default search values of a given search criterion name.
Parameters:
critName - name of search criterion
Returns:
an array of default search values. If the input search criterion name is invalid, the array is empty.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getCriterionPredefinedValues

public java.lang.String[] getCriterionPredefinedValues(java.lang.String critName)
                                                throws CMBNoConnectionException,
                                                       CMBException
Gets the list of predefined values.
Parameters:
critName - name of search criterion
Returns:
an array of predefined values. If the input search criterion name is invalid, the array is empty.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getAllCriteria

public java.util.Vector getAllCriteria()
                                throws CMBNoConnectionException,
                                       CMBException
Gets a list of all criteria, both search criteria and display criteria.
Returns:
a vector of CMBSTCriterion objects. If there are no critera, an empty vector will be returned.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getSearchCriteria

public java.util.Vector getSearchCriteria()
                                   throws CMBNoConnectionException,
                                          CMBException
Gets a list of search criteria in order.
Returns:
a collection of CMBSTCriterion objects
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getDisplayCriteria

public java.util.Vector getDisplayCriteria()
                                    throws CMBNoConnectionException,
                                           CMBException
Gets a list of ordered display criteria. This method returns a collection of criteria objects.
Returns:
a vector of criteria objects.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getSearchCriterion

public CMBSTCriterion[] getSearchCriterion()
                                    throws CMBNoConnectionException,
                                           CMBException
Gets a list of search criteria in order.
Returns:
an array of CMBSTCriterion objects. If there is no criterion, an empty array is returned.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getSearchCriterion

public CMBSTCriterion getSearchCriterion(int index)
                                  throws java.lang.ArrayIndexOutOfBoundsException,
                                         CMBNoConnectionException,
                                         CMBException
Gets a search criteria at index.
Parameters:
index - search order index - zero-based
Returns:
a search criterion object
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
java.lang.ArrayIndexOutOfBoundsException - if index i is invalid
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

getDisplayCriterion

public CMBSTCriterion getDisplayCriterion(int index)
                                   throws java.lang.ArrayIndexOutOfBoundsException,
                                          CMBNoConnectionException,
                                          CMBException
Gets a display criteria at index
Parameters:
index - display order index
Returns:
a display criterion object
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
java.lang.ArrayIndexOutOfBoundsException - if index is invalid
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred from the Content Server. Call CMBException.getErrorData() to get the original exception object.

addSTCriterion

public void addSTCriterion(CMBSTCriterion newCrit,
                           boolean isQueryable,
                           boolean isDisplayable)
                    throws CMBNoConnectionException,
                           CMBException
Adds new CMBSTCriterion object to this search template
Parameters:
newCrit - new search criterion object
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred from the Content Server. Call CMBException.getErrorData() to get the original exception object.

removeSTCriterion

public void removeSTCriterion(java.lang.String critName)
                       throws CMBNoConnectionException,
                              CMBException
Removes a CMBSTCriterion object from this search template.
Parameters:
critName - search criterion name to be removed.
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred at the content server. Call CMBException.getErrorData() to get the original exception object.

onCMBConnectionReply

public void onCMBConnectionReply(CMBConnectionReplyEvent evt)
Implementation of the connection reply service method.
Specified by:
onCMBConnectionReply in interface CMBConnectionReplyListener
Parameters:
evt - a CMBConnectionReplyEvent

onCMBSearchRequest

public void onCMBSearchRequest(CMBSearchRequestEvent evt)
Implementation of the search request service method.
Specified by:
onCMBSearchRequest in interface CMBSearchRequestListener
Parameters:
evt - a CMBSearchRequestEvent

addCMBSearchReplyListener

public void addCMBSearchReplyListener(CMBSearchReplyListener aListener)
The CMBSearchReplyEvent registration method. This method adds a new listener object to listener list.
Parameters:
aListener - a CMBSearchReplyListener object to be added

removeCMBSearchReplyListener

public void removeCMBSearchReplyListener(CMBSearchReplyListener aListener)
The CMBSearchReplyEvent unregistration method. This method removes the registration for a search reply listener.
Parameters:
aListener - a listener to be unregistered

addCMBExceptionListener

public void addCMBExceptionListener(CMBExceptionListener listener)
The CMBExceptionEvent registration method. This method ignores a registration request if the listener is already registered.
Parameters:
listener - listener to be registered

removeCMBExceptionListener

public void removeCMBExceptionListener(CMBExceptionListener listener)
The CMBExceptionEvent unregistration method. This method removes the registration for an exception listener.
Parameters:
listener - listener to be unregistered

addCMBTraceListener

public void addCMBTraceListener(CMBTraceListener listener)
The CMBTraceEvent registration method. This method ignores a registration request if the listener is already registered.
Parameters:
listener - listener to be registered

removeCMBTraceListener

public void removeCMBTraceListener(CMBTraceListener listener)
The CMBTraceEvent unregistration method. This method removes the registration for a trace listener.
Parameters:
listener - listener to be unregistered

vetoableChange

public void vetoableChange(java.beans.PropertyChangeEvent evt)
                    throws java.beans.PropertyVetoException
Checks if a property allows being changed.
Specified by:
vetoableChange in interface java.beans.VetoableChangeListener
Parameters:
evt - a property changed event
Throws:
java.beans.PropertyVetoException - if property value is invalid

getSearchReplyEvent

public CMBSearchReplyEvent getSearchReplyEvent()
To support VisualCafe 3.0 "Add Interaction..."
Returns:
a CMBSearchReplyEvent

getTraceEvent

public CMBTraceEvent getTraceEvent()
To support VisualCafe 3.0 "Add Interaction..."
Returns:
a CMBTraceEvent

getExceptionEvent

public CMBExceptionEvent getExceptionEvent()
To support VisualCafe 3.0 "Add Interaction..."
Returns:
a CMBExceptionEvent

getItemAttrName

public java.lang.String getItemAttrName()
                                 throws CMBNoConnectionException,
                                        CMBException
Gets the default attribute name to be use as the item name
Returns:
attribute name
Throws:
CMBNoConnectionException - if there is no CMBConnection bean set. Call setConnection() before calling any methods in this bean.
CMBException - will be thrown for the following errorCode form CMBException.getErrorCode():
  • CMBException.CMB_ERR_TEMPLATE_NOT_EXIST: if this template does not exist in the content server.
  • CMBException.CMB_ERR_SERVER_EXCEPTION: error has occurred from the Content Server. Call CMBException.getErrorData() to get the original exception object.

toString

public java.lang.String toString()
Return a meaningful string representation of the bean
Overrides:
toString in class java.lang.Object

EIP JavaBeans

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.