[8780cbec] | 1 | package com.nailabs.abac.access; |
---|
| 2 | |
---|
| 3 | import edu.stanford.peer.rbtm.credential.*; |
---|
| 4 | |
---|
| 5 | public class AckFact { |
---|
| 6 | |
---|
| 7 | /** |
---|
| 8 | * This attribute defines the scope of the AckFact instance. |
---|
| 9 | */ |
---|
| 10 | protected RoleName attribute; |
---|
| 11 | |
---|
| 12 | /** |
---|
| 13 | * Optional string meta-identifier for the value field. |
---|
| 14 | */ |
---|
| 15 | protected String field; |
---|
| 16 | |
---|
| 17 | /** |
---|
| 18 | * Optional value corresponding to the named field. |
---|
| 19 | */ |
---|
| 20 | protected Object value; |
---|
| 21 | |
---|
| 22 | /** |
---|
| 23 | * The credential role required to match with the requesting subject. |
---|
| 24 | */ |
---|
| 25 | protected EntityExpression requirement; |
---|
| 26 | |
---|
| 27 | /** |
---|
| 28 | * A constant to represent a default value (aka a wildcard). |
---|
| 29 | */ |
---|
| 30 | static final String DEFAULT = "default"; |
---|
| 31 | |
---|
| 32 | /** |
---|
| 33 | * A true constant for denoting that no requirements are necessary. |
---|
| 34 | * This can also be implicitly represented as a null requirement. |
---|
| 35 | */ |
---|
| 36 | static final String TRUE = "true"; |
---|
| 37 | |
---|
| 38 | /** |
---|
| 39 | * Basic constructor method. This method subtitutes a default key-value |
---|
| 40 | * pair. |
---|
| 41 | */ |
---|
| 42 | public AckFact(RoleName attribute, EntityExpression req) { |
---|
| 43 | this(attribute, DEFAULT, DEFAULT, req); |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | /** |
---|
| 47 | * Explicit constructor method. This represents a fully expanded policy |
---|
| 48 | * fact. |
---|
| 49 | */ |
---|
| 50 | public AckFact(RoleName attr,String key,Object val,EntityExpression req) { |
---|
| 51 | attribute = attr; |
---|
| 52 | field = key; |
---|
| 53 | value = val; |
---|
| 54 | requirement = req; |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | /** |
---|
| 58 | * An accessor method for the attribute which needs to be unlocked. |
---|
| 59 | * <B> This is private policy information and should not be xmitted </B> |
---|
| 60 | */ |
---|
| 61 | public RoleName getAttribute() { return attribute; } |
---|
| 62 | |
---|
| 63 | /** |
---|
| 64 | * An accessor method for the optional special case meta-type. |
---|
| 65 | * <B> This is private policy information and should not be xmitted </B> |
---|
| 66 | */ |
---|
| 67 | public String getField() { return field; } |
---|
| 68 | |
---|
| 69 | /** |
---|
| 70 | * An accessor method for the optional special case value. |
---|
| 71 | * <B> This is private policy information and should not be xmitted </B> |
---|
| 72 | */ |
---|
| 73 | public Object getValue() { return value; } |
---|
| 74 | |
---|
| 75 | /** |
---|
| 76 | * An accessor method for an expression which can unlocked the attribute |
---|
| 77 | * if the expression is proved to be true. |
---|
| 78 | * <B> This is public policy information but if transmitted may indicate |
---|
| 79 | * that particular credential is possessed.</B> |
---|
| 80 | */ |
---|
| 81 | public EntityExpression getRequirement() { return requirement; } |
---|
| 82 | } |
---|