|
Oracle Fusion Middleware Java API Reference for Oracle Platform Security Services 11g Release 1 (11.1.1) E14650-03 |
|||||||||
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.ResourceSearchQuery
public class ResourceSearchQuery
A SearchQuery instance is not synchronized against concurrent multithreaded access. Multiple threads should not try to modify the SearchQuery as it is not thread-safe and not going to be a thread-safe object in future.
Following code snippet illustrates how to build a search criteria to search by the DisplayName
ResourceSearchQuery query = new ResourceSearchQuery(); query.addQuery ( ResourceSearchQuery.SEARCH_PROPERTY.DISPLAY_NAME, false, ComparatorType.EQUALITY, "DisplayName Value to searchBy", ResourceSearchQuery.MATCHER.EXACT); getResources ("resource_type_name", query );
To build more complex search criterias, use the addQuery
to add more search criterias.
Consider the following example to search Resources by a specific name and display name. Since we have two criteria that should be true in tandem, hence they have to be AND-ed as shown next.
ResourceSearchQuery query = new ResourceSearchQuery(); query.addQuery ( ResourceSearchQuery.SEARCH_PROPERTY.DISPLAY_NAME, false, ComparatorType.EQUALITY, "The display name value", ResourceSearchQuery.MATCHER.EXACT); query.addQuery ( ResourceSearchQuery.SEARCH_PROPERTY.NAME, false, ComparatorType.EQUALITY, "The resource name value", ResourceSearchQuery.MATCHER.EXACT); query.setANDMatch();
Similarly, an OR-ed complex query can be constructed (when either of the constituent criterion, if true, would match a Resource)
ResourceSearchQuery query = new ResourceSearchQuery(); query.addQuery ( ResourceSearchQuery.SEARCH_PROPERTY.DISPLAY_NAME, false, ComparatorType.EQUALITY, "The display name value", ResourceSearchQuery.MATCHER.EXACT); query.addQuery ( ResourceSearchQuery.SEARCH_PROPERTY.DESCIPTION, false, ComparatorType.EQUALITY, "The resource description value", ResourceSearchQuery.MATCHER.EXACT); query.setORMatch();
Nested Class Summary | |
---|---|
static class |
ResourceSearchQuery.SEARCH_PROPERTY Criterias to search a Resource By |
Nested classes/interfaces inherited from class oracle.security.jps.search.SearchQuery |
---|
SearchQuery.MATCHER |
Constructor Summary | |
---|---|
ResourceSearchQuery() No arg constructor |
Method Summary | |
---|---|
void |
addQuery(ResourceSearchQuery.SEARCH_PROPERTY property, boolean negation, ComparatorType operator, java.lang.String value, SearchQuery.MATCHER match) Add a ResourceSearchQuery to this ResourceSearchQuery. |
void |
addQuery(ResourceSearchQuery query) Add a preconfigured ResourceSearchQuery |
ResourceSearchQuery.SEARCH_PROPERTY |
getSearchByProperty() Get the search property to use in the search. |
ResourceSearchQuery[] |
getSearchQueryInOrder() Get all added queries in the order they were added. |
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 ResourceSearchQuery()
Method Detail |
---|
public void addQuery(ResourceSearchQuery.SEARCH_PROPERTY property, boolean negation, ComparatorType operator, java.lang.String value, SearchQuery.MATCHER match)
property
- -- search propertynegation
- - negate the search?operator
- -- Type of comparisonvalue
- -- value to search formatch
- -- matching to be performed.public void addQuery(ResourceSearchQuery query)
query
- -- query to be added.public ResourceSearchQuery.SEARCH_PROPERTY getSearchByProperty()
public ResourceSearchQuery[] getSearchQueryInOrder()
|
Oracle Fusion Middleware Java API Reference for Oracle Platform Security Services 11g Release 1 (11.1.1) E14650-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |