Class AccessControlContext


  • public class AccessControlContext
    extends Object
    This class permits to define the context of access to a resource.
    • Method Detail

      • removeOperationsOf

        public AccessControlContext removeOperationsOf​(AccessControlOperation... operations)
        Removes the operations from the context. This is an explicit method that allows AccessController implementations to adjust the context by adding (forcing) an operation before a treatment and removing it when done.
        Parameters:
        operations - one or several AccessControlOperation instances.
        Returns:
        the context itself.
      • put

        public <T> AccessControlContext put​(String key,
                                            T value)
        Puts into context a value linked to a key.
        Type Parameters:
        T - the type of resource the access control is performed.
        Parameters:
        key - the key.
        value - the value.
        Returns:
        the current instance.
      • get

        public <T> T get​(String key,
                         Class<T> classType)
        Gets from context a value from a key that has been stored into the context instance.
        Type Parameters:
        T - the type of resource the access control is performed.
        Parameters:
        key - the key associated to the searched value.
        classType - the type of expected value.
        Returns:
        the value if any, null if the expected type does not match with the one of the existing value.