|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.security.xacml.sunxacml.support.finder.PolicyReader
public class PolicyReader
This class is provided as a utility for reading policies from common,
simple sources: InputStream
s, File
s, and
URL
s. It can optionally schema validate the policies.
Note: some of this functionality was previously provided in
com.sun.xacml.finder.impl.FilePolicyModule
, but as of
the 2.0 release, that class has been removed. This new
PolicyReader
class provides much better functionality
for loading policies.
Field Summary | |
---|---|
static String |
POLICY_SCHEMA_PROPERTY
The property which is used to specify the schema file to validate against (if any). |
Constructor Summary | |
---|---|
PolicyReader(PolicyFinder finder,
Logger logger)
Creates a PolicyReader that does not schema-validate
policies. |
|
PolicyReader(PolicyFinder finder,
Logger logger,
File schemaFile)
Creates a PolicyReader that may schema-validate policies. |
Method Summary | |
---|---|
void |
error(SAXParseException exception)
Standard handler routine for the XML parsing. |
void |
fatalError(SAXParseException exception)
Standard handler routine for the XML parsing. |
AbstractPolicy |
readPolicy(File file)
Tries to read an XACML policy or policy set from the given file. |
AbstractPolicy |
readPolicy(InputStream input)
Tries to read an XACML policy or policy set from the given stream. |
AbstractPolicy |
readPolicy(URL url)
Tries to read an XACML policy or policy set based on the given URL. |
void |
warning(SAXParseException exception)
Standard handler routine for the XML parsing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String POLICY_SCHEMA_PROPERTY
PolicyReader
, but is referenced by many classes that
use this class to load policies.
Constructor Detail |
---|
public PolicyReader(PolicyFinder finder, Logger logger)
PolicyReader
that does not schema-validate
policies.
finder
- a PolicyFinder
that is used by policy sets,
which may be null only if no references are usedlogger
- a Logger
used to report parsing errorspublic PolicyReader(PolicyFinder finder, Logger logger, File schemaFile)
PolicyReader
that may schema-validate policies.
finder
- a PolicyFinder
that is used by policy sets,
which may be null only if no references are usedlogger
- a Logger
used to report parsing errorsschemaFile
- the schema file used to validate policies, or
null if schema validation is not desiredMethod Detail |
---|
public AbstractPolicy readPolicy(File file) throws ParsingException
file
- the file containing the policy to read
ParsingException
- if an error occurs while reading or
parsing the policypublic AbstractPolicy readPolicy(InputStream input) throws ParsingException
input
- the stream containing the policy to read
ParsingException
- if an error occurs while reading or
parsing the policypublic AbstractPolicy readPolicy(URL url) throws ParsingException
url
- a URL pointing to the policy to read
ParsingException
- if an error occurs while reading or
parsing the policy, or if the URL can't
be resolvedpublic void warning(SAXParseException exception) throws SAXException
warning
in interface ErrorHandler
exception
- information on what caused the problem
SAXException
public void error(SAXParseException exception) throws SAXException
error
in interface ErrorHandler
exception
- information on what caused the problem
SAXException
- always to halt parsing on errorspublic void fatalError(SAXParseException exception) throws SAXException
fatalError
in interface ErrorHandler
exception
- information on what caused the problem
SAXException
- always to halt parsing on errors
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |