Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Platform Security Services
11g Release 1 (11.1.1)

E14650-04


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

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.StoreAppRoleSearchQuery


public class StoreAppRoleSearchQuery
extends BaseSearchQuery

A Class to build search criterias to query AppRoles across multiple applications..

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

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

The above query will search across ALL available applications for the app role with the particular display name.
Queries can be constructed to search only a subset of available applications through complex queries.

To build more complex search criterias, use the Constructor for complex search query (as shown next). Consider the following example to search for app roles by name = Bob in application by name = WebCenter The combinedQuery needs to be evaluated (for both search criteria to be enforced in tandem, i.e., AND'ed)

  List<StoreAppRoleSearchQuery> list = new ArrayList<StoreAppRoleSearchQuery>();
  list.add(new StoreAppRoleSearchQuery( StoreAppRoleSearchQuery.SEARCH_PROPERTY.NAME,
    false, ComparatorType.EQUALITY, "Bob", BaseSearchQuery.MATCHER.EXACT));

  list.add(new StoreAppRoleSearchQuery( StoreAppRoleSearchQuery.SEARCH_PROPERTY.APPLICATION_NAME,
    false, ComparatorType.EQUALITY, "WebCenter", BaseSearchQuery.MATCHER.EXACT));

  StoreAppRoleSearchQuery combinedQuery = new StoreAppRoleSearchQuery(list, false, false);
 

Note that the first query constructs the 'role-name = Bob' criteria, while the next query states the 'application name= WebCenter' criteria. Both these criteria have been AND'ed in the complex query constructor.

Consider the following example to search AppRoles by a specific description and display name. Obviously, the two criterias (below) have to be AND-ed (in the complex query constructor).

  List<StoreAppRoleSearchQuery> list = new ArrayList<StoreAppRoleSearchQuery>();
  list.add(new StoreAppRoleSearchQuery( StoreAppRoleSearchQuery.SEARCH_PROPERTY.DISPLAY_NAME,
    false, ComparatorType.EQUALITY, "The Display Name", BaseSearchQuery.MATCHER.EXACT));

  list.add(new StoreAppRoleSearchQuery( StoreAppRoleSearchQuery.SEARCH_PROPERTY.DESCRIPTION,
    false, ComparatorType.EQUALITY, "The Description", BaseSearchQuery.MATCHER.EXACT));

  StoreAppRoleSearchQuery combinedQuery = new StoreAppRoleSearchQuery(list, false, false);
 

Similarly, we can have two criterias with OR syntax as shown below (note the change in combinedQuery constructor parameters).

  List<StoreAppRoleSearchQuery> list = new ArrayList<StoreAppRoleSearchQuery>();
  list.add(new StoreAppRoleSearchQuery( StoreAppRoleSearchQuery.SEARCH_PROPERTY.DISPLAY_NAME,
    false, ComparatorType.EQUALITY, "The Display Name", BaseSearchQuery.MATCHER.EXACT));

  list.add(new StoreAppRoleSearchQuery( StoreAppRoleSearchQuery.SEARCH_PROPERTY.DESCRIPTION,
    false, ComparatorType.EQUALITY, "The Description", BaseSearchQuery.MATCHER.EXACT));

  StoreAppRoleSearchQuery combinedQuery = new StoreAppRoleSearchQuery(list, false, true);
 

It is ok to construct a complex query with more than one APPLICATION_NAME query. However, such a query cannot state the condition that
application name = 'APP1' AND application name ='APP2'
This is because application roles are scoped to a single application and this query is bound to fail.
To be more precise, when constructing a complex query with multiple APPLICATION_NAME subqueries,
use the following arguments to constructor (OR syntax):

 StoreAppRoleSearchQuery combinedQuery = new StoreAppRoleSearchQuery(list_of_app_name_subqueries, false, true);
 

Here list_of_app_name_subqueries variable is a List<StoreAppRoleSearchQuery> variable that
contains application name subqueries. The resulting query will enforce the criteria
application name = 'APP1' OR application name ='APP2' OR ....
If this criteria needs to be applied in tandem with some other criteria (like display name="My_Name") then the above query
can be AND'ed with any other query using the complex query constructor.


Nested Class Summary
static class StoreAppRoleSearchQuery.SEARCH_PROPERTY
          Criterias to search AppRoles By

 

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

 

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

 

Method Summary
 java.util.List<StoreAppRoleSearchQuery> getAllQueries()
           
 java.util.Set<java.lang.String> getAppNames()
           
 StoreAppRoleSearchQuery.SEARCH_PROPERTY getSearchByProperty()
          Gets the search by property in this search query
 StoreAppRoleSearchQuery[] getSearchQueryInOrder()
          Gets the child search query in this search query.

 

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

 

Methods inherited from class oracle.security.jps.search.SearchQuery
addBaseQuery, 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

StoreAppRoleSearchQuery

public StoreAppRoleSearchQuery(StoreAppRoleSearchQuery.SEARCH_PROPERTY property,
                               boolean negation,
                               ComparatorType operator,
                               java.lang.String value,
                               SearchQuery.MATCHER match)
Constructor.
Parameters:
property - the property to search by
For this constructor following Search property types are meaningful
<p/>
SEARCH PROPERTY NAME Value Parameter type
APPLICATION_NAME String
NAME String
DISPLAY_NAME String
DESCRIPTION String
ASSIGNED_APP_ROLE String
PRINCIPAL String

<p/>

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

If match is ANY, the value is ignored.

If value is non-null, this value is matched against the values to search for. The match algorithm is applied to values to search 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.

StoreAppRoleSearchQuery

public StoreAppRoleSearchQuery(StoreAppRoleSearchQuery.SEARCH_PROPERTY property,
                               boolean negation,
                               ComparatorType operator,
                               java.lang.Object valueObject,
                               SearchQuery.MATCHER match)
Constructor
Parameters:
property - the property to search by
For this constructor following Search property types are meaningful
<p/>
SEARCH PROPERTY NAME Value Parameter type Other information
APPLICATION_NAME String
NAME String
DISPLAY_NAME String
DESCRIPTION String
ASSIGNED_APP_ROLE AppRoleEntry (or PrincipalEntry or Principal or String) Matcher should be EXACT if non-string value is used
PRINCIPAL Principal (or PrincipalEntry or String) Matcher should be EXACT if non-string value is used

<p/>

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 search 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.

StoreAppRoleSearchQuery

public StoreAppRoleSearchQuery(java.util.List<StoreAppRoleSearchQuery> 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, then the syntax among child queries is 'OR', if false the syntax among child queries is 'AND'

Method Detail

getAllQueries

public java.util.List<StoreAppRoleSearchQuery> getAllQueries()
                                                      throws InvalidArgumentException
Throws:
InvalidArgumentException

getAppNames

public java.util.Set<java.lang.String> getAppNames()

getSearchByProperty

public StoreAppRoleSearchQuery.SEARCH_PROPERTY getSearchByProperty()
Gets the search by property in this search query
Returns:
Search property by which to search by

getSearchQueryInOrder

public StoreAppRoleSearchQuery[] getSearchQueryInOrder()
Gets the child search query in this search query. Return child queries for a complex query, return empty array for a simple query
Returns:
Array of search queries in order.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Platform Security Services
11g Release 1 (11.1.1)

E14650-04


Copyright © 2011, Oracle. All rights reserved.