public class FilePolicyModule extends PolicyFinderModule
Note that this class used to be provided in the
com.sun.xacml.finder.impl
package with a warning that it
would move out of the core packages eventually. This is partly because
this class doesn't represent standard functionality, and partly because
it isn't designed to be generally useful as anything more than an
example. Because so many people have used this class, however, it stayed
in place until the 2.0 release.
As of the 2.0 release, you may still use this class (in its new location),
but you are encouraged to migrate to the new support modules that are
much richer and designed for general-purpose use. Also, note that the
loadPolicy
methods that used to be available from this class
have been removed. That functionality has been replaced by the much more
useful PolicyReader
class. If you need to load policies
directly, you should consider that new class.
Constructor and Description |
---|
FilePolicyModule()
Constructor which retrieves the schema file to validate policies against
from the
PolicyReader.POLICY_SCHEMA_PROPERTY . |
FilePolicyModule(File schemaFile)
Constructor that uses the specified
File as the schema
file for XML validation. |
FilePolicyModule(List fileNames)
Constructor that specifies a set of initial policy files to use.
|
FilePolicyModule(List fileNames,
String schemaFile)
Constructor that specifies a set of initial policy files to use and
the schema file used to validate the policies.
|
FilePolicyModule(String schemaFile)
Constructor that uses the specified
String as the schema
file for XML validation. |
Modifier and Type | Method and Description |
---|---|
boolean |
addPolicy(String filename)
Adds a file (containing a policy) to the collection of filenames
associated with this module.
|
PolicyFinderResult |
findPolicy(EvaluationCtx context)
Finds a policy based on a request's context.
|
void |
init(PolicyFinder finder)
Initializes the
FilePolicyModule by loading
the policies contained in the collection of files associated
with this module. |
boolean |
isRequestSupported()
Indicates whether this module supports finding policies based on
a request (target matching).
|
findPolicy, getIdentifier, invalidateCache, isIdReferenceSupported
public FilePolicyModule()
PolicyReader.POLICY_SCHEMA_PROPERTY
. If the
retrieved property is null, then no schema validation will occur.public FilePolicyModule(File schemaFile)
File
as the schema
file for XML validation. If schema validation is not desired, a null
value should be used.schemaFile
- the schema file to validate policies against,
or null if schema validation is not desired.public FilePolicyModule(String schemaFile)
String
as the schema
file for XML validation. If schema validation is not desired, a null
value should be used.schemaFile
- the schema file to validate policies against,
or null if schema validation is not desired.public FilePolicyModule(List fileNames)
PolicyReader.POLICY_SCHEMA_PROPERTY
. If the retrieved
property is null, then no schema validation will occur.fileNames
- a List
of String
s that
identify policy filespublic FilePolicyModule(List fileNames, String schemaFile)
fileNames
- a List
of String
s that
identify policy filesschemaFile
- the schema file to validate policies against,
or null if schema validation is not desired.public boolean addPolicy(String filename)
init
method (which
is called automatically by the PolicyFinder
when the
system comes up).filename
- the file to add to this module's collection of filespublic boolean isRequestSupported()
isRequestSupported
in class PolicyFinderModule
public void init(PolicyFinder finder)
FilePolicyModule
by loading
the policies contained in the collection of files associated
with this module. This method also uses the specified
PolicyFinder
to help in instantiating PolicySets.init
in class PolicyFinderModule
finder
- a PolicyFinder used to help in instantiating PolicySetspublic PolicyFinderResult findPolicy(EvaluationCtx context)
findPolicy
in class PolicyFinderModule
context
- the representation of the request dataCopyright © 2023 JBoss by Red Hat. All rights reserved.