Class 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)
      • Fields inherited from class oasis.names.tc.xacml._3_0.core.schema.wd_17.Status

        statusCode, statusDetail, statusMessage
    • Method Summary

      • Methods inherited from class oasis.names.tc.xacml._3_0.core.schema.wd_17.Status

        append, appendFields, equals, getStatusCode, getStatusDetail, getStatusMessage, hashCode, setStatusCode, setStatusDetail, setStatusMessage, toString
    • 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 - a List 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 code
        message - a message to include with the code, or null if there should be no message
        detail - 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 - a List 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 code
        message - a message to include with the code
      • StatusHelper

        public StatusHelper​(String code,
                            Optional<String> message)
        Constructor that takes only the status code.
        Parameters:
        code - status code, must be a valid xs:anyURI
        message - status message