public class RASPolicySearchQuery extends BaseSearchQuery
Following code snippet illustrates how to build a search criteria to search by the DisplayName
RASPolicySearchQuery query = new RASPolicySearchQuery(RASPolicySearchQuery.SEARCH_PROPERTY.DISPLAY_NAME,
false, ComparatorType.EQUALITY, "DisplayName Value to searchBy", BaseSearchQuery.MATCHER.EXACT);
getRASPolycies ( query );
To build more complex search criteria, use the Constructor for complex search query.
Consider the following example to search AttributeCollections by a specific description and display name. Obviously, the two criteria (below) have to be AND-ed.
List<RASPolicySearchQuery> list = new ArrayList<RASPolicySearchQuery>();
list.add(new RASPolicySearchQuery( RASPolicySearchQuery.SEARCH_PROPERTY.DISPLAY_NAME,
false, ComparatorType.EQUALITY, "The Display Name", BaseSearchQuery.MATCHER.EXACT));
list.add(new RASPolicySearchQuery( RASPolicySearchQuery.SEARCH_PROPERTY.DESCRIPTION,
false, ComparatorType.EQUALITY, "The Description", BaseSearchQuery.MATCHER.EXACT));
RASPolicySearchQuery query = new RASPolicySearchQuery(list, false, false);
Similarly, we can have two criteria OR-ed as below.
List<RASPolicySearchQuery> list = new ArrayList<RASPolicySearchQuery>();
list.add(new RASPolicySearchQuery( RASPolicySearchQuery.SEARCH_PROPERTY.DISPLAY_NAME,
false, ComparatorType.EQUALITY, "The Display Name", BaseSearchQuery.MATCHER.EXACT));
list.add(new RASPolicySearchQuery( RASPolicySearchQuery.SEARCH_PROPERTY.DESCRIPTION,
false, ComparatorType.EQUALITY, "The Description", BaseSearchQuery.MATCHER.EXACT));
RASPolicySearchQuery query = new RASPolicySearchQuery(list, false, true);
| Modifier and Type | Class and Description |
|---|---|
static class |
RASPolicySearchQuery.SEARCH_PROPERTY
Criteria to search policies By
|
SearchQuery.MATCHER| Constructor and Description |
|---|
RASPolicySearchQuery(java.util.List<RASPolicySearchQuery> queries, boolean negation, boolean isORMatch)
Constructor for a complex RAS Policy Search Query
|
RASPolicySearchQuery(RASPolicySearchQuery.SEARCH_PROPERTY property, boolean negation, ComparatorType operator, java.lang.Object valueObject, SearchQuery.MATCHER match)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
RASPolicySearchQuery.SEARCH_PROPERTY |
getSearchByProperty()
get the search by property in this search query
|
RASPolicySearchQuery[] |
getSearchQueryInOrder()
Get the child search query in this search query.
|
boolean |
isPolicyObjectBasedOnly()
if the search query is based on the Policy object based properties, namely - Name, Display Name, Description, RAS_PARAMETERVALUE and ACL_MATCH_TYPE only
|
getBaseSearchQueryInOrder, getComparator, getEntityType, getQueries, toStringaddBaseQuery, getPageInfo, getPreparedQueryId, getSearchByPropertyString, getSearchByValue, getSearchByValueObject, getSearchComparator, getSearchQueries, getSearchValueMatch, hasPageInfo, isANDMatch, isComplexQuery, isNegativeMatch, isORMatch, setPageInfo, setPreparedQueryId, unsetPageInfopublic RASPolicySearchQuery(RASPolicySearchQuery.SEARCH_PROPERTY property, boolean negation, ComparatorType operator, java.lang.Object valueObject, SearchQuery.MATCHER match) throws InvalidArgumentException
property - search propertynegation - whether the query result must be negatedoperator - comparison operator, See ComparatorType for list of valid values.valueObject - the search objectmatch - matcher type, please refer to SearchQuery.MATCHER for details.InvalidArgumentExceptionpublic RASPolicySearchQuery(java.util.List<RASPolicySearchQuery> queries, boolean negation, boolean isORMatch)
childQueries - child queries for the complex query.negation - whether the query result must be negated.isORMatch - whether the child queries are an OR match.public RASPolicySearchQuery.SEARCH_PROPERTY getSearchByProperty()
public RASPolicySearchQuery[] getSearchQueryInOrder()
public boolean isPolicyObjectBasedOnly()