public abstract class AbstractResult extends Object
ResponseCtx
. This class provides an abstract method to
encode XACML result with the decision effect, as well as an optional status data and obligations
and advices. encode method must be implemented under the concert class.Modifier and Type | Field and Description |
---|---|
protected List<Advice> |
advices
List of advices which may be empty
|
protected int |
decision
the decision effect
|
static int |
DECISION_DENY
The decision to deny the request
|
static int |
DECISION_INDETERMINATE
The decision that a decision about the request cannot be made
|
static int |
DECISION_INDETERMINATE_DENY
The decision that a decision about the request cannot be made
|
static int |
DECISION_INDETERMINATE_DENY_OR_PERMIT
The decision that a decision about the request cannot be made
|
static int |
DECISION_INDETERMINATE_PERMIT
The decision that a decision about the request cannot be made
|
static int |
DECISION_NOT_APPLICABLE
The decision that nothing applied to us
|
static int |
DECISION_PERMIT
The decision to permit the request
|
static String[] |
DECISIONS
string versions of the 4 Decision types used for encoding
|
protected List<ObligationResult> |
obligations
List of obligations which may be empty
|
protected Status |
status
the status data
|
protected int |
version
XACML version
|
Constructor and Description |
---|
AbstractResult(int decision,
Status status,
int version)
Constructs a
AbstractResult object with decision status data, obligations, advices
and evaluation ctx |
AbstractResult(int decision,
Status status,
List<ObligationResult> obligationResults,
List<Advice> advices,
int version)
Constructs a
AbstractResult object with decision status data, obligations, advices
and evaluation ctx |
Modifier and Type | Method and Description |
---|---|
String |
encode()
Encodes this
AbstractResult into its XML form |
abstract void |
encode(StringBuilder builder)
Encodes this
AbstractResult into its XML form and writes this out to the provided
StringBuilder |
List<Advice> |
getAdvices()
Returns the set of advice that the PEP must fulfill, which may be empty.
|
int |
getDecision()
Returns the decision associated with this
Result . |
List<ObligationResult> |
getObligations()
Returns the set of obligations that the PEP must fulfill, which may be empty.
|
Status |
getStatus()
Returns the status data included in this
Result . |
int |
getVersion()
Gets XACML version
|
public static final int DECISION_PERMIT
public static final int DECISION_DENY
public static final int DECISION_INDETERMINATE
public static final int DECISION_NOT_APPLICABLE
public static final int DECISION_INDETERMINATE_DENY
public static final int DECISION_INDETERMINATE_PERMIT
public static final int DECISION_INDETERMINATE_DENY_OR_PERMIT
public static final String[] DECISIONS
protected List<ObligationResult> obligations
protected int decision
protected Status status
protected int version
public AbstractResult(int decision, Status status, int version) throws IllegalArgumentException
AbstractResult
object with decision status data, obligations, advices
and evaluation ctxdecision
- the decision effect to include in this result. This must be one of the four
fields in this class.status
- the Status
to include in this resultversion
- XACML versionIllegalArgumentException
- if decision is not validpublic AbstractResult(int decision, Status status, List<ObligationResult> obligationResults, List<Advice> advices, int version) throws IllegalArgumentException
AbstractResult
object with decision status data, obligations, advices
and evaluation ctxdecision
- the decision effect to include in this result. This must be one of the four
fields in this class.status
- the Status
to include in this resultobligationResults
- a list of ObligationResult
objectsadvices
- a list of Advice
objectsversion
- XACML versionIllegalArgumentException
- if decision is not validpublic List<ObligationResult> getObligations()
Obligation
public List<Advice> getAdvices()
Advice
public int getDecision()
Result
. This will be one of the four
DECISION_*
fields in this class.public Status getStatus()
Result
. Typically this will be
STATUS_OK
except when the decision is INDETERMINATE
.public int getVersion()
public String encode()
AbstractResult
into its XML formString
public abstract void encode(StringBuilder builder)
AbstractResult
into its XML form and writes this out to the provided
StringBuilder
builder
- string stream into which the XML-encoded data is writtenCopyright © 2017 WSO2. All rights reserved.