Class 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
    • 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.MissingAttributeDetail missingAttributeDetail, Optional<String> code, Optional<String> message)
      Constructor for missing (named) attribute error status.
      ImmutableXacmlStatus​(oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusCode statusCode, String statusMessage)
      Constructor similar to Status(StatusCode, String, oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusDetail) without StatusDetail (not supported)
    • 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

      • 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
      • DEFAULT_MISSING_ATTRIBUTE_STATUS_MESSAGE

        public static final String DEFAULT_MISSING_ATTRIBUTE_STATUS_MESSAGE
        Default StatusMessage for missing-attribute errors. Cf. ยง5.57 of XACML 3.0.
        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 - 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
        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:anyURI
        message - status message
      • ImmutableXacmlStatus

        public ImmutableXacmlStatus​(oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusCode statusCode,
                                    String statusMessage)
        Constructor similar to Status(StatusCode, String, oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusDetail) without StatusDetail (not supported)
        Parameters:
        statusCode - code
        statusMessage - message
      • ImmutableXacmlStatus

        public ImmutableXacmlStatus​(oasis.names.tc.xacml._3_0.core.schema.wd_17.MissingAttributeDetail missingAttributeDetail,
                                    Optional<String> code,
                                    Optional<String> message)
        Constructor for missing (named) attribute error status.
        Parameters:
        missingAttributeDetail - the missing attribute detail
        code - optional custom status code, else the default is used: XacmlStatusCode.MISSING_ATTRIBUTE; must be a valid xs:anyURI (used as XACML StatusCode Value)
        message - optional status message, else the default is used: DEFAULT_MISSING_ATTRIBUTE_STATUS_MESSAGE;