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.entitymanager
Interface ResourceFinder

All Known Subinterfaces:
ResourceManager

public interface ResourceFinder

A stateless, threadsafe interface to query for resources (by name, or QueryAttributes).


Method Summary
 ResourceEntry getResource(java.lang.String resourceTypeName, java.lang.String name)
          Get the resource given the name and the type of the resource.
 java.util.List<ResourceEntry> getResources(java.lang.String resourceTypeName, ResourceSearchQuery query)
          Search for resources based on SearchQuery.
 java.util.List<ResourceSearchQuery.SEARCH_PROPERTY> getSearchableAttributes()
          Returns a list of query attributes that are supported by the underlying resource store.
 void initialize(java.util.Map<java.lang.String,java.lang.String> props)
          This method is called by JPS before calling any other methods on the Finder.

 

Method Detail

getResources

java.util.List<ResourceEntry> getResources(java.lang.String resourceTypeName,
                                           ResourceSearchQuery query)
                                           throws PolicyStoreException,
                                                  PolicyStoreOperationNotAllowedException,
                                                  ResourceFinderException
Search for resources based on SearchQuery. A new search must be independent of any previous search (no result caching -- stateless requirement) and should not get affected by simultaneous searches through other threads (thread-safety requirement).
Note: 1)Resource query across different resource type is not allowed.
2)any ResourceEntry that is returned as a result should exhibit following behavior: ResourceEntry.getResourceTypeName().equalsIgnoreCase(resourceTypeName) == true; must hold for every resource entry returned.
If the search does not find any resources matching the query, then the method returns an empty list Query must not be null. To get all resources, defined in the scope, set matcher to ANY and value to match to null.
Parameters:
resourceTypeName - resource type name, must not be null.
query - -- the search criteria for searching resources, must not be null. ResourceSerachQuery.SEARCH_PROPERTY.RESOURCE_TYPE must not be specified in query.
Returns:
a list of resource entries
Throws:
PolicyStoreException - if there was an error while searching for the resource.
PolicyStoreOperationNotAllowedException - -- if the resource finder is unable to handle the search query -- e.g., attribute to search on is not supported, or criteria such as 'beginsWith', 'endsWith' etc. are not supported.
InvalidArgumentException - if query is null.
ResourceFinderException

getResource

ResourceEntry getResource(java.lang.String resourceTypeName,
                          java.lang.String name)
                          throws PolicyStoreException,
                                 PolicyObjectNotFoundException
Get the resource given the name and the type of the resource. (Search must not be affected by a simultaneous search on the same Resource store) Note: the search result must exhibit this behavior: ResourceEntry.getResourceTypeName().equalsIgnoreCase(resourceTypeName) == true; must hold for the resource entry returned.
If the search does not find any resource matching the name and type, the method throws PolicyObjectNotFoundException
Parameters:
resourceTypeName - -- name of the resource type (to restrict the search to a resource type)
name-- - name of the resource (to be found).
Returns:
resource entry (result of the search)
Throws:
PolicyStoreException - if there was an error while searching for the resource.
PolicyObjectNotFoundException - if the resource with given name and type does not exit.
ResourceFinderException - if resource type cannot be found.

initialize

void initialize(java.util.Map<java.lang.String,java.lang.String> props)
                throws ResourceFinderException
This method is called by JPS before calling any other methods on the Finder. This method is invoked with a map of properties registered by the provider in the config file. The finder will initialize itself using these properties. E.g.: A resource finder that queries a relational database would configure the host, port, SID, and credentials for connection to the DB.
The ResourceFinder implementation must ensure that the set of properties presented in this method match with the properties the implementation expects. If there's a mismatch the implementation should throw a ResourceFinderException exception.
Every ResourceFinder must initialize the list of SEARCH_PROPERTY values(See method getSearchableAttributes()).
Parameters:
props - - a map of properties required to initialize the Resource Finder. These are configured during registration of the finder.
Throws:
ResourceFinderException - - if the method fails to initialize ResourceFinder.

getSearchableAttributes

java.util.List<ResourceSearchQuery.SEARCH_PROPERTY> getSearchableAttributes()
Returns a list of query attributes that are supported by the underlying resource store. Clients should call getResources(String resourceTypeName, ResourceSearchQuery query) with ResourceSearchQuery query that conforms to the set of supported query properties (attributes).
Returns:
a list of query attributes (SEARCH_PROPERTY).

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.