com.softwareag.centrasite.api.csom.search
Interface CSOSearch


public interface CSOSearch

This interface can be used to perform search operation on CentraSite Objects. It provides methods to set search scope, set conditions and view results.

CSOSearches are created via the CSOSearchManager. Once a CSOSearch is created, CSOSearchConditions, CSOSearchScope, the result attributes and the CSOSortSspecifier can be added.


Nested Class Summary
static class CSOSearch.SearchType
          Enumeration that differentiate the types of searches
 
Method Summary
 CSOSearchResult execute()
          Executes the search based on the given condition and scope
 java.util.Collection<CSOSearchCondition> getConditions()
          Returns the search conditions attached with the search object
 java.util.List<CSOSearchScope> getEffectiveSearchScopes()
          Returns the consolidated collection of search scopes based on the specified scopes The consolidation will be done based on whether a particular scope is a subset of another scope For example, If 'Everything' scope and 'User' scope are specified as scope, the effective scope would be only 'Everything', since User is a subset of Everything
 boolean getMatchAnySpecifier()
          Returns the value of the match-any specifier
 java.lang.String getName()
          Retrieve the name given for saving the search.
 java.util.Collection<CSOParameter> getParameters()
          Return the collection of CSOParameter which need to be set for the predefined report search to execute
 java.util.Collection<java.lang.String> getParameterTokens()
          Return the collection of parameter tokens which need to be set for the predefined search to execute
 java.util.Collection<CentraSiteObjectAttribute> getResultAttributes()
          Returns the search attributes which is configured already with the search
 CSOSearchScope getSearchScope()
          Deprecated. This method will be removed soon. Please use getSearchScopes()
 java.util.List<CSOSearchScope> getSearchScopes()
          Returns the collection of specified search scopes
 java.util.List<CSOSortSpecifier> getSortSpecifier()
          Assigns sort specifier to the CSOSearch
 CSOSearch.SearchType getType()
          Returns the type of search {Reporting/Normal/Parameterized}
 boolean removeResultAttribute(CentraSiteObjectAttribute attribute)
          Removes the specified CentraSiteObjectAttribute from the search
 boolean removeSearchCondition(CSOSearchCondition condition)
          Removes the specified condition from the search
 boolean removeSearchScope(CSOSearchScope scope)
          Removes the specified scope from the search
 boolean removeSortSpecifier(CSOSortSpecifier sortSpecifier)
          Removes the specified CSOSortSpecifier from the search.
 void setConditions(java.util.Collection<CSOSearchCondition> conditions)
          Attach the search condition with the search object
 void setMatchAnySpecifier(boolean matchAny)
          Sets the match-any specifier
 void setName(java.lang.String name)
          Set the given name to the search.
 void setParameter(java.lang.String paramToken, java.util.List<java.lang.Object> paramValues)
          Set the parameters for the predefined search.
 void setResultAttributes(java.util.Collection<CentraSiteObjectAttribute> resultAttributes)
          Sets the result attributes with the search object.
 void setSearchScope(CSOSearchScope searchScope)
          Deprecated. This method will be removed soon. Please use setSearchScopes()
 void setSearchScopes(java.util.List<CSOSearchScope> searchScopes)
          Sets the collection of scopes for the search
 void setSortSpecifier(java.util.List<CSOSortSpecifier> sortSpecifiers)
          Assigns sort specifier to the CSOSearch.
 java.util.Collection<CSOValidationInfo> validate()
          Validate the search, return the collection of validation objects
 

Method Detail

getName

java.lang.String getName()
Retrieve the name given for saving the search.

Returns:
name of Search

setName

void setName(java.lang.String name)
Set the given name to the search.


getType

CSOSearch.SearchType getType()
Returns the type of search {Reporting/Normal/Parameterized}

Returns:
Type of search {Reporting/Normal/Parameterized}

execute

CSOSearchResult execute()
                        throws CLLException
Executes the search based on the given condition and scope

Returns:
CSOSearchResult
Throws:
CLLException

getConditions

java.util.Collection<CSOSearchCondition> getConditions()
Returns the search conditions attached with the search object

Returns:
list of search condition

setConditions

void setConditions(java.util.Collection<CSOSearchCondition> conditions)
Attach the search condition with the search object

Parameters:
conditions -

getResultAttributes

java.util.Collection<CentraSiteObjectAttribute> getResultAttributes()
Returns the search attributes which is configured already with the search

Returns:
list of enabled search attributes

setResultAttributes

void setResultAttributes(java.util.Collection<CentraSiteObjectAttribute> resultAttributes)
Sets the result attributes with the search object. Search result will have only the configured result attribute with value

Parameters:
resultAttributes -

getSearchScope

CSOSearchScope getSearchScope()
Deprecated. This method will be removed soon. Please use getSearchScopes()

Returns search scope object which is configured with the search

Returns:
Search scope

getSearchScopes

java.util.List<CSOSearchScope> getSearchScopes()
Returns the collection of specified search scopes

Returns:
the collection of specified search scopes

setSearchScope

void setSearchScope(CSOSearchScope searchScope)
Deprecated. This method will be removed soon. Please use setSearchScopes()

Sets a single scope for the search

Parameters:
searchScope -

setSearchScopes

void setSearchScopes(java.util.List<CSOSearchScope> searchScopes)
Sets the collection of scopes for the search

Parameters:
searchScopes -

getEffectiveSearchScopes

java.util.List<CSOSearchScope> getEffectiveSearchScopes()
Returns the consolidated collection of search scopes based on the specified scopes The consolidation will be done based on whether a particular scope is a subset of another scope For example, If 'Everything' scope and 'User' scope are specified as scope, the effective scope would be only 'Everything', since User is a subset of Everything


getSortSpecifier

java.util.List<CSOSortSpecifier> getSortSpecifier()
Assigns sort specifier to the CSOSearch

Returns:
Collection of sort specifiers used in the current search

setSortSpecifier

void setSortSpecifier(java.util.List<CSOSortSpecifier> sortSpecifiers)
Assigns sort specifier to the CSOSearch.

Parameters:
sortSpecifiers - Collection of sortSpecifiers that needs to be set for the current search

getMatchAnySpecifier

boolean getMatchAnySpecifier()
Returns the value of the match-any specifier

Returns:
boolean flag indicating whether all or any of the SearchConditions needs to be met

setMatchAnySpecifier

void setMatchAnySpecifier(boolean matchAny)
Sets the match-any specifier

Parameters:
matchAny - A flag indicating whether all or any of the SearchConditions needs to be met.

setParameter

void setParameter(java.lang.String paramToken,
                  java.util.List<java.lang.Object> paramValues)
                  throws CLLException
Set the parameters for the predefined search.

Parameters:
paramToken - parameter name
paramValues - Collection of values
Throws:
CLLException - if at all the list of param values supplied is null | list of param values contains null

getParameterTokens

java.util.Collection<java.lang.String> getParameterTokens()
Return the collection of parameter tokens which need to be set for the predefined search to execute

Returns:
Collection of tokens that are present as part of current CSOSearch. empty collection if there are no parameters

getParameters

java.util.Collection<CSOParameter> getParameters()
Return the collection of CSOParameter which need to be set for the predefined report search to execute

Returns:
Collection of CSOParameter that are present as part of current CSOSearch. Returns empty collection if no such parameters set

validate

java.util.Collection<CSOValidationInfo> validate()
                                                 throws CLLException
Validate the search, return the collection of validation objects

Returns:
a list of CSOValidationInfo, empty in case of no faulty scope or conditions found in the search.
Throws:
CLLException - in case of failed to perform the validation.

removeSearchScope

boolean removeSearchScope(CSOSearchScope scope)
                          throws CLLException
Removes the specified scope from the search

Parameters:
scope - CSOSearchScope
Returns:
true If a CSOSearchScope was removed as a result of this call
Throws:
CLLException - in case of scope is null or failed to remove the given scope from the search.

removeSearchCondition

boolean removeSearchCondition(CSOSearchCondition condition)
                              throws CLLException
Removes the specified condition from the search

Parameters:
condition - CSOSearchCondition
Returns:
true If a CSOSearchCondition was removed as a result of this call
Throws:
CLLException - in case of scope is null or failed to remove the given scope from the search.

removeResultAttribute

boolean removeResultAttribute(CentraSiteObjectAttribute attribute)
                              throws CLLException
Removes the specified CentraSiteObjectAttribute from the search

Parameters:
attribute - faulty attribute specified in the result attributes CentraSiteObjectAttribute
Returns:
true if a CentraSiteObjectAttribute was removed from the result attribute list.
Throws:
CLLException - in case of attribute is null or trying to delete from the unspecified result attributes collection.

removeSortSpecifier

boolean removeSortSpecifier(CSOSortSpecifier sortSpecifier)
                            throws CLLException
Removes the specified CSOSortSpecifier from the search.

Parameters:
sortSpecifier - faulty sort specifier which contains the attribute that not belongs to specified scope.
Returns:
true if a CSOSortSpecifier was removed from the result attribute list.
Throws:
CLLException - in case of attribute is null or trying to delete from the unspecified CSOSortSpecifiers list.