|
JBoss port of sunxacml 2.0.8.Final-redhat-1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.security.xacml.sunxacml.support.SimplePDP
public class SimplePDP
This is a simple, command-line driven XACML PDP. It acts both as an example of how to write a full-featured PDP and as a sample program that lets you evaluate requests against policies. See the comments for the main() method for correct usage.
As of the 2.0 release, this has been moved into the new support tree of the codebase. It has also been updated to use several of the new finder modules provided in the support tree codebase, so that static and dynamic references are supported, policies can be loaded from URLs, top-level policies are wrapped in a policy set when more than one applies, etc.
If you don't use a configuration file, then the default modules can all optionally support schema validation. To turn this on, provide the filename of the schema file in the property "com.sun.xacml.PolicySchema". You can also turn this on if you use a configuration file and it includes the modules provided in the support package.
Constructor Summary | |
---|---|
SimplePDP()
Default constructor. |
|
SimplePDP(String[] policies)
Constructor that takes an array of filenames and URLs, each of which points to an XACML policy, and sets up a PDP with access
to these policies only. |
Method Summary | |
---|---|
ResponseCtx |
evaluate(String requestFile)
Evaluates the given request and returns the Response that the PDP will hand back to the PEP. |
static void |
main(String[] args)
Main-line driver for this sample code. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimplePDP() throws Exception
SimplePDP
with a
PDP
based on the configuration defined by the runtime
property com.sun.xcaml.PDPConfigFile.
Exception
public SimplePDP(String[] policies) throws Exception
PDP
with access
to these policies only. These policies may be accessed based on
context matching or by reference (based on their policy identifiers).
The PDP
is also setup to support dynamic URL references.
policies
- an arry of filenames and URLs that specify policies
Exception
Method Detail |
---|
public ResponseCtx evaluate(String requestFile) throws IOException, ParsingException
requestFile
- the name of a file that contains a Request
IOException
- if there is a problem accessing the file
ParsingException
- if the Request is invalidpublic static void main(String[] args) throws Exception
args
- the input arguments to the class. They are either the
flag "-config" followed by a request file, or a request
file followed by one or more policy files. In the case
that the configuration flag is used, the configuration
file must be specified in the standard java property,
com.sun.xacml.PDPConfigFile.
Exception
|
JBoss port of sunxacml 2.0.8.Final-redhat-1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |