|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.xtreemos.xosd.vops.xacml.policy.Policy
public class Policy
The purpose of this class is to hold info about policies. It has to generate policy in XACML format from registered TARGETS and RULES which applies policies over these targets.
Field Summary | |
---|---|
private com.sun.xacml.combine.RuleCombiningAlgorithm |
combiningAlg
|
private java.lang.String |
description
|
private java.net.URI |
policyId
|
private java.util.ArrayList<PolicyRule> |
rules
List of all policy rules. |
PolicyTarget |
target
Holds info about policy targets |
static java.lang.String |
XACML_ACTION_ACTION_ID
Actions |
static java.lang.String |
XACML_ATTRIBUTEID_CURRENTTIME
Attribute ids |
static java.lang.String |
XACML_ATTRIBUTEID_ENV_CURRENT_TIME
Environment |
static java.lang.String |
XACML_DATATYPE_BOOLEAN
|
static java.lang.String |
XACML_DATATYPE_DOUBLE
|
static java.lang.String |
XACML_DATATYPE_STRING
|
static java.lang.String |
XACML_DATATYPE_TIME
DataTypes definitions |
static java.lang.String |
XACML_FUNCTIONID_BOOLEAN_AND
|
static java.lang.String |
XACML_FUNCTIONID_BOOLEAN_OR
|
static java.lang.String |
XACML_FUNCTIONID_DOUBLE_EQUAL
|
static java.lang.String |
XACML_FUNCTIONID_DOUBLE_GREATER_OR_EQ
|
static java.lang.String |
XACML_FUNCTIONID_DOUBLE_LESS_OR_EQ
|
static java.lang.String |
XACML_FUNCTIONID_DOUBLE_ONE_ONLY
|
static java.lang.String |
XACML_FUNCTIONID_STRING_EQUAL
|
static java.lang.String |
XACML_FUNCTIONID_STRING_ONE_ONLY
|
static java.lang.String |
XACML_FUNCTIONID_TIME_GREATER_OR_EQ
Function id definitions |
static java.lang.String |
XACML_FUNCTIONID_TIME_LESS_OR_EQ
|
static java.lang.String |
XACML_FUNCTIONID_TIME_ONE_AND_ONLY
|
static java.lang.String |
XACML_URI_RESOURCE_DN
|
static java.lang.String |
XACML_URI_SUBJECT_DN
|
static java.lang.String |
XACML_URI_SUBJECT_EXTENSION
Constants used for parsing policies. |
Constructor Summary | |
---|---|
Policy()
|
|
Policy(java.net.URI policyId,
java.lang.String description)
Creates policy object. |
Method Summary | |
---|---|
void |
addRule(PolicyRule pr)
Adds Rule into rule list |
void |
addRules(java.util.ArrayList<PolicyRule> alRules)
Adds range of rules from ArrayList. |
java.net.URI |
getId()
Return policyId. |
com.sun.xacml.Policy |
getPolicy()
Generates xacml Policy. |
PolicyRule |
getRule(java.lang.String ruleId)
|
java.util.ArrayList<PolicyRule> |
getRules(com.sun.xacml.ctx.RequestCtx context,
boolean matchResources)
Gets array list of all rules in the policy. |
void |
parse(java.util.Hashtable<java.lang.String,java.lang.Object> context,
eu.xtreemos.xosd.factory.utils.parsers.XMLSearchEngine xse)
Parses root Policy Node. |
Policy |
parsePolicy(java.lang.String xmlPolicy)
Parses xml document and returns Policy. |
boolean |
removeRule(java.net.URI ruleId)
Removes rule with specified ruleId from this policy. |
java.lang.String |
toString()
Returns policy as String instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String XACML_ACTION_ACTION_ID
public static final java.lang.String XACML_FUNCTIONID_TIME_GREATER_OR_EQ
public static final java.lang.String XACML_FUNCTIONID_TIME_LESS_OR_EQ
public static final java.lang.String XACML_FUNCTIONID_TIME_ONE_AND_ONLY
public static final java.lang.String XACML_FUNCTIONID_STRING_EQUAL
public static final java.lang.String XACML_FUNCTIONID_DOUBLE_EQUAL
public static final java.lang.String XACML_FUNCTIONID_STRING_ONE_ONLY
public static final java.lang.String XACML_FUNCTIONID_DOUBLE_ONE_ONLY
public static final java.lang.String XACML_FUNCTIONID_BOOLEAN_AND
public static final java.lang.String XACML_FUNCTIONID_BOOLEAN_OR
public static final java.lang.String XACML_FUNCTIONID_DOUBLE_GREATER_OR_EQ
public static final java.lang.String XACML_FUNCTIONID_DOUBLE_LESS_OR_EQ
public static final java.lang.String XACML_DATATYPE_TIME
public static final java.lang.String XACML_DATATYPE_STRING
public static final java.lang.String XACML_DATATYPE_BOOLEAN
public static final java.lang.String XACML_DATATYPE_DOUBLE
public static final java.lang.String XACML_ATTRIBUTEID_CURRENTTIME
public static final java.lang.String XACML_ATTRIBUTEID_ENV_CURRENT_TIME
public static final java.lang.String XACML_URI_SUBJECT_EXTENSION
public static final java.lang.String XACML_URI_SUBJECT_DN
public static final java.lang.String XACML_URI_RESOURCE_DN
private java.net.URI policyId
private java.lang.String description
private com.sun.xacml.combine.RuleCombiningAlgorithm combiningAlg
public PolicyTarget target
private java.util.ArrayList<PolicyRule> rules
Constructor Detail |
---|
public Policy()
public Policy(java.net.URI policyId, java.lang.String description) throws java.lang.Exception
policyId
- description
-
java.lang.Exception
Method Detail |
---|
public java.net.URI getId()
public void addRule(PolicyRule pr) throws java.lang.Exception
java.lang.Exception
public void addRules(java.util.ArrayList<PolicyRule> alRules) throws java.lang.Exception
alRules
-
java.lang.Exception
public com.sun.xacml.Policy getPolicy()
public Policy parsePolicy(java.lang.String xmlPolicy) throws java.lang.Exception
xmlPolicy
- is a XML Policy as String instance.
java.lang.Exception
public java.util.ArrayList<PolicyRule> getRules(com.sun.xacml.ctx.RequestCtx context, boolean matchResources)
context
- context of the request.matchResources
- set to true if we want to filter rules also by resource.public PolicyRule getRule(java.lang.String ruleId)
public boolean removeRule(java.net.URI ruleId) throws java.lang.Exception
ruleId
- identification of the rule
java.lang.Exception
public void parse(java.util.Hashtable<java.lang.String,java.lang.Object> context, eu.xtreemos.xosd.factory.utils.parsers.XMLSearchEngine xse) throws java.lang.Exception
context
- context returned by the XMLParserAndValidatorxse
- search engine for context
TODO: clean up hard coded stuff!
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |