Enterprise Information Portal APIs

com.ibm.mm.sdk.common
Class DKSearchTemplateFed

java.lang.Object
  |
  +--com.ibm.mm.sdk.common.DKSearchTemplateFed
All Implemented Interfaces:
DKConstant, DKConstantFed, DKMessageId, DKMessageIdFed, dkSearchTemplate, java.io.Serializable

public class DKSearchTemplateFed
extends java.lang.Object
implements dkSearchTemplate, DKConstantFed, DKMessageIdFed, java.io.Serializable

This class represents a query object.

See Also:
Serialized Form

Fields inherited from interface com.ibm.mm.sdk.common.DKConstantFed
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKConstant
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageIdFed
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageId
    For details, see the class or interface
 
Constructor Summary
DKSearchTemplateFed()
          Creates a new instance of DKSearchTempleteFed object with default values.
DKSearchTemplateFed(dkDatastore ds)
          Creates a new instance of DKSearchTempleteFed object associated with the given datastore object.
 
Method Summary
 void add()
          Adds this search template to the datastore, i.e.
 void add(DKSearchCriteria newCrit)
          Adds a new search criteria to this search template, make the criteria persistent.
 void addCriteria(DKSearchCriteria newCrit)
          Adds a new search criteria to this search template.
 void addGroup(java.lang.String name, short access)
          Adds a new group name who can access this search template
 void addUser(java.lang.String name, short access)
          Adds a new user name who can access this search template
 void clearCache()
          Clears all current cache data
 DKCQExpr createQueryExpr()
          Creates compound query expression objects, ready for execution by the datastore execute method.
 void del()
          Deletes this search template from the datastore.
 void del(java.lang.String name)
          Remove a search criteria from this search template.
 java.lang.String getAssocFedEntity(java.lang.String fedTextEntityName)
          Gets the associated federate entity for the federate text entity.
 java.lang.String getAssocFedTextEntity(java.lang.String fedParmEntityName)
          Gets the associated federate text entity for the federate entity.
 java.lang.String getAssociatedEntityName()
          Gets the associated entity name associated with this query DK_FED_MAPPED_ENTITY (will support text and parametric query)
 DKSearchCriteria getCriteria(java.lang.String critName)
          Retrieves a search criteria for a given criteria name from memory only.
 dkDatastore getDatastore()
          Gets the reference to the owner datastore object
 java.lang.String getDescription()
          Gets the search template description
 java.lang.String getEntityName()
          Gets the entity name associated with this query
 java.lang.String getFolderName()
          Gets the folder name for this search template
 short getId()
          Gets search template id
 java.lang.String getName()
          Gets the name of this query
 DKNVPair getOption(int position)
          Gets an option at the given position.
 DKNVPair getOption(java.lang.String name)
          Gets an option with a given name.
 DKNVPair[] getOptionList()
           
 short getParametricOp()
          Gets the current defined operator between search criteria.
 java.lang.String getParmWildcard()
          Gets the wild card of parametric search.
 short getServerParticipation()
          Gets the server participation option.
 int[] getSortOrders()
          Gets the list of sorting orders.
 java.lang.String getTextMultiCharWildcard()
          Gets the multiple characters wild card of text search.
 java.lang.String getTextSingleCharWildcard()
          Gets the single character wild card for text search.
 java.lang.String[] listAllAttrDisplayNames()
          Gets a list of all attribute names of parametric search in a search template
 java.lang.String[] listAttrDisplayNames()
          Gets the list of attributes you want to display in the results.
 dkCollection listCriteria()
          Gets a list of search criteria of this search template
 java.lang.String[] listCriteriaNames()
          Gets a list of search criteria names including parametric, text & qbic
 java.lang.String[] listDisplayNames()
          Gets a list of search results column names
 java.lang.String[] listGroups()
          Gets a list of groups that have access to this search template
 java.lang.String[] listParmCriteriaNames()
          Gets a list of parametric search criteria names
 java.lang.String[] listSearchableCriteriaNames()
          Gets a list of searchable criteria names that is the combination of searchable parametric & text criterion
 java.lang.String[] listTextCriteriaNames()
          Gets a list of text search criteria names
 java.lang.String[] listUsers()
          Gets a list of userids that have access to this search template
 int optionCount()
          Gets the number of defined options.
 void removeCriteria(java.lang.String critName)
          Remove a search criteria from this search template.
 void removeGroup(java.lang.String name)
          Removes a group name from the access list of this search template
 void removeOption(int position)
          Removes the option at the given position.
 int removeOption(java.lang.String name)
          Removes the option with the given name.
 void removeUser(java.lang.String name)
          Removes a user name from the access list of this search template
 void retrieve()
          Retrieves this search template from the datastore.
 DKSearchCriteria retrieve(java.lang.String critName)
          Retrieves a search criteria from a given name.
 void setAssociatedEntityName(java.lang.String assocEntityName)
          Sets the associated entity name associated with this query DK_FED_MAPPED_ENTITY (will support text and parametric query) This federated entity needs to be text searchable
 void setDatastore(dkDatastore ds)
          Sets the reference to the datastore object
 void setDescription(java.lang.String desc)
          Sets the description for this search template
 void setEntityName(java.lang.String entityName)
          Sets the entity name associated with this query
 void setFolderName(java.lang.String folderName)
          Sets the folder name for this search template
 void setId(short id)
          Sets search template id
 void setName(java.lang.String newName)
          Sets the name of this query
 void setOption(int position, DKNVPair optionPair)
          Sets the option at the given position.
 int setOption(java.lang.String name, java.lang.Object value)
          Sets the option with the given name.
 void setOptionList(DKNVPair[] optionList)
           
 void setParametricOp(short allOp)
          Sets the operator between search criteria.
 void setParmWildcard(java.lang.String wildcard)
          Sets the wild card for parametric search.
 void setServerParticipation(short serverP)
          Sets the server participation option.
 void setSortOrders(int[] sortOrders)
          Sets the list of sorting orders for query.
 void setTextMultiCharWildcard(java.lang.String wildcard)
          Sets the multiple characters wild card for text search.
 void setTextSingleCharWildcard(java.lang.String wildcard)
          Sets the single character wild card for text search.
 void update()
          Updates this search template in the datastore.
 void update(DKSearchCriteria crit)
          Update the specifed criteria of this search template, make the criteria persistent.
 void updateCriteria(DKSearchCriteria crit)
          Update this criteria.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.mm.sdk.common.dkSearchTemplate
createQuery
 

Constructor Detail

DKSearchTemplateFed

public DKSearchTemplateFed()
Creates a new instance of DKSearchTempleteFed object with default values.

DKSearchTemplateFed

public DKSearchTemplateFed(dkDatastore ds)
                    throws DKException,
                           java.lang.Exception
Creates a new instance of DKSearchTempleteFed object associated with the given datastore object.
Method Detail

getName

public java.lang.String getName()
Gets the name of this query
Specified by:
getName in interface dkSearchTemplate
Returns:
name of this query object

setName

public void setName(java.lang.String newName)
Sets the name of this query
Specified by:
setName in interface dkSearchTemplate
Parameters:
name - name of this query

getDescription

public java.lang.String getDescription()
Gets the search template description
Specified by:
getDescription in interface dkSearchTemplate
Returns:
template description

setDescription

public void setDescription(java.lang.String desc)
Sets the description for this search template
Specified by:
setDescription in interface dkSearchTemplate
Parameters:
desc - template description

getFolderName

public java.lang.String getFolderName()
Gets the folder name for this search template
Returns:
a folder name

setFolderName

public void setFolderName(java.lang.String folderName)
Sets the folder name for this search template
Parameters:
folderName - folder name

getServerParticipation

public short getServerParticipation()
Gets the server participation option. Default is DK_CM_ALL_SERVERS.
Returns:
the server participation option.

setServerParticipation

public void setServerParticipation(short serverP)
Sets the server participation option. Default is DK_CM_ALL_SERVERS.

The valid options are:

Parameters:
serverP - the server participation option.

setTextSingleCharWildcard

public void setTextSingleCharWildcard(java.lang.String wildcard)
Sets the single character wild card for text search.
Parameters:
wildcard - the single character wild card in text search

getTextSingleCharWildcard

public java.lang.String getTextSingleCharWildcard()
Gets the single character wild card for text search.
Returns:
the single character wild card in text search

setTextMultiCharWildcard

public void setTextMultiCharWildcard(java.lang.String wildcard)
Sets the multiple characters wild card for text search.
Parameters:
wildcard - the multiple characters wild card in text search

getTextMultiCharWildcard

public java.lang.String getTextMultiCharWildcard()
Gets the multiple characters wild card of text search.
Returns:
the multiple characters wild card in text search

setParmWildcard

public void setParmWildcard(java.lang.String wildcard)
Sets the wild card for parametric search.
Parameters:
wildcard - the parametric search wild card

getParmWildcard

public java.lang.String getParmWildcard()
Gets the wild card of parametric search.
Returns:
the parametric search wild card

getId

public short getId()
Gets search template id
Specified by:
getId in interface dkSearchTemplate
Returns:
search template id

setId

public void setId(short id)
Sets search template id
Specified by:
setId in interface dkSearchTemplate
Parameters:
id - search template id

getEntityName

public java.lang.String getEntityName()
Gets the entity name associated with this query
Specified by:
getEntityName in interface dkSearchTemplate
Returns:
name of entity name

setEntityName

public void setEntityName(java.lang.String entityName)
Sets the entity name associated with this query
Specified by:
setEntityName in interface dkSearchTemplate
Parameters:
entityName - entity name

getAssociatedEntityName

public java.lang.String getAssociatedEntityName()
Gets the associated entity name associated with this query DK_FED_MAPPED_ENTITY (will support text and parametric query)
Returns:
name of associated entity name

setAssociatedEntityName

public void setAssociatedEntityName(java.lang.String assocEntityName)
Sets the associated entity name associated with this query DK_FED_MAPPED_ENTITY (will support text and parametric query) This federated entity needs to be text searchable
Parameters:
assocEntityName - associated entity name

add

public void add()
         throws DKException,
                java.lang.Exception
Adds this search template to the datastore, i.e. make this query persistent.
Specified by:
add in interface dkSearchTemplate

del

public void del()
         throws DKException,
                java.lang.Exception
Deletes this search template from the datastore. The in-memory copy is not affected.
Specified by:
del in interface dkSearchTemplate

update

public void update()
            throws DKException,
                   java.lang.Exception
Updates this search template in the datastore.
Specified by:
update in interface dkSearchTemplate

retrieve

public void retrieve()
              throws DKException,
                     java.lang.Exception
Retrieves this search template from the datastore. You need to set the search template name before calling this method. If this template doesnt' exist in the Fed. database, an DKUsageError exception with template name specified will be thrown. This method do not retrieve the related criteria
Specified by:
retrieve in interface dkSearchTemplate

add

public void add(DKSearchCriteria newCrit)
         throws DKException
Adds a new search criteria to this search template, make the criteria persistent.
Specified by:
add in interface dkSearchTemplate
Parameters:
newCrit - new search criteria to be added.
Throws:
DKException - if error occurs in the server

update

public void update(DKSearchCriteria crit)
            throws DKException
Update the specifed criteria of this search template, make the criteria persistent. (you can not update the criteria name)
Specified by:
update in interface dkSearchTemplate
Parameters:
crit - new search criteria values
Throws:
DKException - if error occurs in the server

del

public void del(java.lang.String name)
         throws DKException
Remove a search criteria from this search template.
Specified by:
del in interface dkSearchTemplate
Parameters:
name - name of search criteria to be removed from memory copy.
Throws:
DKException - when error occurs when removing this search criterion

retrieve

public DKSearchCriteria retrieve(java.lang.String critName)
                          throws DKException
Retrieves a search criteria from a given name.
Specified by:
retrieve in interface dkSearchTemplate
Parameters:
critName - a search criteria name to be retrieved
Throws:
DKException, - Exception if error occurs

getDatastore

public dkDatastore getDatastore()
Gets the reference to the owner datastore object
Specified by:
getDatastore in interface dkSearchTemplate
Returns:
the dkDatastore object

setDatastore

public void setDatastore(dkDatastore ds)
Sets the reference to the datastore object
Specified by:
setDatastore in interface dkSearchTemplate
Parameters:
ds - reference to datastore

addCriteria

public void addCriteria(DKSearchCriteria newCrit)
                 throws DKException
Adds a new search criteria to this search template. Memory only function.
Specified by:
addCriteria in interface dkSearchTemplate
Parameters:
newCrit - new search criteria to be added.
Throws:
DKException - if error occurs in the server

updateCriteria

public void updateCriteria(DKSearchCriteria crit)
                    throws DKException
Update this criteria. Memory only function
Specified by:
updateCriteria in interface dkSearchTemplate
Parameters:
crit - new search criteria values
Throws:
DKException - if error occurs in the server

removeCriteria

public void removeCriteria(java.lang.String critName)
                    throws DKException
Remove a search criteria from this search template. Memory only function
Specified by:
removeCriteria in interface dkSearchTemplate
Parameters:
critName - name of search criteria to be removed from memory copy.
Throws:
DKException - when error occurs when removing this search criterion

getCriteria

public DKSearchCriteria getCriteria(java.lang.String critName)
                             throws DKException
Retrieves a search criteria for a given criteria name from memory only.
Specified by:
getCriteria in interface dkSearchTemplate
Parameters:
critName - a search criteria name
Returns:
a DKSearchCriteria object representing the search criteria

listCriteria

public dkCollection listCriteria()
                          throws DKException
Gets a list of search criteria of this search template
Specified by:
listCriteria in interface dkSearchTemplate
Returns:
a collection of search criteria

listCriteriaNames

public java.lang.String[] listCriteriaNames()
                                     throws DKException
Gets a list of search criteria names including parametric, text & qbic
Specified by:
listCriteriaNames in interface dkSearchTemplate
Returns:
a collection of search criteria names including parametric, text & qbic

listTextCriteriaNames

public java.lang.String[] listTextCriteriaNames()
                                         throws DKException,
                                                java.lang.Exception
Gets a list of text search criteria names
Returns:
a collection of text search criteria names

listParmCriteriaNames

public java.lang.String[] listParmCriteriaNames()
                                         throws DKException,
                                                java.lang.Exception
Gets a list of parametric search criteria names
Returns:
a collection of parametric search criteria names

listDisplayNames

public java.lang.String[] listDisplayNames()
                                    throws DKException
Gets a list of search results column names
Specified by:
listDisplayNames in interface dkSearchTemplate
Returns:
a collection of search results column names

listSearchableCriteriaNames

public java.lang.String[] listSearchableCriteriaNames()
                                               throws DKException
Gets a list of searchable criteria names that is the combination of searchable parametric & text criterion
Specified by:
listSearchableCriteriaNames in interface dkSearchTemplate
Returns:
a collection of searchable criteria names

setParametricOp

public void setParametricOp(short allOp)
Sets the operator between search criteria. Default is DK_CM_ALL_AND
Specified by:
setParametricOp in interface dkSearchTemplate
Parameters:
allOp - one the following values:
  • DK_CM_OP_ALL_ANDS
  • DK_CM_OP_ALL_ORS
  • DK_CM_OP_MIXED

getParametricOp

public short getParametricOp()
Gets the current defined operator between search criteria.
Specified by:
getParametricOp in interface dkSearchTemplate
Returns:
one of the following values:
  • DK_CM_OP_ALL_ANDS
  • DK_CM_OP_ALL_ORS
  • DK_CM_OP_MIXED

getSortOrders

public int[] getSortOrders()
Gets the list of sorting orders. This method is called by the server only.
Specified by:
getSortOrders in interface dkSearchTemplate
Returns:
an array of sorting orders for the query.

setSortOrders

public void setSortOrders(int[] sortOrders)
Sets the list of sorting orders for query.
Specified by:
setSortOrders in interface dkSearchTemplate
Parameters:
sortOrders - an array of sorting orders for this query.

addUser

public void addUser(java.lang.String name,
                    short access)
             throws DKException
Adds a new user name who can access this search template
Specified by:
addUser in interface dkSearchTemplate
Parameters:
name - user name which already defined in this federated server.
access - whether it is read only, updatable, or full access

addGroup

public void addGroup(java.lang.String name,
                     short access)
              throws DKException
Adds a new group name who can access this search template
Specified by:
addGroup in interface dkSearchTemplate
Parameters:
name - group name which already defined in this federated server.
access - whether it is read only, updatable, or full access

removeUser

public void removeUser(java.lang.String name)
                throws DKException
Removes a user name from the access list of this search template
Specified by:
removeUser in interface dkSearchTemplate
Parameters:
name - userid name to be removed

removeGroup

public void removeGroup(java.lang.String name)
                 throws DKException
Removes a group name from the access list of this search template
Specified by:
removeGroup in interface dkSearchTemplate
Parameters:
name - group name to be removed

listUsers

public java.lang.String[] listUsers()
                             throws DKException
Gets a list of userids that have access to this search template
Specified by:
listUsers in interface dkSearchTemplate
Returns:
an array of userids

listGroups

public java.lang.String[] listGroups()
                              throws DKException
Gets a list of groups that have access to this search template
Specified by:
listGroups in interface dkSearchTemplate
Returns:
an array of group names

createQueryExpr

public DKCQExpr createQueryExpr()
                         throws DKException
Creates compound query expression objects, ready for execution by the datastore execute method.
Specified by:
createQueryExpr in interface dkSearchTemplate
Following copied from interface: com.ibm.mm.sdk.common.dkSearchTemplate
Parameters:
serverName - the name of the destination server.
Returns:
an array of DKCQExpr objects, or null if destination server is unknown.

listAllAttrDisplayNames

public java.lang.String[] listAllAttrDisplayNames()
                                           throws DKException
Gets a list of all attribute names of parametric search in a search template

listAttrDisplayNames

public java.lang.String[] listAttrDisplayNames()
                                        throws DKException
Gets the list of attributes you want to display in the results.

optionCount

public int optionCount()
Gets the number of defined options.
Returns:
integer number of options

getOptionList

public DKNVPair[] getOptionList()

setOptionList

public void setOptionList(DKNVPair[] optionList)

getOption

public DKNVPair getOption(int position)
Gets an option at the given position.
Throws:
java.lang.IndexOutOfBoundsException - if position is invalid.

getOption

public DKNVPair getOption(java.lang.String name)
Gets an option with a given name.
Returns:
the option with the given name; or null if it is not found.

setOption

public void setOption(int position,
                      DKNVPair optionPair)
Sets the option at the given position.
Parameters:
optionPair - the new option
Throws:
java.lang.IndexOutOfBoundsException - if position is invalid.

setOption

public int setOption(java.lang.String name,
                     java.lang.Object value)
Sets the option with the given name. The option will be added, if it does not exist yet; otherwise it will be updated.
Returns:
the position of the option.

removeOption

public void removeOption(int position)
Removes the option at the given position.
Parameters:
the - position.
Throws:
java.lang.IndexOutOfBoundsException - if position is invalid.

removeOption

public int removeOption(java.lang.String name)
Removes the option with the given name.
Parameters:
name - the option name.
Returns:
the position; -1 if not found.

getAssocFedEntity

public java.lang.String getAssocFedEntity(java.lang.String fedTextEntityName)
                                   throws DKException,
                                          java.lang.Exception
Gets the associated federate entity for the federate text entity.
Parameters:
fedTextEntityName - the federate text entity
Returns:
the associated federate entity
Throws:
DKException, - Exception if error occurs

getAssocFedTextEntity

public java.lang.String getAssocFedTextEntity(java.lang.String fedParmEntityName)
                                       throws DKException,
                                              java.lang.Exception
Gets the associated federate text entity for the federate entity.
Parameters:
fedParmEntityName - the federate entity
Returns:
the associated federate text entity
Throws:
DKException, - Exception if error occurs

clearCache

public void clearCache()
                throws DKException,
                       java.lang.Exception
Clears all current cache data
Specified by:
clearCache in interface dkSearchTemplate

EIP Java APIs

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