|
Oracle Fusion Middleware Java API Reference for Oracle Platform Security Services 11g Release 1 (11.1.1) E14650-06 |
|||||||||
| 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.PermissionSetSearchQuery
public class PermissionSetSearchQuery
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_PROPERTYCriteria 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 | |
|---|---|
void |
addQuery(PermissionSetSearchQuery query)Add a search query to this query. |
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 |
|---|
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 |
|---|
public PermissionSetSearchQuery(PermissionSetSearchQuery.SEARCH_PROPERTY property,
boolean negation,
ComparatorType operator,
java.lang.String value,
SearchQuery.MATCHER match)
throws InvalidArgumentException
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 appliedoperator - the operator to applyvalue - 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.InvalidArgumentException - if property is not name, display name or description, and operator is not equality, InvalidArgumentException will be thrown
public PermissionSetSearchQuery(PermissionSetSearchQuery.SEARCH_PROPERTY property,
boolean negation,
ComparatorType operator,
java.lang.Object valueObject,
SearchQuery.MATCHER match)
throws InvalidArgumentException
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 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 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.InvalidArgumentException - if property is not name, display name or description, and operator is not equality, InvalidArgumentException will be thrown
public PermissionSetSearchQuery(java.util.List<PermissionSetSearchQuery> queries,
boolean negation,
boolean isORMatch)
queries - child queries of this querynegation - 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 |
|---|
public void addQuery(PermissionSetSearchQuery query)
query -public PermissionSetSearchQuery.SEARCH_PROPERTY getSearchByProperty()
public PermissionSetSearchQuery[] getSearchQueryInOrder()
|
Oracle Fusion Middleware Java API Reference for Oracle Platform Security Services 11g Release 1 (11.1.1) E14650-06 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||