package com.nailabs.abac.access;
import edu.stanford.peer.rbtm.credential.*;
public class AckFact {
/**
* This attribute defines the scope of the AckFact instance.
*/
protected RoleName attribute;
/**
* Optional string meta-identifier for the value field.
*/
protected String field;
/**
* Optional value corresponding to the named field.
*/
protected Object value;
/**
* The credential role required to match with the requesting subject.
*/
protected EntityExpression requirement;
/**
* A constant to represent a default value (aka a wildcard).
*/
static final String DEFAULT = "default";
/**
* A true constant for denoting that no requirements are necessary.
* This can also be implicitly represented as a null requirement.
*/
static final String TRUE = "true";
/**
* Basic constructor method. This method subtitutes a default key-value
* pair.
*/
public AckFact(RoleName attribute, EntityExpression req) {
this(attribute, DEFAULT, DEFAULT, req);
}
/**
* Explicit constructor method. This represents a fully expanded policy
* fact.
*/
public AckFact(RoleName attr,String key,Object val,EntityExpression req) {
attribute = attr;
field = key;
value = val;
requirement = req;
}
/**
* An accessor method for the attribute which needs to be unlocked.
* This is private policy information and should not be xmitted
*/
public RoleName getAttribute() { return attribute; }
/**
* An accessor method for the optional special case meta-type.
* This is private policy information and should not be xmitted
*/
public String getField() { return field; }
/**
* An accessor method for the optional special case value.
* This is private policy information and should not be xmitted
*/
public Object getValue() { return value; }
/**
* An accessor method for an expression which can unlocked the attribute
* if the expression is proved to be true.
* This is public policy information but if transmitted may indicate
* that particular credential is possessed.
*/
public EntityExpression getRequirement() { return requirement; }
}