|
Oracle Fusion Middleware Management Java API Reference for Oracle Entitlements Server 11g Release 1 (11.1.1) E22649-02 ESAPI |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.jps.search.SearchQuery
oracle.security.jps.service.policystore.search.BaseSearchQuery
oracle.security.jps.service.policystore.search.StoreAppRoleSearchQuery
public class StoreAppRoleSearchQuery
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 |
---|
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 |
---|
public StoreAppRoleSearchQuery(StoreAppRoleSearchQuery.SEARCH_PROPERTY property, boolean negation, ComparatorType operator, java.lang.String value, SearchQuery.MATCHER match)
property
- the property to search bySEARCH PROPERTY NAME | Value Parameter type |
APPLICATION_NAME | String |
NAME | String |
DISPLAY_NAME | String |
DESCRIPTION | String |
ASSIGNED_APP_ROLE | String |
PRINCIPAL | String |
negation
- if true, then the NOT operator is appliedoperator
- the operator to applyvalue
- 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.public StoreAppRoleSearchQuery(StoreAppRoleSearchQuery.SEARCH_PROPERTY property, boolean negation, ComparatorType operator, java.lang.Object valueObject, SearchQuery.MATCHER match)
property
- the property to search bySEARCH 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 |
negation
- if true, then the NOT operator is appliedoperator
- the operator to applyvalueObject
- 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.public StoreAppRoleSearchQuery(java.util.List<StoreAppRoleSearchQuery> queries, boolean negation, boolean isORMatch)
queries
- child queries of this querynegation
- 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 |
---|
public java.util.List<StoreAppRoleSearchQuery> getAllQueries() throws InvalidArgumentException
InvalidArgumentException
public java.util.Set<java.lang.String> getAppNames()
public StoreAppRoleSearchQuery.SEARCH_PROPERTY getSearchByProperty()
public StoreAppRoleSearchQuery[] getSearchQueryInOrder()
|
Oracle Fusion Middleware Management Java API Reference for Oracle Entitlements Server 11g Release 1 (11.1.1) E22649-02 ESAPI |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |