Package org.ow2.authzforce.core.pdp.api
Class ImmutableXacmlStatus
- java.lang.Object
-
- oasis.names.tc.xacml._3_0.core.schema.wd_17.Status
-
- org.ow2.authzforce.core.pdp.api.ImmutableXacmlStatus
-
- All Implemented Interfaces:
Serializable
,org.jvnet.jaxb2_commons.lang.ToString2
@Immutable public final class ImmutableXacmlStatus extends oasis.names.tc.xacml._3_0.core.schema.wd_17.Status
Immutable XACML Status, simplifies XACML Status handling (not supporting StatusDetails, always set null).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_STATUS_CODE_DEPTH
Max depth of status code.static ImmutableXacmlStatus
OK
STATUS OK (as specified by XACML standard)
-
Constructor Summary
Constructors Constructor Description ImmutableXacmlStatus(String code, Optional<String> message)
Constructor that takes only the status code.ImmutableXacmlStatus(List<String> codes, Optional<String> message)
Constructor that takes the status code, an optional message, and some detail to include with the status.ImmutableXacmlStatus(oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusCode statusCode, String statusMessage)
Constructor similar toStatus(StatusCode, String, oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusDetail)
without StatusDetail (not supported)
-
-
-
Field Detail
-
OK
public static final ImmutableXacmlStatus OK
STATUS OK (as specified by XACML standard)
-
MAX_STATUS_CODE_DEPTH
public static final int MAX_STATUS_CODE_DEPTH
Max depth of status code. StatusCode in XACML schema is a recursive structure like an error stacktrace that allows chaining status codes endlessly unless the implementation enforces a maximum depth as done here.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ImmutableXacmlStatus
public ImmutableXacmlStatus(List<String> codes, Optional<String> message) throws IllegalArgumentException
Constructor that takes the status code, an optional message, and some detail to include with the status. Note that the specification explicitly says that a status code of OK, SyntaxError or ProcessingError may not appear with status detail, so an exception is thrown if one of these status codes is used and detail is included. Note: StatusDetail field not supported. According to XACML 3.0 spec, section 5.57, if the code is ok, syntax error or processing error, there must not be any StatusDetail included.- Parameters:
codes
- aList
of codes of type xs:anyURI, typically just one code, but this may contain any number of minor codes after the first item in the list, which is the major codemessage
- a message to include with the code, or null if there should be no message- Throws:
IllegalArgumentException
- if detail is included for a status code that doesn't allow detail
-
ImmutableXacmlStatus
public ImmutableXacmlStatus(String code, Optional<String> message)
Constructor that takes only the status code.- Parameters:
code
- status code, must be a valid xs:anyURImessage
- status message
-
ImmutableXacmlStatus
public ImmutableXacmlStatus(oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusCode statusCode, String statusMessage)
Constructor similar toStatus(StatusCode, String, oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusDetail)
without StatusDetail (not supported)- Parameters:
statusCode
- codestatusMessage
- message
-
-