Skip navigation links

Oracle Fusion Middleware Management Java API Reference for Oracle Entitlements Server
11g Release 2 (11.1.2)

E27155-01 ESAPI


oracle.security.jps.service.policystore.search
Class PermissionSetSearchQuery

java.lang.Object
  extended by oracle.security.jps.search.SearchQuery
      extended by oracle.security.jps.service.policystore.search.BaseSearchQuery
          extended by oracle.security.jps.service.policystore.search.PermissionSetSearchQuery


public class PermissionSetSearchQuery
extends BaseSearchQuery

A Class to build search criterias to query PermissionSets.

Following code snippet illustrates how to build a search criteria to search by the DisplayName

  PermissionSetSearchQuery query = new PermissionSetSearchQuery(PermissionSetSearchQuery.SEARCH_PROPERTY.DISPLAY_NAME,
    false, ComparatorType.EQUALITY, "DisplayName Value to searchBy", BaseSearchQuery.MATCHER.EXACT);
 getPermissionSets ( query );
 

Consider the following example to search PermissionSets by a specific Resource Name (instance). A Resource Name is of a specific Resource type, hence two the criterias (below) have to be AND-ed.

  List<PermissionSetSearchQuery> list = new ArrayList<PermissionSetSearchQuery>();
  list.add(new PermissionSetSearchQuery( PermissionSetSearchQuery.SEARCH_PROPERTY.RESOURCE_TYPE,
    false, ComparatorType.EQUALITY, "The ResourceType Value", BaseSearchQuery.MATCHER.EXACT);
  
  list.add(new PermissionSetSearchQuery( PermissionSetSearchQuery.SEARCH_PROPERTY.RESOURCE_NAME,
    false, ComparatorType.EQUALITY, "The Resource Name Value", BaseSearchQuery.MATCHER.EXACT);
 
  PermissionSetSearchQuery query = new PermissionSetSearchQuery(list, false, false); 
 

To query PermissionSets that have 2 OR-ed conditions, the following query should be used

  List<PermissionSetSearchQuery> list = new ArrayList<PermissionSetSearchQuery>();
  list.add(new PermissionSetSearchQuery( PermissionSetSearchQuery.SEARCH_PROPERTY.RESOURCE_NAME,
    false, ComparatorType.EQUALITY, "The Resource Name Value 2", BaseSearchQuery.MATCHER.EXACT);
  
  list.add(new PermissionSetSearchQuery( PermissionSetSearchQuery.SEARCH_PROPERTY.RESOURCE_NAME,
    false, ComparatorType.EQUALITY, "The Resource Name Value 1", BaseSearchQuery.MATCHER.EXACT);
 
  PermissionSetSearchQuery query_r1 = new PermissionSetSearchQuery(list, false, false); 
 

We only support two query scenarios if the query is based on SEARCH_PROPERTY.RESOURCE_NAME_EXPRESSION.
1. A simple RESOURCE_NAME based query
2. A complex query with one RESOURCE_TYPE based child query and one RESOURCE_NAME based child query

Resource name expression based permission sets can be queried out in below scenarios:
1. If MATCHER.EXACT is set and search value matches the expression, the expression based permission set is returned.
For example, given two permission sets:
PermSet1 = {<"http://www.oracle.com", "GET">}, PermSet2 = {<"http://.*", "GET">}
PermissionSetSearchQuery(SEARCH_PROPERTY.RESOURCE_NAME_EXPRESSION, false, ComparatorType.EQUALITY, "http://www.oracle.com", MATCHER.EXACT) returns both PermSet1 and PermSet2
2. If MATCHER.BEGINS_WITH is set and the expression begins with search value (literally), the expression based permission set is returned.
For example, given two permission sets:
PermSet1 = {<"http://www.oracle.com", "GET">}, PermSet2 = {<"http://.*", "GET">}
PermissionSetSearchQuery(SEARCH_PROPERTY.RESOURCE_NAME_EXPRESSION, false, ComparatorType.EQUALITY, "http://", MATCHER.BEGINS_WITH) returns both PermSet1 and PermSet2
3. If MATCHER.BEGINS_WITH is set and the expression ends with search value (literally), the expression based permission set is returned.
For example, given two permission sets:
PermSet1 = {<"http://www.oracle.com", "GET">}, PermSet2 = {<"http://.*", "GET">}
PermissionSetSearchQuery(SEARCH_PROPERTY.RESOURCE_NAME_EXPRESSION, false, ComparatorType.EQUALITY, ".com", MATCHER.ENDS_WITH) returns PermSet1
4. If MATCHER.BEGINS_WITH is set and the expression contains search value (literally), the expression based permission set is returned.
For example, given two permission sets:
PermSet1 = {<"http://www.oracle.com", "GET">}, PermSet2 = {<"http://.*", "GET">}
PermissionSetSearchQuery(SEARCH_PROPERTY.RESOURCE_NAME_EXPRESSION, false, ComparatorType.EQUALITY, "ttp", MATCHER.CONTAINED_IN) returns both PermSet1 and PermSet2


Nested Class Summary
static class PermissionSetSearchQuery.SEARCH_PROPERTY
          Criteria to search a PermissionSet By

 

Nested classes/interfaces inherited from class oracle.security.jps.search.SearchQuery
SearchQuery.MATCHER

 

Constructor Summary
PermissionSetSearchQuery(java.util.List<PermissionSetSearchQuery> queries, boolean negation, boolean isORMatch)
          Constructor
PermissionSetSearchQuery(PermissionSetSearchQuery.SEARCH_PROPERTY property, boolean negation, ComparatorType operator, java.lang.Object valueObject, SearchQuery.MATCHER match)
          Constructor
PermissionSetSearchQuery(PermissionSetSearchQuery.SEARCH_PROPERTY property, boolean negation, ComparatorType operator, java.lang.String value, SearchQuery.MATCHER match)
          Constructor

 

Method Summary
 PermissionSetSearchQuery.SEARCH_PROPERTY getSearchByProperty()
          get the search by property in this search query
 PermissionSetSearchQuery[] getSearchQueryInOrder()
          Get the child search query in this search query.

 

Methods inherited from class oracle.security.jps.service.policystore.search.BaseSearchQuery
getComparator, getQueries, toString

 

Methods inherited from class oracle.security.jps.search.SearchQuery
addBaseQuery, getBaseSearchQueryInOrder, getSearchByPropertyString, getSearchByValue, getSearchByValueObject, getSearchComparator, getSearchQueries, getSearchValueMatch, isANDMatch, isComplexQuery, isNegativeMatch, isORMatch

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

PermissionSetSearchQuery

public PermissionSetSearchQuery(PermissionSetSearchQuery.SEARCH_PROPERTY property,
                                boolean negation,
                                ComparatorType operator,
                                java.lang.String value,
                                SearchQuery.MATCHER match)
                         throws InvalidArgumentException
Constructor
Parameters:
property - the property to search by

For SEARCH_PROPERTY except SEARCH_PROPERTY.NAME, SEARCH_PROPERTY.DISPLAY_NAME, SEARCH_PROPERTY.DESCRIPTION, only ComparatorType.EQUALITY and MATCHER.EXACT is supported

negation - if true, then the NOT operator is applied
operator - the operator to apply
value - the value to search for

If value is null, the match must be ANY

If value is non-null, this value is matched against the values to search for. The match algorithm is applied to values to sarch against.

match - how the value should match-ed with the values to search against. If match is null, an EXACT match is assumed. value should be non-null.
Throws:
InvalidArgumentException - if property is not name, display name or description, and operator is not equality, InvalidArgumentException will be thrown

PermissionSetSearchQuery

public PermissionSetSearchQuery(PermissionSetSearchQuery.SEARCH_PROPERTY property,
                                boolean negation,
                                ComparatorType operator,
                                java.lang.Object valueObject,
                                SearchQuery.MATCHER match)
                         throws InvalidArgumentException
Constructor
Parameters:
property - the property to search by, See PermissionSetSearchQuery.SEARCH_PROPERTY for list of valid values

For SEARCH_PROPERTY except SEARCH_PROPERTY.NAME, SEARCH_PROPERTY.DISPLAY_NAME, SEARCH_PROPERTY.DESCRIPTION, only ComparatorType.EQUALITY and MATCHER.EXACT is supported

negation - if true, then the NOT operator is applied
operator - the operator to apply
valueObject - the value to search for

If value is null, the match must be ANY

If value is non-null, this value is matched against the values to search for. The match algorithm is applied to values to sarch against.

match - how the value should match-ed with the values to search against. If match is null, an EXACT match is assumed. value should be non-null.
Throws:
InvalidArgumentException - if property is not name, display name or description, and operator is not equality, InvalidArgumentException will be thrown

PermissionSetSearchQuery

public PermissionSetSearchQuery(java.util.List<PermissionSetSearchQuery> queries,
                                boolean negation,
                                boolean isORMatch)
Constructor
Parameters:
queries - child queries of this query
negation - if true, then the NOT operator is applied.
isORMatch - if true the syntax among the child queries is 'OR', if false, the syntax among child queries is 'AND'

Method Detail

getSearchByProperty

public PermissionSetSearchQuery.SEARCH_PROPERTY getSearchByProperty()
get the search by property in this search query
Returns:
null if this is a complex search query

getSearchQueryInOrder

public PermissionSetSearchQuery[] getSearchQueryInOrder()
Get the child search query in this search query. Return child queries for a complex query, return empty arry for a simple query
Returns:

Skip navigation links

Oracle Fusion Middleware Management Java API Reference for Oracle Entitlements Server
11g Release 2 (11.1.2)

E27155-01 ESAPI


Copyright © 2011,2012, Oracle and/or its affiliates. All rights reserved.