Class AccessCheckResponse

    • Constructor Detail

      • AccessCheckResponse

        public AccessCheckResponse()
        Basic constructor used by actual users of this class
      • AccessCheckResponse

        public AccessCheckResponse​(boolean allowed,
                                   List<StampedMessage> messages,
                                   long timestamp)
        Jackson-specific constructor.

        Don’t use this one unless you’re a JSON library.

        Parameters:
        allowed - The value of the allowed flag
        messages - The messages (possibly null) to add to a new empty list
        timestamp - The timestamp from the JSON
    • Method Detail

      • decode

        public static AccessCheckResponse decode​(String input)
                                          throws IOException
        Decodes an AccessCheckResponse from the given String, which should be a JSON formatted value.
        Parameters:
        input - The input JSON
        Returns:
        The decoded AccessCheckResponse
        Throws:
        IOException - if JSON decoding fails
      • decode

        public static AccessCheckResponse decode​(Map<String,​Object> input)
        Decodes an AccessCheckResponse from the given Map, which may have been generated using this class’s Mappable.toMap().

        The Map may contain a long ‘timestamp’, a set of ‘messages’, and an ‘allowed’ boolean.

        Parameters:
        input - The Map input
        Returns:
        The decoded AccessCheckResponse
      • accept

        public void accept​(Boolean status)
        A functional interface used to deny access to this thing, if your code happens to be called from a strange context.
        Specified by:
        accept in interface Consumer<Boolean>
        Parameters:
        status - True if access is allowed, false otherwise
      • accept

        public void accept​(Boolean status,
                           String message)
        A functional interface used to deny access to this thing, with a message
        Specified by:
        accept in interface BiConsumer<Boolean,​String>
        Parameters:
        status - True if access is allowed, false otherwise
        message - A ‘deny’ message to be used in the deny case
      • addMessage

        public void addMessage​(String message)
        Adds a message to the collection
        Parameters:
        message - The message to add
      • addMessage

        public void addMessage​(sailpoint.tools.Message message)
        Adds a message to the collection
        Specified by:
        addMessage in interface sailpoint.api.MessageAccumulator
        Parameters:
        message - The message to add
      • deny

        public void deny()
        Denies access to the thing, setting the allowed flag to false
      • denyMessage

        public void denyMessage​(String reason)
        Denies access to the thing, additionally logging a message indicating the denial reason
        Parameters:
        reason - the denial reason
      • getTimestamp

        public long getTimestamp()
        Gets the timestamp
        Returns:
        The timestamp
      • isAllowed

        public boolean isAllowed()
        Returns true if the access was allowed
        Returns:
        True if access was allowed
      • merge

        public void merge​(AccessCheckResponse other)
        Merges this response with another response.

        If either response indicates that access is not allowed, then it will be set to false in this object. Also, messages will be merged.

        Parameters:
        other - The other object to merge