You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openaz.apache.org by co...@apache.org on 2015/05/05 14:23:45 UTC
[47/54] [abbrv] [partial] incubator-openaz git commit: Do an eclipse
based "cleanup" on the project
http://git-wip-us.apache.org/repos/asf/incubator-openaz/blob/38b6d318/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentExpression.java
----------------------------------------------------------------------
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentExpression.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentExpression.java
index 7d39103..089300a 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentExpression.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentExpression.java
@@ -38,12 +38,13 @@ import com.att.research.xacmlatt.pdp.eval.EvaluationContext;
import com.att.research.xacmlatt.pdp.eval.EvaluationException;
/**
- * FunctionArgumentExpression implements the {@link FunctionArgument} interface for
- * unevaluated {@link Expression}s.
- *
+ * FunctionArgumentExpression implements the {@link FunctionArgument} interface for unevaluated
+ * {@link Expression}s.
*/
public class FunctionArgumentExpression implements FunctionArgument {
- private static final Status STATUS_NULL_EXPRESSION_RESULT = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Null expression result");
+ private static final Status STATUS_NULL_EXPRESSION_RESULT = new StdStatus(
+ StdStatusCode.STATUS_CODE_PROCESSING_ERROR,
+ "Null expression result");
private Expression expression;
private EvaluationContext evaluationContext;
@@ -53,9 +54,11 @@ public class FunctionArgumentExpression implements FunctionArgument {
protected ExpressionResult evaluateExpression() {
if (this.getExpression() != null && this.getEvaluationContext() != null) {
try {
- this.expressionResult = this.getExpression().evaluate(this.getEvaluationContext(), this.getPolicyDefaults());
+ this.expressionResult = this.getExpression().evaluate(this.getEvaluationContext(),
+ this.getPolicyDefaults());
} catch (EvaluationException ex) {
- this.expressionResult = ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
+ this.expressionResult = ExpressionResult
+ .newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
}
}
return this.expressionResult;
@@ -64,10 +67,11 @@ public class FunctionArgumentExpression implements FunctionArgument {
public FunctionArgumentExpression() {
}
- public FunctionArgumentExpression(Expression expressionIn, EvaluationContext evaluationContextIn, PolicyDefaults policyDefaultsIn) {
- this.expression = expressionIn;
- this.evaluationContext = evaluationContextIn;
- this.policyDefaults = policyDefaultsIn;
+ public FunctionArgumentExpression(Expression expressionIn, EvaluationContext evaluationContextIn,
+ PolicyDefaults policyDefaultsIn) {
+ this.expression = expressionIn;
+ this.evaluationContext = evaluationContextIn;
+ this.policyDefaults = policyDefaultsIn;
}
protected ExpressionResult getExpressionResult() {
@@ -89,42 +93,43 @@ public class FunctionArgumentExpression implements FunctionArgument {
@Override
public Status getStatus() {
- ExpressionResult thisExpressionResult = this.getExpressionResult();
+ ExpressionResult thisExpressionResult = this.getExpressionResult();
if (thisExpressionResult == null) {
- thisExpressionResult = this.evaluateExpression();
+ thisExpressionResult = this.evaluateExpression();
}
- return (thisExpressionResult == null ? STATUS_NULL_EXPRESSION_RESULT : thisExpressionResult.getStatus());
+ return (thisExpressionResult == null ? STATUS_NULL_EXPRESSION_RESULT : thisExpressionResult
+ .getStatus());
}
@Override
public boolean isOk() {
- Status thisStatus = this.getStatus();
+ Status thisStatus = this.getStatus();
return (thisStatus == null ? true : thisStatus.isOk());
}
@Override
public boolean isBag() {
- ExpressionResult thisExpressionResult = this.getExpressionResult();
+ ExpressionResult thisExpressionResult = this.getExpressionResult();
if (thisExpressionResult == null) {
- thisExpressionResult = this.evaluateExpression();
+ thisExpressionResult = this.evaluateExpression();
}
return (thisExpressionResult == null ? false : thisExpressionResult.isBag());
}
@Override
public AttributeValue<?> getValue() {
- ExpressionResult thisExpressionResult = this.getExpressionResult();
+ ExpressionResult thisExpressionResult = this.getExpressionResult();
if (thisExpressionResult == null) {
- thisExpressionResult = this.evaluateExpression();
+ thisExpressionResult = this.evaluateExpression();
}
return (thisExpressionResult == null ? null : thisExpressionResult.getValue());
}
@Override
public Bag getBag() {
- ExpressionResult thisExpressionResult = this.getExpressionResult();
+ ExpressionResult thisExpressionResult = this.getExpressionResult();
if (thisExpressionResult == null) {
- thisExpressionResult = this.evaluateExpression();
+ thisExpressionResult = this.evaluateExpression();
}
return (thisExpressionResult == null ? null : thisExpressionResult.getBag());
}
http://git-wip-us.apache.org/repos/asf/incubator-openaz/blob/38b6d318/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinition.java
----------------------------------------------------------------------
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinition.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinition.java
index a27806c..0414ba4 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinition.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinition.java
@@ -36,9 +36,8 @@ import com.att.research.xacml.api.Identifier;
import com.att.research.xacmlatt.pdp.eval.EvaluationContext;
/**
- * FunctionDefinition is the interface that objects representing XACML functions found in Match and Apply elements in Policies, PolicySets
- * and Rules.
- *
+ * FunctionDefinition is the interface that objects representing XACML functions found in Match and Apply
+ * elements in Policies, PolicySets and Rules.
*/
public interface FunctionDefinition {
/**
@@ -49,10 +48,12 @@ public interface FunctionDefinition {
public Identifier getId();
/**
- * Returns the <code>Identifier</code> for the data type returned by this function if <code>returnsBag()</code> is false or
- * if this <code>FunctionDefinition</code> returns a bag containing a single data type. Otherwise it returns null.
+ * Returns the <code>Identifier</code> for the data type returned by this function if
+ * <code>returnsBag()</code> is false or if this <code>FunctionDefinition</code> returns a bag containing
+ * a single data type. Otherwise it returns null.
*
- * @return the <code>Identifier</code> for the XACML data type this <code>FunctionDefinition</code> returns
+ * @return the <code>Identifier</code> for the XACML data type this <code>FunctionDefinition</code>
+ * returns
*/
public Identifier getDataTypeId();
@@ -64,9 +65,11 @@ public interface FunctionDefinition {
public boolean returnsBag();
/**
- * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of{@link FunctionArgument}s.
+ * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of
+ * {@link FunctionArgument}s.
*
- * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the evaluation
+ * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the
+ * evaluation
* @param arguments the <code>List</code> of <code>FunctionArgument</code>s for the evaluation
* @return an {@link ExpressionResult} with the results of the call
*/
http://git-wip-us.apache.org/repos/asf/incubator-openaz/blob/38b6d318/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinitionFactory.java
----------------------------------------------------------------------
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinitionFactory.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinitionFactory.java
index 155a243..a7aeb58 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinitionFactory.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinitionFactory.java
@@ -38,13 +38,12 @@ import com.att.research.xacml.util.FactoryFinder;
import com.att.research.xacmlatt.pdp.util.ATTPDPProperties;
/**
- * FunctionDefinitionFactory is an abstract class for mapping function {@link com.att.research.xacml.api.Identifier} ids to
- * {@link FunctionDefinition} objects.
- *
+ * FunctionDefinitionFactory is an abstract class for mapping function
+ * {@link com.att.research.xacml.api.Identifier} ids to {@link FunctionDefinition} objects.
*/
public abstract class FunctionDefinitionFactory {
- private static final String FACTORYID = ATTPDPProperties.PROP_FUNCTIONDEFINITIONFACTORY;
- private static final String DEFAULT_FACTORY_CLASSNAME = "com.att.research.xacmlatt.pdp.std.StdFunctionDefinitionFactory";
+ private static final String FACTORYID = ATTPDPProperties.PROP_FUNCTIONDEFINITIONFACTORY;
+ private static final String DEFAULT_FACTORY_CLASSNAME = "com.att.research.xacmlatt.pdp.std.StdFunctionDefinitionFactory";
protected FunctionDefinitionFactory() {
}
@@ -53,7 +52,8 @@ public abstract class FunctionDefinitionFactory {
}
/**
- * Maps the given <code>Identifier</code> representing a XACML function to a <code>FunctionDefinition</code> object.
+ * Maps the given <code>Identifier</code> representing a XACML function to a
+ * <code>FunctionDefinition</code> object.
*
* @param functionId the <code>Identifier</code> of the <code>FunctionDefinition</code> to retrieve
* @return the <code>FunctionDefinition</code> for the given <code>Identifier</code> or null if not found
@@ -61,7 +61,8 @@ public abstract class FunctionDefinitionFactory {
public abstract FunctionDefinition getFunctionDefinition(Identifier functionId);
/**
- * Creates an instance of the <code>FunctionDefinitionFactory</code> using default configuration information.
+ * Creates an instance of the <code>FunctionDefinitionFactory</code> using default configuration
+ * information.
*
* @return the default <code>FunctionDefinitionFactory</code>
*/
@@ -70,18 +71,21 @@ public abstract class FunctionDefinitionFactory {
}
/**
- * Creates an instance of the <code>FunctionDefinitionFactory</code> using default configuration information.
+ * Creates an instance of the <code>FunctionDefinitionFactory</code> using default configuration
+ * information.
*
* @return the default <code>FunctionDefinitionFactory</code>
*/
public static FunctionDefinitionFactory newInstance(Properties properties) throws FactoryException {
- return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, FunctionDefinitionFactory.class, properties);
+ return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, FunctionDefinitionFactory.class,
+ properties);
}
/**
* Creates an instance of the <code>FunctionDefinitionFactory</code> using the given class name.
*
- * @param className the <code>String</code> class name of the <code>FunctionDefinitionFactory</code> to create
+ * @param className the <code>String</code> class name of the <code>FunctionDefinitionFactory</code> to
+ * create
* @return the <code>FunctionDefinitionFactory</code> for the given class name.
*/
public static FunctionDefinitionFactory newInstance(String className) throws FactoryException {
@@ -89,13 +93,16 @@ public abstract class FunctionDefinitionFactory {
}
/**
- * Creates an instance of the <code>FunctionDefinitionFactory</code> using the given class name using the given <code>ClassLoader</code>.
+ * Creates an instance of the <code>FunctionDefinitionFactory</code> using the given class name using the
+ * given <code>ClassLoader</code>.
*
- * @param className the <code>String</code> class name of the <code>FunctionDefinitionFactory</code> to create
+ * @param className the <code>String</code> class name of the <code>FunctionDefinitionFactory</code> to
+ * create
* @param classLoader the <code>ClassLoader</code> to use to load the class with the given class name
* @return the <code>FunctionDefinitionFactory</code> for the given class name
*/
- public static FunctionDefinitionFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
+ public static FunctionDefinitionFactory newInstance(String className, ClassLoader classLoader)
+ throws FactoryException {
return FactoryFinder.newInstance(className, FunctionDefinitionFactory.class, classLoader, false);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-openaz/blob/38b6d318/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Match.java
----------------------------------------------------------------------
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Match.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Match.java
index 696b7a4..301dced 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Match.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Match.java
@@ -52,22 +52,23 @@ import com.att.research.xacmlatt.pdp.policy.expressions.AttributeRetrievalBase;
/**
* Match extends {@link com.att.research.xacmlatt.pdp.policy.PolicyComponent} and implements the
* {@link com.att.research.xacmlatt.pdp.eval.Matchable} interface to represent a XACML Match element.
- *
*/
public class Match extends PolicyComponent implements Matchable {
- private Identifier matchId;
- private AttributeValue<?> attributeValue;
- private AttributeRetrievalBase attributeRetrievalBase;
- private PolicyDefaults policyDefaults;
- private FunctionDefinition functionDefinition;
+ private Identifier matchId;
+ private AttributeValue<?> attributeValue;
+ private AttributeRetrievalBase attributeRetrievalBase;
+ private PolicyDefaults policyDefaults;
+ private FunctionDefinition functionDefinition;
protected FunctionDefinition getFunctionDefinition() {
Identifier functionDefinitionId = this.getMatchId();
if (this.functionDefinition == null && functionDefinitionId != null) {
try {
- this.functionDefinition = FunctionDefinitionFactory.newInstance().getFunctionDefinition(functionDefinitionId);
+ this.functionDefinition = FunctionDefinitionFactory.newInstance()
+ .getFunctionDefinition(functionDefinitionId);
} catch (FactoryException ex) {
- this.setStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "FactoryException getting FunctionDefinition");
+ this.setStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR,
+ "FactoryException getting FunctionDefinition");
}
}
return this.functionDefinition;
@@ -84,12 +85,13 @@ public class Match extends PolicyComponent implements Matchable {
public Match() {
}
- public Match(Identifier matchIdIn, AttributeValue<?> attributeValueIn, AttributeRetrievalBase attributeRetrievalBaseIn, PolicyDefaults policyDefaultsIn) {
+ public Match(Identifier matchIdIn, AttributeValue<?> attributeValueIn,
+ AttributeRetrievalBase attributeRetrievalBaseIn, PolicyDefaults policyDefaultsIn) {
this(StdStatusCode.STATUS_CODE_OK);
- this.matchId = matchIdIn;
- this.attributeValue = attributeValueIn;
- this.attributeRetrievalBase = attributeRetrievalBaseIn;
- this.policyDefaults = policyDefaultsIn;
+ this.matchId = matchIdIn;
+ this.attributeValue = attributeValueIn;
+ this.attributeRetrievalBase = attributeRetrievalBaseIn;
+ this.policyDefaults = policyDefaultsIn;
}
public Identifier getMatchId() {
@@ -97,7 +99,7 @@ public class Match extends PolicyComponent implements Matchable {
}
public void setMatchId(Identifier matchIdIn) {
- this.matchId = matchIdIn;
+ this.matchId = matchIdIn;
}
public AttributeValue<?> getAttributeValue() {
@@ -105,7 +107,7 @@ public class Match extends PolicyComponent implements Matchable {
}
public void setAttributeValue(AttributeValue<?> attributeValueIn) {
- this.attributeValue = attributeValueIn;
+ this.attributeValue = attributeValueIn;
}
public AttributeRetrievalBase getAttributeRetrievalBase() {
@@ -113,7 +115,7 @@ public class Match extends PolicyComponent implements Matchable {
}
public void setAttributeRetrievalBase(AttributeRetrievalBase attributeRetrievalBaseIn) {
- this.attributeRetrievalBase = attributeRetrievalBaseIn;
+ this.attributeRetrievalBase = attributeRetrievalBaseIn;
}
public PolicyDefaults getPolicyDefaults() {
@@ -121,28 +123,33 @@ public class Match extends PolicyComponent implements Matchable {
}
public void setPolicyDefaults(PolicyDefaults policyDefaultsIn) {
- this.policyDefaults = policyDefaultsIn;
+ this.policyDefaults = policyDefaultsIn;
}
- private static MatchResult match(EvaluationContext evaluationContext, FunctionDefinition functionDefinition, FunctionArgument arg1, FunctionArgument arg2) throws EvaluationException {
- List<FunctionArgument> listArguments = new ArrayList<FunctionArgument>(2);
+ private static MatchResult match(EvaluationContext evaluationContext,
+ FunctionDefinition functionDefinition, FunctionArgument arg1,
+ FunctionArgument arg2) throws EvaluationException {
+ List<FunctionArgument> listArguments = new ArrayList<FunctionArgument>(2);
listArguments.add(arg1);
listArguments.add(arg2);
- ExpressionResult expressionResult = functionDefinition.evaluate(evaluationContext, listArguments);
- assert(expressionResult != null);
+ ExpressionResult expressionResult = functionDefinition.evaluate(evaluationContext, listArguments);
+ assert (expressionResult != null);
if (!expressionResult.isOk()) {
return new MatchResult(expressionResult.getStatus());
}
- AttributeValue<Boolean> attributeValueResult = null;
+ AttributeValue<Boolean> attributeValueResult = null;
try {
- attributeValueResult = DataTypes.DT_BOOLEAN.convertAttributeValue(expressionResult.getValue());
+ attributeValueResult = DataTypes.DT_BOOLEAN.convertAttributeValue(expressionResult.getValue());
} catch (DataTypeException ex) {
return new MatchResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
}
if (attributeValueResult == null) {
- return new MatchResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Non-boolean result from Match Function " + functionDefinition.getId() + " on " + expressionResult.getValue().toString()));
+ return new MatchResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR,
+ "Non-boolean result from Match Function "
+ + functionDefinition.getId() + " on "
+ + expressionResult.getValue().toString()));
} else if (attributeValueResult.getValue().booleanValue()) {
return MatchResult.MM_MATCH;
} else {
@@ -157,37 +164,44 @@ public class Match extends PolicyComponent implements Matchable {
return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
}
- FunctionDefinition functionDefinitionMatch = this.getFunctionDefinition();
- assert(functionDefinitionMatch != null);
+ FunctionDefinition functionDefinitionMatch = this.getFunctionDefinition();
+ assert (functionDefinitionMatch != null);
- AttributeValue<?> attributeValue = this.getAttributeValue();
- assert(attributeValue != null);
- FunctionArgument functionArgument1 = new FunctionArgumentAttributeValue(attributeValue);
+ AttributeValue<?> attributeValue = this.getAttributeValue();
+ assert (attributeValue != null);
+ FunctionArgument functionArgument1 = new FunctionArgumentAttributeValue(attributeValue);
- AttributeRetrievalBase attributeRetrievalBase = this.getAttributeRetrievalBase();
- assert(attributeRetrievalBase != null);
+ AttributeRetrievalBase attributeRetrievalBase = this.getAttributeRetrievalBase();
+ assert (attributeRetrievalBase != null);
- ExpressionResult expressionResult = attributeRetrievalBase.evaluate(evaluationContext, this.getPolicyDefaults());
- assert(expressionResult != null);
+ ExpressionResult expressionResult = attributeRetrievalBase.evaluate(evaluationContext,
+ this.getPolicyDefaults());
+ assert (expressionResult != null);
if (!expressionResult.isOk()) {
return new MatchResult(expressionResult.getStatus());
}
if (expressionResult.isBag()) {
- MatchResult matchResult = MatchResult.MM_NOMATCH;
- Bag bagAttributeValues = expressionResult.getBag();
+ MatchResult matchResult = MatchResult.MM_NOMATCH;
+ Bag bagAttributeValues = expressionResult.getBag();
if (bagAttributeValues != null) {
Iterator<AttributeValue<?>> iterAttributeValues = bagAttributeValues.getAttributeValues();
- while (matchResult.getMatchCode() != MatchResult.MatchCode.MATCH && iterAttributeValues.hasNext()) {
- MatchResult matchResultValue = match(evaluationContext, functionDefinitionMatch, functionArgument1, new FunctionArgumentAttributeValue(iterAttributeValues.next()));
- switch(matchResultValue.getMatchCode()) {
+ while (matchResult.getMatchCode() != MatchResult.MatchCode.MATCH
+ && iterAttributeValues.hasNext()) {
+ MatchResult matchResultValue = match(evaluationContext,
+ functionDefinitionMatch,
+ functionArgument1,
+ new FunctionArgumentAttributeValue(
+ iterAttributeValues
+ .next()));
+ switch (matchResultValue.getMatchCode()) {
case INDETERMINATE:
if (matchResult.getMatchCode() != MatchResult.MatchCode.INDETERMINATE) {
matchResult = matchResultValue;
}
break;
case MATCH:
- matchResult = matchResultValue;
+ matchResult = matchResultValue;
break;
case NOMATCH:
break;
@@ -199,12 +213,14 @@ public class Match extends PolicyComponent implements Matchable {
/*
* There is a single value, so add it as the second argument and do the one function evaluation
*/
- AttributeValue<?> attributeValueExpressionResult = expressionResult.getValue();
+ AttributeValue<?> attributeValueExpressionResult = expressionResult.getValue();
if (attributeValueExpressionResult == null) {
- return new MatchResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Null AttributeValue"));
+ return new MatchResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR,
+ "Null AttributeValue"));
}
- return match(evaluationContext, functionDefinitionMatch, functionArgument1, new FunctionArgumentAttributeValue(attributeValueExpressionResult));
+ return match(evaluationContext, functionDefinitionMatch, functionArgument1,
+ new FunctionArgumentAttributeValue(attributeValueExpressionResult));
}
}
@@ -218,16 +234,20 @@ public class Match extends PolicyComponent implements Matchable {
this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing MatchId");
return false;
} else if ((functionDefinitionHere = this.getFunctionDefinition()) == null) {
- this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Unknown MatchId \"" + this.getMatchId().toString() + "\"");
+ this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Unknown MatchId \""
+ + this.getMatchId().toString() + "\"");
return false;
} else if (functionDefinitionHere.returnsBag()) {
this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "FunctionDefinition returns a bag");
return false;
- } else if (functionDefinitionHere.getDataTypeId() == null || !functionDefinitionHere.getDataTypeId().equals(XACML.ID_DATATYPE_BOOLEAN)) {
- this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Non-Boolean return type for FunctionDefinition");
+ } else if (functionDefinitionHere.getDataTypeId() == null
+ || !functionDefinitionHere.getDataTypeId().equals(XACML.ID_DATATYPE_BOOLEAN)) {
+ this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR,
+ "Non-Boolean return type for FunctionDefinition");
return false;
} else if (this.getAttributeRetrievalBase() == null) {
- this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeSelector or AttributeDesignator");
+ this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR,
+ "Missing AttributeSelector or AttributeDesignator");
return false;
} else {
this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
@@ -237,7 +257,7 @@ public class Match extends PolicyComponent implements Matchable {
@Override
public String toString() {
- StringBuilder stringBuilder = new StringBuilder("{");
+ StringBuilder stringBuilder = new StringBuilder("{");
stringBuilder.append("super=");
stringBuilder.append(super.toString());
http://git-wip-us.apache.org/repos/asf/incubator-openaz/blob/38b6d318/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ObligationExpression.java
----------------------------------------------------------------------
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ObligationExpression.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ObligationExpression.java
index aeaade3..6c92bec 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ObligationExpression.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ObligationExpression.java
@@ -46,13 +46,11 @@ import com.att.research.xacmlatt.pdp.eval.EvaluationContext;
import com.att.research.xacmlatt.pdp.eval.EvaluationException;
/**
- * ObligationExpression extends {@link PolicyComponent} to implement the XACML
- * ObligationExpression element.
- *
+ * ObligationExpression extends {@link PolicyComponent} to implement the XACML ObligationExpression element.
*/
public class ObligationExpression extends PolicyComponent {
- private Identifier obligationId;
- private RuleEffect ruleEffect;
+ private Identifier obligationId;
+ private RuleEffect ruleEffect;
private List<AttributeAssignmentExpression> attributeAssignmentExpressions;
protected List<AttributeAssignmentExpression> getAttributeAssignmentExpressionList(boolean bNoNull) {
@@ -84,7 +82,7 @@ public class ObligationExpression extends PolicyComponent {
}
public void setObligationId(Identifier identifier) {
- this.obligationId = identifier;
+ this.obligationId = identifier;
}
public RuleEffect getRuleEffect() {
@@ -96,8 +94,10 @@ public class ObligationExpression extends PolicyComponent {
}
public Iterator<AttributeAssignmentExpression> getAttributeAssignmentExpressions() {
- List<AttributeAssignmentExpression> listAttributeAssignmentExpressions = this.getAttributeAssignmentExpressionList(false);
- return (listAttributeAssignmentExpressions == null ? null : listAttributeAssignmentExpressions.iterator());
+ List<AttributeAssignmentExpression> listAttributeAssignmentExpressions = this
+ .getAttributeAssignmentExpressionList(false);
+ return (listAttributeAssignmentExpressions == null ? null : listAttributeAssignmentExpressions
+ .iterator());
}
public void setAttributeAssignmentExpressions(Collection<AttributeAssignmentExpression> attributeAssignmentExpressionsIn) {
@@ -108,35 +108,45 @@ public class ObligationExpression extends PolicyComponent {
}
public void addAttributeAssignmentExpression(AttributeAssignmentExpression attributeAssignmentExpression) {
- List<AttributeAssignmentExpression> listAttributeAssignmentExpressions = this.getAttributeAssignmentExpressionList(true);
+ List<AttributeAssignmentExpression> listAttributeAssignmentExpressions = this
+ .getAttributeAssignmentExpressionList(true);
listAttributeAssignmentExpressions.add(attributeAssignmentExpression);
}
public void addAttributeAssignmentExpressions(Collection<AttributeAssignmentExpression> attributeAssignmentExpressionsIn) {
- List<AttributeAssignmentExpression> listAttributeAssignmentExpressions = this.getAttributeAssignmentExpressionList(true);
+ List<AttributeAssignmentExpression> listAttributeAssignmentExpressions = this
+ .getAttributeAssignmentExpressionList(true);
listAttributeAssignmentExpressions.addAll(attributeAssignmentExpressionsIn);
}
/**
- * Evaluates this <code>ObligationExpression</code> in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}
- * to get an {@link com.att.research.xacml.api.Obligation} to include in a PDP result.
+ * Evaluates this <code>ObligationExpression</code> in the given
+ * {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to get an
+ * {@link com.att.research.xacml.api.Obligation} to include in a PDP result.
*
- * @param evaluationContext the <code>EvaluationContext</code> in which to evaluate this <code>ObligationExpression</code>
+ * @param evaluationContext the <code>EvaluationContext</code> in which to evaluate this
+ * <code>ObligationExpression</code>
* @param policyDefaults the <code>PolicyDefaults</code> to apply to the evaluation
* @return a new <code>Obliagion</code> from this <code>ObligationExpression</code>
- * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException if there is an error evaluating any of the <code>AttributeAssignmentExpression</code>s
+ * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException if there is an error evaluating any of
+ * the <code>AttributeAssignmentExpression</code>s
*/
- public Obligation evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
+ public Obligation evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults)
+ throws EvaluationException {
if (!this.validate()) {
return null;
}
- List<AttributeAssignment> listAttributeAssignments = new ArrayList<AttributeAssignment>();
- Iterator<AttributeAssignmentExpression> iterAttributeAssignmentExpressions = this.getAttributeAssignmentExpressions();
+ List<AttributeAssignment> listAttributeAssignments = new ArrayList<AttributeAssignment>();
+ Iterator<AttributeAssignmentExpression> iterAttributeAssignmentExpressions = this
+ .getAttributeAssignmentExpressions();
if (iterAttributeAssignmentExpressions != null) {
while (iterAttributeAssignmentExpressions.hasNext()) {
- AttributeAssignmentResult attributeAssignmentResult = iterAttributeAssignmentExpressions.next().evaluate(evaluationContext, policyDefaults);
- if (attributeAssignmentResult.isOk() && attributeAssignmentResult.getNumAttributeAssignments() > 0) {
- Iterator<AttributeAssignment> iterAttributeAssignments = attributeAssignmentResult.getAttributeAssignments();
+ AttributeAssignmentResult attributeAssignmentResult = iterAttributeAssignmentExpressions
+ .next().evaluate(evaluationContext, policyDefaults);
+ if (attributeAssignmentResult.isOk()
+ && attributeAssignmentResult.getNumAttributeAssignments() > 0) {
+ Iterator<AttributeAssignment> iterAttributeAssignments = attributeAssignmentResult
+ .getAttributeAssignments();
while (iterAttributeAssignments.hasNext()) {
listAttributeAssignments.add(iterAttributeAssignments.next());
}
@@ -147,8 +157,8 @@ public class ObligationExpression extends PolicyComponent {
}
/**
- * Evaluates a <code>Collection</code> of <code>ObligationExpression</code>s in the given <code>EvaluationContext</code> and returns
- * a <code>List</code> of <code>Obligation</code>s.
+ * Evaluates a <code>Collection</code> of <code>ObligationExpression</code>s in the given
+ * <code>EvaluationContext</code> and returns a <code>List</code> of <code>Obligation</code>s.
*
* @param evaluationContext
* @param policyDefaults
@@ -156,17 +166,20 @@ public class ObligationExpression extends PolicyComponent {
* @return
* @throws com.att.research.xacmlatt.pdp.eval.EvaluationException
*/
- public static List<Obligation> evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults, Decision decision, Collection<ObligationExpression> listObligationExpressions) throws EvaluationException {
- List<Obligation> listObligations = new ArrayList<Obligation>();
- Iterator<ObligationExpression> iterObligationExpressions = listObligationExpressions.iterator();
+ public static List<Obligation> evaluate(EvaluationContext evaluationContext,
+ PolicyDefaults policyDefaults, Decision decision,
+ Collection<ObligationExpression> listObligationExpressions)
+ throws EvaluationException {
+ List<Obligation> listObligations = new ArrayList<Obligation>();
+ Iterator<ObligationExpression> iterObligationExpressions = listObligationExpressions.iterator();
while (iterObligationExpressions.hasNext()) {
- ObligationExpression obligationExpression = iterObligationExpressions.next();
+ ObligationExpression obligationExpression = iterObligationExpressions.next();
obligationExpression.validateComponent();
- if ( ! obligationExpression.isOk()) {
+ if (!obligationExpression.isOk()) {
throw new EvaluationException(obligationExpression.getStatusMessage());
}
if (decision == null || obligationExpression.getRuleEffect().getDecision().equals(decision)) {
- Obligation obligation = obligationExpression.evaluate(evaluationContext, policyDefaults);
+ Obligation obligation = obligationExpression.evaluate(evaluationContext, policyDefaults);
if (obligation != null) {
listObligations.add(obligation);
}
http://git-wip-us.apache.org/repos/asf/incubator-openaz/blob/38b6d318/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Policy.java
----------------------------------------------------------------------
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Policy.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Policy.java
index c7ea987..715ca9e 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Policy.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Policy.java
@@ -49,15 +49,15 @@ import com.att.research.xacmlatt.pdp.eval.EvaluationResult;
import com.att.research.xacmlatt.pdp.eval.MatchResult;
/**
- * Policy extends {@link com.att.research.xacmlatt.pdp.policy.PolicyDef} to represent a XACML 3.0 Policy element.
- *
+ * Policy extends {@link com.att.research.xacmlatt.pdp.policy.PolicyDef} to represent a XACML 3.0 Policy
+ * element.
*/
public class Policy extends PolicyDef {
- private TargetedCombinerParameterMap<String,Rule> ruleCombinerParameters = new TargetedCombinerParameterMap<String,Rule>();
- private VariableMap variableMap = new VariableMap();
- private List<Rule> rules = new ArrayList<Rule>();
- private List<CombiningElement<Rule>> combiningRules;
- private CombiningAlgorithm<Rule> ruleCombiningAlgorithm;
+ private TargetedCombinerParameterMap<String, Rule> ruleCombinerParameters = new TargetedCombinerParameterMap<String, Rule>();
+ private VariableMap variableMap = new VariableMap();
+ private List<Rule> rules = new ArrayList<Rule>();
+ private List<CombiningElement<Rule>> combiningRules;
+ private CombiningAlgorithm<Rule> ruleCombiningAlgorithm;
@Override
protected boolean validateComponent() {
@@ -80,11 +80,12 @@ public class Policy extends PolicyDef {
*/
protected List<CombiningElement<Rule>> getCombiningRules() {
if (this.combiningRules == null) {
- this.combiningRules = new ArrayList<CombiningElement<Rule>>();
- Iterator<Rule> iterRules = this.getRules();
+ this.combiningRules = new ArrayList<CombiningElement<Rule>>();
+ Iterator<Rule> iterRules = this.getRules();
while (iterRules.hasNext()) {
- Rule rule = iterRules.next();
- this.combiningRules.add(new CombiningElement<Rule>(rule, this.ruleCombinerParameters.getCombinerParameters(rule)));
+ Rule rule = iterRules.next();
+ this.combiningRules.add(new CombiningElement<Rule>(rule, this.ruleCombinerParameters
+ .getCombinerParameters(rule)));
}
}
return this.combiningRules;
@@ -112,45 +113,52 @@ public class Policy extends PolicyDef {
}
/**
- * Gets an <code>Iterator</code> over the {@link com.att.research.xacmlatt.pdp.policy.TargetedCombinerParameter}s for
- * the {@link Rule}s in this <code>Policy</code>.
+ * Gets an <code>Iterator</code> over the
+ * {@link com.att.research.xacmlatt.pdp.policy.TargetedCombinerParameter}s for the {@link Rule}s in this
+ * <code>Policy</code>.
*
- * @return an <code>Iterator</code> over the <code>TargetedCombinerParameter</code>s for this <code>Policy</code>.
+ * @return an <code>Iterator</code> over the <code>TargetedCombinerParameter</code>s for this
+ * <code>Policy</code>.
*/
- public Iterator<TargetedCombinerParameter<String,Rule>> getRuleCombinerParameters() {
+ public Iterator<TargetedCombinerParameter<String, Rule>> getRuleCombinerParameters() {
return this.ruleCombinerParameters.getTargetedCombinerParameters();
}
/**
- * Sets the Rule combiner parameters for this <code>Policy</code> to the contents of the given <code>Collection</code> of
- * <code>TargetedCombinerParameter</code>s.
+ * Sets the Rule combiner parameters for this <code>Policy</code> to the contents of the given
+ * <code>Collection</code> of <code>TargetedCombinerParameter</code>s.
*
- * @param ruleCombinerParameters the <code>Collection</code> of <code>TargetedCombinerParameter</code>s to set
+ * @param ruleCombinerParameters the <code>Collection</code> of <code>TargetedCombinerParameter</code>s to
+ * set
*/
- public void setRuleCombinerParameters(Collection<TargetedCombinerParameter<String,Rule>> ruleCombinerParameters) {
+ public void setRuleCombinerParameters(Collection<TargetedCombinerParameter<String, Rule>> ruleCombinerParameters) {
this.ruleCombinerParameters.setCombinerParameters(ruleCombinerParameters);
}
/**
- * Adds the given <code>TargetedCombinerParameter</code> to the set of Rule combiner parameters for this <code>Policy</code>.
+ * Adds the given <code>TargetedCombinerParameter</code> to the set of Rule combiner parameters for this
+ * <code>Policy</code>.
+ *
* @param ruleCombinerParameter the <code>TargetedCombinerParameter</code> for <code>Rule</code>s to add.
*/
- public void addRuleCombinerParameter(TargetedCombinerParameter<String,Rule> ruleCombinerParameter) {
+ public void addRuleCombinerParameter(TargetedCombinerParameter<String, Rule> ruleCombinerParameter) {
this.ruleCombinerParameters.addCombinerParameter(ruleCombinerParameter);
}
/**
- * Adds the contents of the given <code>Collection</code> of <code>TargetedCombinerParameter</code>s to the set of Rule combiner parameters
- * for this <code>Policy</code>.
+ * Adds the contents of the given <code>Collection</code> of <code>TargetedCombinerParameter</code>s to
+ * the set of Rule combiner parameters for this <code>Policy</code>.
*
- * @param ruleCombinerParameters the <code>Collection</code> of <code>TargetedCombinerParameter</code>s to add
+ * @param ruleCombinerParameters the <code>Collection</code> of <code>TargetedCombinerParameter</code>s to
+ * add
*/
- public void addRuleCombinerParameters(Collection<TargetedCombinerParameter<String,Rule>> ruleCombinerParameters) {
+ public void addRuleCombinerParameters(Collection<TargetedCombinerParameter<String, Rule>> ruleCombinerParameters) {
this.ruleCombinerParameters.addCombinerParameters(ruleCombinerParameters);
}
/**
- * Gets an <code>Iterator</code> over the {@link com.att.research.xacmlatt.pdp.policy.VariableDefinition}s in this <code>Policy</code>.
+ * Gets an <code>Iterator</code> over the {@link com.att.research.xacmlatt.pdp.policy.VariableDefinition}s
+ * in this <code>Policy</code>.
*
* @return an <code>Iterator</code> over the <code>VariableDefinition</code>s in this <code>Policy</code>
*/
@@ -162,14 +170,16 @@ public class Policy extends PolicyDef {
* Gets the <code>VariableDefinition</code> for the given <code>String</code> variable identifier.
*
* @param variableId the <code>String</code> variable identifier
- * @return the <code>VariableDefinition</code> with the given <code>String</code> identifier or null if not found
+ * @return the <code>VariableDefinition</code> with the given <code>String</code> identifier or null if
+ * not found
*/
public VariableDefinition getVariableDefinition(String variableId) {
return this.variableMap.getVariableDefinition(variableId);
}
/**
- * Sets the <code>VariableDefinition</code>s in this <code>Policy</code> to the contents of the given <code>Collection</code>.
+ * Sets the <code>VariableDefinition</code>s in this <code>Policy</code> to the contents of the given
+ * <code>Collection</code>.
*
* @param listVariableDefinitions the <code>Collection</code> of <code>VariableDefinition</code>s to set
*/
@@ -178,7 +188,8 @@ public class Policy extends PolicyDef {
}
/**
- * Adds the given <code>VariableDefinition</code> to the set of <code>VariableDefinition</code>s for this <code>Policy</code>.
+ * Adds the given <code>VariableDefinition</code> to the set of <code>VariableDefinition</code>s for this
+ * <code>Policy</code>.
*
* @param variableDefinition the <code>VariableDefinition</code> to add
*/
@@ -187,7 +198,8 @@ public class Policy extends PolicyDef {
}
/**
- * Adds the contents of the given <code>Collection</code> of <code>VariableDefinition</code>s to this <code>Policy</code>.
+ * Adds the contents of the given <code>Collection</code> of <code>VariableDefinition</code>s to this
+ * <code>Policy</code>.
*
* @param variableDefinitions the <code>Collection</code> of <code>VariableDefinition</code>s to add.
*/
@@ -196,17 +208,20 @@ public class Policy extends PolicyDef {
}
/**
- * Gets an <code>Iterator</code> over the <code>Rule</code>s in this <code>Policy</code> or null if there are none.
+ * Gets an <code>Iterator</code> over the <code>Rule</code>s in this <code>Policy</code> or null if there
+ * are none.
*
- * @return an <code>Iterator</code> over the <code>Rule</code>s in this <code>Policy</code> or null if there are none.
+ * @return an <code>Iterator</code> over the <code>Rule</code>s in this <code>Policy</code> or null if
+ * there are none.
*/
public Iterator<Rule> getRules() {
return this.rules.iterator();
}
/**
- * Sets the <code>Rule</code>s for this <code>Policy</code> to the contents of the given <code>Collection</code> of
- * <code>Rule</code>s. If the <code>Collection</code> is null, the set of <code>Rule</code>s for this <code>Policy</code> is set to null.
+ * Sets the <code>Rule</code>s for this <code>Policy</code> to the contents of the given
+ * <code>Collection</code> of <code>Rule</code>s. If the <code>Collection</code> is null, the set of
+ * <code>Rule</code>s for this <code>Policy</code> is set to null.
*
* @param listRules the <code>Collection</code> of <code>Rule</code>s or null
*/
@@ -227,8 +242,8 @@ public class Policy extends PolicyDef {
}
/**
- * Adds the contents of the given <code>Collection</code> of <code>Rule</code>s to the set of <code>Rule</code>s for
- * this <code>Policy</code>.
+ * Adds the contents of the given <code>Collection</code> of <code>Rule</code>s to the set of
+ * <code>Rule</code>s for this <code>Policy</code>.
*
* @param listRules the <code>Collection</code> of <code>Rule</code>s to add
*/
@@ -248,16 +263,17 @@ public class Policy extends PolicyDef {
/**
* Sets the <code>CombiningAlgorithm</code> for <code>Rule</code>s for this <code>Policy</code>>
*
- * @param ruleCombiningAlgorithmIn the <code>CombiningAlgorithm</code> for <code>Rule</code>s for this <code>Policy</code>
+ * @param ruleCombiningAlgorithmIn the <code>CombiningAlgorithm</code> for <code>Rule</code>s for this
+ * <code>Policy</code>
*/
public void setRuleCombiningAlgorithm(CombiningAlgorithm<Rule> ruleCombiningAlgorithmIn) {
- this.ruleCombiningAlgorithm = ruleCombiningAlgorithmIn;
+ this.ruleCombiningAlgorithm = ruleCombiningAlgorithmIn;
}
@Override
public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException {
/*
- * First check to see if we are valid. If not, return an error status immediately
+ * First check to see if we are valid. If not, return an error status immediately
*/
if (!this.validate()) {
return new EvaluationResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
@@ -266,12 +282,12 @@ public class Policy extends PolicyDef {
/*
* See if we match
*/
- MatchResult thisMatchResult = this.match(evaluationContext);
- assert(thisMatchResult != null);
+ MatchResult thisMatchResult = this.match(evaluationContext);
+ assert (thisMatchResult != null);
if (evaluationContext.isTracing()) {
evaluationContext.trace(new StdTraceEvent<MatchResult>("Match", this, thisMatchResult));
}
- switch(thisMatchResult.getMatchCode()) {
+ switch (thisMatchResult.getMatchCode()) {
case INDETERMINATE:
return new EvaluationResult(Decision.INDETERMINATE, thisMatchResult.getStatus());
case MATCH:
@@ -283,17 +299,19 @@ public class Policy extends PolicyDef {
/*
* Get the combining elements
*/
- List<CombiningElement<Rule>> ruleCombiningElements = this.getCombiningRules();
- assert(ruleCombiningElements != null);
+ List<CombiningElement<Rule>> ruleCombiningElements = this.getCombiningRules();
+ assert (ruleCombiningElements != null);
/*
* Run the combining algorithm
*/
- assert(this.getRuleCombiningAlgorithm() != null);
- EvaluationResult evaluationResultCombined = this.getRuleCombiningAlgorithm().combine(evaluationContext, ruleCombiningElements, this.getCombinerParameterList());
- assert(evaluationResultCombined != null);
+ assert (this.getRuleCombiningAlgorithm() != null);
+ EvaluationResult evaluationResultCombined = this.getRuleCombiningAlgorithm()
+ .combine(evaluationContext, ruleCombiningElements, this.getCombinerParameterList());
+ assert (evaluationResultCombined != null);
- if (evaluationResultCombined.getDecision() == Decision.DENY || evaluationResultCombined.getDecision() == Decision.PERMIT) {
+ if (evaluationResultCombined.getDecision() == Decision.DENY
+ || evaluationResultCombined.getDecision() == Decision.PERMIT) {
this.updateResult(evaluationResultCombined, evaluationContext);
/*
@@ -311,7 +329,7 @@ public class Policy extends PolicyDef {
@Override
public String toString() {
- StringBuilder stringBuilder = new StringBuilder("{");
+ StringBuilder stringBuilder = new StringBuilder("{");
stringBuilder.append("super=");
stringBuilder.append(super.toString());
http://git-wip-us.apache.org/repos/asf/incubator-openaz/blob/38b6d318/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyComponent.java
----------------------------------------------------------------------
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyComponent.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyComponent.java
index a1f9c7e..3926569 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyComponent.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyComponent.java
@@ -34,28 +34,30 @@ import com.att.research.xacml.api.StatusCode;
import com.att.research.xacml.std.StdStatusCode;
/**
- * PolicyComponent is the base class for all pieces of a XACML Policy or PolicySet that could potentially have errors associated
- * with them by the policy loader.
- *
+ * PolicyComponent is the base class for all pieces of a XACML Policy or PolicySet that could potentially have
+ * errors associated with them by the policy loader.
*/
abstract class PolicyComponent {
- private StatusCode statusCode;
- private String statusMessage;
+ private StatusCode statusCode;
+ private String statusMessage;
/**
- * Creates a new <code>PolicyComponent</code> with the given {@link com.att.research.xacml.api.StatusCode} and
- * <code>String</code> detailed message. If the <code>StatusCode</code> is null, a default OK status code is used.
+ * Creates a new <code>PolicyComponent</code> with the given {@link com.att.research.xacml.api.StatusCode}
+ * and <code>String</code> detailed message. If the <code>StatusCode</code> is null, a default OK status
+ * code is used.
*
* @param statusCodeIn the <code>StatusCode</code> for the new <code>PolicyComponent</code>
- * @param statusMessageIn the <code>String</code> detailed status message for the new <code>PolicyComponent</code>
+ * @param statusMessageIn the <code>String</code> detailed status message for the new
+ * <code>PolicyComponent</code>
*/
public PolicyComponent(StatusCode statusCodeIn, String statusMessageIn) {
- this.statusCode = statusCodeIn;
- this.statusMessage = statusMessageIn;
+ this.statusCode = statusCodeIn;
+ this.statusMessage = statusMessageIn;
}
/**
- * Creates a new <code>PolicyComponent</code> with the given <code>StatusCode</code> and no status message.
+ * Creates a new <code>PolicyComponent</code> with the given <code>StatusCode</code> and no status
+ * message.
*
* @param statusCodeIn the <code>StatusCode</code> for the new <code>PolicyComponent</code>
*/
@@ -82,28 +84,29 @@ abstract class PolicyComponent {
/**
* Gets the <code>String</code> status message associated with this <code>PolicyComponent</code>.
*
- * @return the <code>String</code> status message associated with this <code>PolicyComponent</code> or null if none
+ * @return the <code>String</code> status message associated with this <code>PolicyComponent</code> or
+ * null if none
*/
public String getStatusMessage() {
return this.statusMessage;
}
/**
- * Sets the <code>StatusCode</code> and <code>String</code> status message for this <code>PolicyComponent</code>.
- * This method is mainly provided for objects that may have lazy evaluations performed on them, in which case the
- * status is not determined until the object is actually used.
+ * Sets the <code>StatusCode</code> and <code>String</code> status message for this
+ * <code>PolicyComponent</code>. This method is mainly provided for objects that may have lazy evaluations
+ * performed on them, in which case the status is not determined until the object is actually used.
*
* @param statusCodeIn the <code>StatusCode</code> for this <code>PolicyComponent</code>
* @param messageIn the <code>String</code> status message for this <code>PolicyComponent</code>
*/
public void setStatus(StatusCode statusCodeIn, String messageIn) {
- this.statusCode = statusCodeIn;
- this.statusMessage = messageIn;
+ this.statusCode = statusCodeIn;
+ this.statusMessage = messageIn;
}
/**
- * Does a check on the <code>StatusCode</code> for this element to determine if it is equivalent to the
- * OK status code.
+ * Does a check on the <code>StatusCode</code> for this element to determine if it is equivalent to the OK
+ * status code.
*
* @return true if the <code>StatusCode</code> is equivalent to OK, otherwise false
*/
@@ -112,20 +115,20 @@ abstract class PolicyComponent {
}
/**
- * Validates that this <code>PolicyComponent</code> has all of the required elements according to the XACML 3.0
- * specification. If the component is not valid, this method should set the <code>StatusCode</code> to reflect a
- * syntax error, and should set the status message to reflect the invalid piece(s).
- *
- * <code>PolicyComponent</code>s that implement this method should only validate their immediate elements and not perform
- * a deep validation of descendents.
+ * Validates that this <code>PolicyComponent</code> has all of the required elements according to the
+ * XACML 3.0 specification. If the component is not valid, this method should set the
+ * <code>StatusCode</code> to reflect a syntax error, and should set the status message to reflect the
+ * invalid piece(s). <code>PolicyComponent</code>s that implement this method should only validate their
+ * immediate elements and not perform a deep validation of descendents.
*
* @return true if the resulting status code is OK, otherwise false
*/
abstract protected boolean validateComponent();
/**
- * If a <code>StatusCode</code> has not been set, ask this <code>PolicyComponent</code> to validate itself and return
- * the value from the validation. Otherwise, check to see if the cached <code>StatusCode</code> indicates this <code>PolicyComponent</code> is valid.
+ * If a <code>StatusCode</code> has not been set, ask this <code>PolicyComponent</code> to validate itself
+ * and return the value from the validation. Otherwise, check to see if the cached <code>StatusCode</code>
+ * indicates this <code>PolicyComponent</code> is valid.
*
* @return true if this <code>PolicyComponent</code> is valid, else false.
*/
@@ -139,13 +142,13 @@ abstract class PolicyComponent {
@Override
public String toString() {
- StringBuilder stringBuilder = new StringBuilder("{");
+ StringBuilder stringBuilder = new StringBuilder("{");
Object objectToDump;
- boolean needsComma = false;
+ boolean needsComma = false;
if ((objectToDump = this.getStatusCode()) != null) {
stringBuilder.append("statusCode=");
stringBuilder.append(objectToDump.toString());
- needsComma = true;
+ needsComma = true;
}
if ((objectToDump = this.getStatusMessage()) != null) {
if (needsComma) {
@@ -153,7 +156,7 @@ abstract class PolicyComponent {
}
stringBuilder.append("statusMessage=");
stringBuilder.append((String)objectToDump);
- needsComma = true;
+ needsComma = true;
}
stringBuilder.append('}');
return stringBuilder.toString();
http://git-wip-us.apache.org/repos/asf/incubator-openaz/blob/38b6d318/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDef.java
----------------------------------------------------------------------
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDef.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDef.java
index 0a5b4d8..82096d6 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDef.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDef.java
@@ -53,37 +53,36 @@ import com.att.research.xacmlatt.pdp.eval.EvaluationResult;
import com.att.research.xacmlatt.pdp.eval.MatchResult;
/**
- * PolicyDef extends {@link com.att.research.xacmlatt.pdp.policy.PolicySetChild} with members and methods common
- * to XACML 3.0 Policies and PolicySets.
- *
+ * PolicyDef extends {@link com.att.research.xacmlatt.pdp.policy.PolicySetChild} with members and methods
+ * common to XACML 3.0 Policies and PolicySets.
*/
public abstract class PolicyDef extends PolicySetChild {
- private String description;
- private PolicyIssuer policyIssuer;
- private Target target;
- private List<CombinerParameter> combinerParameters;
- private List<ObligationExpression> obligationExpressions;
- private List<AdviceExpression> adviceExpressions;
- private Version version;
- private Integer maxDelegationDepth;
+ private String description;
+ private PolicyIssuer policyIssuer;
+ private Target target;
+ private List<CombinerParameter> combinerParameters;
+ private List<ObligationExpression> obligationExpressions;
+ private List<AdviceExpression> adviceExpressions;
+ private Version version;
+ private Integer maxDelegationDepth;
- private IdReference idReference;
+ private IdReference idReference;
private void ensureCombinerParameters() {
if (this.combinerParameters == null) {
- this.combinerParameters = new ArrayList<CombinerParameter>();
+ this.combinerParameters = new ArrayList<CombinerParameter>();
}
}
private void ensureObligationExpressions() {
if (this.obligationExpressions == null) {
- this.obligationExpressions = new ArrayList<ObligationExpression>();
+ this.obligationExpressions = new ArrayList<ObligationExpression>();
}
}
private void ensureAdviceExpressions() {
if (this.adviceExpressions == null) {
- this.adviceExpressions = new ArrayList<AdviceExpression>();
+ this.adviceExpressions = new ArrayList<AdviceExpression>();
}
}
@@ -99,18 +98,24 @@ public abstract class PolicyDef extends PolicySetChild {
return this.adviceExpressions;
}
- protected void updateResult(EvaluationResult evaluationResult, EvaluationContext evaluationContext) throws EvaluationException {
- List<ObligationExpression> thisObligationExpressions = this.getObligationExpressionList();
+ protected void updateResult(EvaluationResult evaluationResult, EvaluationContext evaluationContext)
+ throws EvaluationException {
+ List<ObligationExpression> thisObligationExpressions = this.getObligationExpressionList();
if (thisObligationExpressions != null && thisObligationExpressions.size() > 0) {
- List<Obligation> listObligations = ObligationExpression.evaluate(evaluationContext, this.getPolicyDefaults(), evaluationResult.getDecision(), thisObligationExpressions);
+ List<Obligation> listObligations = ObligationExpression.evaluate(evaluationContext,
+ this.getPolicyDefaults(),
+ evaluationResult.getDecision(),
+ thisObligationExpressions);
if (listObligations != null && listObligations.size() > 0) {
evaluationResult.addObligations(listObligations);
}
}
- List<AdviceExpression> thisAdviceExpressions = this.getAdviceExpressionList();
+ List<AdviceExpression> thisAdviceExpressions = this.getAdviceExpressionList();
if (thisAdviceExpressions != null && thisAdviceExpressions.size() > 0) {
- List<Advice> listAdvices = AdviceExpression.evaluate(evaluationContext, this.getPolicyDefaults(), evaluationResult.getDecision(), thisAdviceExpressions);
+ List<Advice> listAdvices = AdviceExpression.evaluate(evaluationContext, this.getPolicyDefaults(),
+ evaluationResult.getDecision(),
+ thisAdviceExpressions);
if (listAdvices != null && listAdvices.size() > 0) {
evaluationResult.addAdvice(listAdvices);
}
@@ -124,7 +129,9 @@ public abstract class PolicyDef extends PolicySetChild {
this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing version string");
return false;
} else if (this.getTarget() == null) {
- this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Target in policy " + this.getIdReference().getId().stringValue());
+ this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Target in policy "
+ + this.getIdReference().getId()
+ .stringValue());
return false;
} else {
return true;
@@ -157,7 +164,7 @@ public abstract class PolicyDef extends PolicySetChild {
@Override
public void setIdentifier(Identifier identifierIn) {
super.setIdentifier(identifierIn);
- this.idReference = null;
+ this.idReference = null;
}
/**
@@ -175,7 +182,7 @@ public abstract class PolicyDef extends PolicySetChild {
* @param s the <code>String</code> description of this <code>PolicyDef</code>
*/
public void setDescription(String s) {
- this.description = s;
+ this.description = s;
}
/**
@@ -193,7 +200,7 @@ public abstract class PolicyDef extends PolicySetChild {
* @param policyIssuerIn the <code>PolicyIssuer</code> for this <code>PolicyDef</code>.
*/
public void setPolicyIssuer(PolicyIssuer policyIssuerIn) {
- this.policyIssuer = policyIssuerIn;
+ this.policyIssuer = policyIssuerIn;
}
/**
@@ -211,24 +218,26 @@ public abstract class PolicyDef extends PolicySetChild {
* @param targetIn the <code>Target</code> for this <code>PolicyDef</code>
*/
public void setTarget(Target targetIn) {
- this.target = targetIn;
+ this.target = targetIn;
}
/**
* Gets an <code>Iterator</code> over the <code>CombinerParameter</code>s for this <code>Policy</code>.
*
- * @return an <code>Iterator</code> over the <code>CombinerParameter</code>s for this <code>Policy</code> or null if there are none
+ * @return an <code>Iterator</code> over the <code>CombinerParameter</code>s for this <code>Policy</code>
+ * or null if there are none
*/
public Iterator<CombinerParameter> getCombinerParameters() {
return (this.combinerParameters == null ? null : this.combinerParameters.iterator());
}
/**
- * Sets the <code>CombinerParameter</code>s for this<code>Policy</code> to the contents of the
- * given <code>Collection</code>. If the <code>Collection</code> is null, the set of <code>CombinerParameter</code>s
- * for this <code>Policy</code> is set to null.
+ * Sets the <code>CombinerParameter</code>s for this<code>Policy</code> to the contents of the given
+ * <code>Collection</code>. If the <code>Collection</code> is null, the set of
+ * <code>CombinerParameter</code>s for this <code>Policy</code> is set to null.
*
- * @param combinerParametersIn the <code>Collection</code> of <code>CombinerParameter</code>s for this <code>PolicyDef</code>
+ * @param combinerParametersIn the <code>Collection</code> of <code>CombinerParameter</code>s for this
+ * <code>PolicyDef</code>
*/
public void setCombinerParameters(Collection<CombinerParameter> combinerParametersIn) {
this.combinerParameters = null;
@@ -249,7 +258,8 @@ public abstract class PolicyDef extends PolicySetChild {
}
/**
- * Adds the given <code>Collection</code> of <code>CombinerParameter</code>s to this <code>PolicyDef</code>>
+ * Adds the given <code>Collection</code> of <code>CombinerParameter</code>s to this
+ * <code>PolicyDef</code>>
*
* @param combinerParametersIn the <code>Collection</code> of <code>CombinerParameter</code>s to add
*/
@@ -259,29 +269,34 @@ public abstract class PolicyDef extends PolicySetChild {
}
/**
- * Gets an <code>Iterator</code> over the <code>ObligationExpression</code>s for this <code>PolicyDef</code>.
+ * Gets an <code>Iterator</code> over the <code>ObligationExpression</code>s for this
+ * <code>PolicyDef</code>.
*
- * @return an <code>Iterator</code> over the <code>ObligationExpression</code>s for this <code>PolicyDef</code> or null if there are none.
+ * @return an <code>Iterator</code> over the <code>ObligationExpression</code>s for this
+ * <code>PolicyDef</code> or null if there are none.
*/
public Iterator<ObligationExpression> getObligationExpressions() {
return (this.obligationExpressions == null ? null : this.obligationExpressions.iterator());
}
/**
- * Sets the <code>ObligationExpression</code>s for this <code>PolicyDef</code> to the contents of the given <code>Collection</code>.
- * If the <code>Collection</code> is null, the <code>ObligationExpression</code>s for this <code>PolicyDef</code> are set to null.
+ * Sets the <code>ObligationExpression</code>s for this <code>PolicyDef</code> to the contents of the
+ * given <code>Collection</code>. If the <code>Collection</code> is null, the
+ * <code>ObligationExpression</code>s for this <code>PolicyDef</code> are set to null.
*
- * @param obligationExpressionsIn the <code>Collection</code> of <code>ObligationExpression</code>s for this <code>PolicyDef</code>.
+ * @param obligationExpressionsIn the <code>Collection</code> of <code>ObligationExpression</code>s for
+ * this <code>PolicyDef</code>.
*/
public void setObligationExpressions(Collection<ObligationExpression> obligationExpressionsIn) {
- this.obligationExpressions = null;
+ this.obligationExpressions = null;
if (obligationExpressionsIn != null) {
this.addObligationExpressions(obligationExpressionsIn);
}
}
/**
- * Adds the given <code>ObligationExpression</code> to the set of <code>ObligationExpression</code>s for this <code>PolicyDef</code>.
+ * Adds the given <code>ObligationExpression</code> to the set of <code>ObligationExpression</code>s for
+ * this <code>PolicyDef</code>.
*
* @param obligationExpression the <code>ObligationExpression</code> to add
*/
@@ -291,8 +306,8 @@ public abstract class PolicyDef extends PolicySetChild {
}
/**
- * Adds the contents of the given <code>Collection</code> of <code>ObligationExpression</code>s to the set of <code>ObligationExpression</code>s for
- * this <code>PolicyDef</code>.
+ * Adds the contents of the given <code>Collection</code> of <code>ObligationExpression</code>s to the set
+ * of <code>ObligationExpression</code>s for this <code>PolicyDef</code>.
*
* @param obligationExpressionsIn the <code>Collection</code> of <code>ObligationExpression</code>s to add
*/
@@ -302,28 +317,32 @@ public abstract class PolicyDef extends PolicySetChild {
}
/**
- * Gets an <code>Iterator</code> over the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code>.
+ * Gets an <code>Iterator</code> over the set of <code>AdviceExpression</code>s for this
+ * <code>PolicyDef</code>.
*
- * @return an <code>Iterator</code> over the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code> or null if there are none.
+ * @return an <code>Iterator</code> over the set of <code>AdviceExpression</code>s for this
+ * <code>PolicyDef</code> or null if there are none.
*/
public Iterator<AdviceExpression> getAdviceExpressions() {
return (this.adviceExpressions == null ? null : this.adviceExpressions.iterator());
}
/**
- * Sets the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code> to the contents of the given <code>Collection</code>.
+ * Sets the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code> to the contents of the
+ * given <code>Collection</code>.
*
* @param adviceExpressionsIn the <code>Collection</code> of <code>AdviceExpression</code> to add
*/
public void setAdviceExpressions(Collection<AdviceExpression> adviceExpressionsIn) {
- this.adviceExpressions = null;
+ this.adviceExpressions = null;
if (adviceExpressionsIn != null) {
this.addAdviceExpressions(adviceExpressionsIn);
}
}
/**
- * Adds the given <code>AdviceExpression</code> to the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code>.
+ * Adds the given <code>AdviceExpression</code> to the set of <code>AdviceExpression</code>s for this
+ * <code>PolicyDef</code>.
*
* @param adviceExpression the <code>AdviceExpression</code> to add.
*/
@@ -358,8 +377,8 @@ public abstract class PolicyDef extends PolicySetChild {
* @param versionIn the <code>String</code> version for this <code>PolicyDef</code>
*/
public void setVersion(Version versionIn) {
- this.version = versionIn;
- this.idReference = null;
+ this.version = versionIn;
+ this.idReference = null;
}
/**
@@ -369,14 +388,15 @@ public abstract class PolicyDef extends PolicySetChild {
*/
public IdReference getIdReference() {
if (this.idReference == null) {
- this.idReference = new StdIdReference(this.getIdentifier(), this.getVersion());
+ this.idReference = new StdIdReference(this.getIdentifier(), this.getVersion());
}
return this.idReference;
}
public boolean matches(IdReferenceMatch idReferenceRequest) {
- IdReference thisIdReference = this.getIdReference();
- if (thisIdReference == null || thisIdReference.getId() == null || idReferenceRequest == null || idReferenceRequest.getId() == null) {
+ IdReference thisIdReference = this.getIdReference();
+ if (thisIdReference == null || thisIdReference.getId() == null || idReferenceRequest == null
+ || idReferenceRequest.getId() == null) {
return false;
} else if (!thisIdReference.getId().equals(idReferenceRequest.getId())) {
return false;
@@ -385,7 +405,7 @@ public abstract class PolicyDef extends PolicySetChild {
/*
* Now do version number matching
*/
- VersionMatch idReferenceRequestVersion = idReferenceRequest.getVersion();
+ VersionMatch idReferenceRequestVersion = idReferenceRequest.getVersion();
if (idReferenceRequestVersion != null) {
/*
* Do exact version matching
@@ -397,8 +417,8 @@ public abstract class PolicyDef extends PolicySetChild {
return idReferenceRequestVersion.match(thisVersion, 0);
}
} else {
- VersionMatch idReferenceRequestEarliestVersion = idReferenceRequest.getEarliestVersion();
- Version thisVersion = thisIdReference.getVersion();
+ VersionMatch idReferenceRequestEarliestVersion = idReferenceRequest.getEarliestVersion();
+ Version thisVersion = thisIdReference.getVersion();
if (idReferenceRequestEarliestVersion != null) {
if (thisVersion == null) {
@@ -408,7 +428,7 @@ public abstract class PolicyDef extends PolicySetChild {
}
}
- VersionMatch idReferenceRequestLatestVersion = idReferenceRequest.getLatestVersion();
+ VersionMatch idReferenceRequestLatestVersion = idReferenceRequest.getLatestVersion();
if (idReferenceRequestLatestVersion != null) {
if (thisVersion == null) {
return false;
@@ -432,6 +452,7 @@ public abstract class PolicyDef extends PolicySetChild {
/**
* Sets the <code>Integer</code> maximum delegation depth for this <code>PolicyDef</code>
+ *
* @param i the <code>Integer</code> maximum delegation depth for this <code>PolicyDef</code>
*/
public void setMaxDelegationDepth(Integer i) {
@@ -440,7 +461,7 @@ public abstract class PolicyDef extends PolicySetChild {
@Override
public String toString() {
- StringBuilder stringBuilder = new StringBuilder("{");
+ StringBuilder stringBuilder = new StringBuilder("{");
stringBuilder.append("super=");
stringBuilder.append(super.toString());
http://git-wip-us.apache.org/repos/asf/incubator-openaz/blob/38b6d318/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDefaults.java
----------------------------------------------------------------------
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDefaults.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDefaults.java
index 65af44d..868239f 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDefaults.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDefaults.java
@@ -35,12 +35,11 @@ import java.net.URI;
import com.att.research.xacml.api.XACML;
/**
- * PolicyDefaults represents the default values associated with a XACML 3.0 Policy or PolicySet that may
- * be overridden or inherited by child Policies or PolicySets.
- *
+ * PolicyDefaults represents the default values associated with a XACML 3.0 Policy or PolicySet that may be
+ * overridden or inherited by child Policies or PolicySets.
*/
public class PolicyDefaults {
- private static URI xpathVersionDefault;
+ private static URI xpathVersionDefault;
static {
try {
@@ -50,19 +49,21 @@ public class PolicyDefaults {
}
}
- private URI xpathVersion;
- private PolicyDefaults policyDefaultsParent;
+ private URI xpathVersion;
+ private PolicyDefaults policyDefaultsParent;
/**
- * Creates a new <code>PolicyDefaults</code> with the given <code>URI</code> for the XPath version and
- * the given <code>PolicyDefaults</code> pointing to the parent.
+ * Creates a new <code>PolicyDefaults</code> with the given <code>URI</code> for the XPath version and the
+ * given <code>PolicyDefaults</code> pointing to the parent.
*
- * @param xpathVersionIn the <code>URI</code> representing the XPath version for the new <code>PolicyDefaults</code>
- * @param policyDefaultsParentIn the <code>PolicyDefaults</code> object that is the parent of the new <code>PolicyDefaults</code>
+ * @param xpathVersionIn the <code>URI</code> representing the XPath version for the new
+ * <code>PolicyDefaults</code>
+ * @param policyDefaultsParentIn the <code>PolicyDefaults</code> object that is the parent of the new
+ * <code>PolicyDefaults</code>
*/
public PolicyDefaults(URI xpathVersionIn, PolicyDefaults policyDefaultsParentIn) {
- this.xpathVersion = xpathVersionIn;
- this.policyDefaultsParent = policyDefaultsParentIn;
+ this.xpathVersion = xpathVersionIn;
+ this.policyDefaultsParent = policyDefaultsParentIn;
}
/**
@@ -75,9 +76,9 @@ public class PolicyDefaults {
}
/**
- * Gets the XPath version <code>URI</code> for this <code>PolicyDefaults</code>. If there is no explicit
- * version in this <code>PolicyDefaults</code>, walk up the parent <code>PolicyDefaults</code> hierarchy until
- * one is found, or return the default value.
+ * Gets the XPath version <code>URI</code> for this <code>PolicyDefaults</code>. If there is no explicit
+ * version in this <code>PolicyDefaults</code>, walk up the parent <code>PolicyDefaults</code> hierarchy
+ * until one is found, or return the default value.
*
* @return the <code>URI</code> for the XPath version
*/
@@ -92,7 +93,7 @@ public class PolicyDefaults {
/*
* Try the parent hierarchy if there is one
*/
- PolicyDefaults policyDefaultsParentThis = this.getPolicyDefaultsParent();
+ PolicyDefaults policyDefaultsParentThis = this.getPolicyDefaultsParent();
if (policyDefaultsParentThis != null) {
return policyDefaultsParentThis.getXPathVersion();
}
@@ -105,14 +106,14 @@ public class PolicyDefaults {
@Override
public String toString() {
- StringBuilder stringBuilder = new StringBuilder("{");
+ StringBuilder stringBuilder = new StringBuilder("{");
- boolean needsComma = false;
+ boolean needsComma = false;
Object objectToDump;
if ((objectToDump = this.xpathVersion) != null) {
stringBuilder.append("xpathVersion=");
stringBuilder.append(objectToDump.toString());
- needsComma = true;
+ needsComma = true;
}
if ((objectToDump = this.getPolicyDefaultsParent()) != null) {
if (needsComma) {
@@ -120,7 +121,7 @@ public class PolicyDefaults {
}
stringBuilder.append("policyDefaultsParent=");
stringBuilder.append(objectToDump.toString());
- needsComma = true;
+ needsComma = true;
}
stringBuilder.append('}');
return stringBuilder.toString();
http://git-wip-us.apache.org/repos/asf/incubator-openaz/blob/38b6d318/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinder.java
----------------------------------------------------------------------
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinder.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinder.java
index 3ee2285..c254dcd 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinder.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinder.java
@@ -34,16 +34,16 @@ import com.att.research.xacml.api.IdReferenceMatch;
import com.att.research.xacmlatt.pdp.eval.EvaluationContext;
/**
- * PolicyFinder is the interface for objects that can locate XACML Policies and PolicySets by identifier and contains the root
- * Policy or Policy set. The interface is designed to allow for finders that can retrieve a root policy from a repository based on
- * matching a {@link com.att.research.xacml.api.Request}.
- *
+ * PolicyFinder is the interface for objects that can locate XACML Policies and PolicySets by identifier and
+ * contains the root Policy or Policy set. The interface is designed to allow for finders that can retrieve a
+ * root policy from a repository based on matching a {@link com.att.research.xacml.api.Request}.
*/
public interface PolicyFinder {
/**
- * Gets the root {@link PolicyDef} from the policy store
- * configured by the particular implementation of the <code>PolicyFinderFactory</code> class that
- * is applicable to the {@link com.att.research.xacml.api.Request} in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}.
+ * Gets the root {@link PolicyDef} from the policy store configured by the particular implementation of
+ * the <code>PolicyFinderFactory</code> class that is applicable to the
+ * {@link com.att.research.xacml.api.Request} in the given
+ * {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}.
*
* @return a <code>PolicyFinderResult</code> with the root <code>PolicyDef</code>
*/
@@ -53,7 +53,8 @@ public interface PolicyFinder {
* Gets the {@link Policy} that matches the given {@link com.att.research.xacml.api.IdReferenceMatch}.
*
* @param idReferenceMatch the <code>IdReferenceMatch</code> to search for
- * @return a <code>PolicyFinderResult</code> with the <code>Policy</code> matching the given <code>IdReferenceMatch</code>
+ * @return a <code>PolicyFinderResult</code> with the <code>Policy</code> matching the given
+ * <code>IdReferenceMatch</code>
*/
public PolicyFinderResult<Policy> getPolicy(IdReferenceMatch idReferenceMatch);
@@ -61,7 +62,8 @@ public interface PolicyFinder {
* Gets the {@link PolicySet} that matches the given {@link com.att.research.xacml.api.IdReferenceMatch}.
*
* @param idReferenceMatch the <code>IdReferenceMatch</code> to search for
- * @return a <code>PolicyFinderResult</code> with the <code>PolicySet</code> matching the given <code>IdReferenceMatch</code>.
+ * @return a <code>PolicyFinderResult</code> with the <code>PolicySet</code> matching the given
+ * <code>IdReferenceMatch</code>.
*/
public PolicyFinderResult<PolicySet> getPolicySet(IdReferenceMatch idReferenceMatch);
http://git-wip-us.apache.org/repos/asf/incubator-openaz/blob/38b6d318/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderFactory.java
----------------------------------------------------------------------
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderFactory.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderFactory.java
index dc3810c..f12b82d 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderFactory.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderFactory.java
@@ -37,13 +37,12 @@ import com.att.research.xacml.util.FactoryFinder;
import com.att.research.xacmlatt.pdp.util.ATTPDPProperties;
/**
- * PolicyFinderFactory provides methods for loading XACML 3.0 policies and policy sets that are used
- * by the {@link com.att.research.xacmlatt.pdp.PDPEngine} to evaluate requests.
- *
+ * PolicyFinderFactory provides methods for loading XACML 3.0 policies and policy sets that are used by the
+ * {@link com.att.research.xacmlatt.pdp.PDPEngine} to evaluate requests.
*/
public abstract class PolicyFinderFactory {
- private static final String FACTORYID = ATTPDPProperties.PROP_POLICYFINDERFACTORY;
- private static final String DEFAULT_FACTORY_CLASSNAME = "com.att.research.xacmlatt.pdp.std.StdPolicyFinderFactory";
+ private static final String FACTORYID = ATTPDPProperties.PROP_POLICYFINDERFACTORY;
+ private static final String DEFAULT_FACTORY_CLASSNAME = "com.att.research.xacmlatt.pdp.std.StdPolicyFinderFactory";
protected PolicyFinderFactory() {
}
@@ -56,10 +55,12 @@ public abstract class PolicyFinderFactory {
}
public static PolicyFinderFactory newInstance(Properties properties) throws FactoryException {
- return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PolicyFinderFactory.class, properties);
+ return FactoryFinder
+ .find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PolicyFinderFactory.class, properties);
}
- public static PolicyFinderFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
+ public static PolicyFinderFactory newInstance(String className, ClassLoader classLoader)
+ throws FactoryException {
return FactoryFinder.newInstance(className, PolicyFinderFactory.class, classLoader, false);
}