Package org.ow2.authzforce.core.pdp.api
Class StatusHelper
- java.lang.Object
-
- oasis.names.tc.xacml._3_0.core.schema.wd_17.Status
-
- org.ow2.authzforce.core.pdp.api.StatusHelper
-
- All Implemented Interfaces:
Serializable
,org.jvnet.jaxb2_commons.lang.ToString2
public final class StatusHelper extends oasis.names.tc.xacml._3_0.core.schema.wd_17.Status
Simplifies XACML Status handling.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_STATUS_CODE_DEPTH
Max depth of status code.static StatusHelper
OK
STATUS OK (as specified by XACML standard)
-
Constructor Summary
Constructors Constructor Description StatusHelper(String code, Optional<String> message)
Constructor that takes only the status code.StatusHelper(List<String> codes, Optional<String> message)
Constructor that takes both the status code and a message to include with the status.StatusHelper(List<String> codes, Optional<String> message, Optional<oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusDetail> detail)
Constructor that takes the status code, an optional message, and some detail to include with the status.
-
-
-
Field Detail
-
OK
public static final StatusHelper 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
-
StatusHelper
public StatusHelper(List<String> codes, Optional<String> message, Optional<oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusDetail> detail) 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.- 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 messagedetail
- the status detail to include, or null if there is no detail- Throws:
IllegalArgumentException
- if detail is included for a status code that doesn't allow detail
-
StatusHelper
public StatusHelper(List<String> codes, Optional<String> message)
Constructor that takes both the status code and a message to include with the status.- 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
-
-