public class ResourceFinder extends Object
This class basically is a coordinator that asks each module in turn if it can handle the given identifier. Evaluation proceeds in order through the given modules, and once a module returns a non-empty response (whether or not it contains any errors or only errors), the evaluation is finished and the result is returned. One of the issues here is ordering, since a given resource may look to several modules like something that they can handle. So, you must be careful when assigning to ordering of the modules in this finder.
Note that in release 1.2 the interfaces were updated to include the evaluation context. In the
next major release the interfaces without the context information will be removed, but for now
both exist. This means that if this finder is called with the context, then only the methods in
ResourceFinderModule
supporting the context will be called (and likewise only the
methods without context will be called when this finder is called without the context). In
practice this means that the methods with context will always get invoked, since this is what the
default PDP implementation calls.
Constructor and Description |
---|
ResourceFinder()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
ResourceFinderResult |
findChildResources(AttributeValue parentResourceId)
Deprecated.
As of version 1.2, replaced by
findChildResources(AttributeValue,EvaluationCtx) . This version does not
provide the evaluation context to the modules, and will be removed in a future
release. |
ResourceFinderResult |
findChildResources(AttributeValue parentResourceId,
EvaluationCtx context)
Finds Resource Ids using the Children scope, and returns all resolved identifiers as well as
any errors that occurred.
|
ResourceFinderResult |
findDescendantResources(AttributeValue parentResourceId)
Deprecated.
As of version 1.2, replaced by
findDescendantResources(AttributeValue,EvaluationCtx) . This version does
not provide the evaluation context to the modules, and will be removed in a
future release. |
ResourceFinderResult |
findDescendantResources(AttributeValue parentResourceId,
EvaluationCtx context)
Finds Resource Ids using the Descendants scope, and returns all resolved identifiers as well
as any errors that occurred.
|
List<ResourceFinderModule> |
getModules()
Returns the ordered
List of ResourceFinderModule s used by this
class to find resources. |
void |
setModules(List<ResourceFinderModule> modules)
Sets the ordered
List of ResourceFinderModule s used by this class
to find resources. |
public List<ResourceFinderModule> getModules()
List
of ResourceFinderModule
s used by this
class to find resources.List
of ResourceFinderModule
spublic void setModules(List<ResourceFinderModule> modules)
List
of ResourceFinderModule
s used by this class
to find resources. The ordering will be maintained.modules
- a code>List of ResourceFinderModule
spublic ResourceFinderResult findChildResources(AttributeValue parentResourceId, EvaluationCtx context)
parentResourceId
- the root of the resourcescontext
- the representation of the request datapublic ResourceFinderResult findChildResources(AttributeValue parentResourceId)
findChildResources(AttributeValue,EvaluationCtx)
. This version does not
provide the evaluation context to the modules, and will be removed in a future
release.parentResourceId
- the root of the resourcespublic ResourceFinderResult findDescendantResources(AttributeValue parentResourceId, EvaluationCtx context)
parentResourceId
- the root of the resourcescontext
- the representation of the request datapublic ResourceFinderResult findDescendantResources(AttributeValue parentResourceId)
findDescendantResources(AttributeValue,EvaluationCtx)
. This version does
not provide the evaluation context to the modules, and will be removed in a
future release.parentResourceId
- the root of the resourcesCopyright © 2021 WSO2. All rights reserved.