Class ACE

  • All Implemented Interfaces:
    javax.jcr.security.AccessControlEntry, JackrabbitAccessControlEntry

    @ProviderType
    public abstract class ACE
    extends java.lang.Object
    implements JackrabbitAccessControlEntry
    Default implementation of the JackrabbitAccessControlEntry interface. It asserts that the basic contract is fulfilled but does perform any additional validation on the principal, the privileges or the specified restrictions.
    • Constructor Summary

      Constructors 
      Constructor Description
      ACE​(@Nullable java.security.Principal principal, @Nullable PrivilegeBits privilegeBits, boolean isAllow, @Nullable java.util.Set<Restriction> restrictions, @NotNull NamePathMapper namePathMapper)
      Creates a new access control entry.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      @NotNull java.security.Principal getPrincipal()  
      @NotNull PrivilegeBits getPrivilegeBits()  
      @NotNull PrivilegeCollection getPrivilegeCollection()
      Returns a PrivilegeCollection representing the privileges associated with this entry.
      @Nullable javax.jcr.Value getRestriction​(@NotNull java.lang.String restrictionName)
      Return the value of the restriction with the specified name or null if no such restriction exists.
      @NotNull java.lang.String[] getRestrictionNames()
      Return the names of the restrictions present with this access control entry.
      @NotNull java.util.Set<Restriction> getRestrictions()  
      @Nullable javax.jcr.Value[] getRestrictions​(@NotNull java.lang.String restrictionName)
      Return the values of the restriction with the specified name or null if no such restriction exists.
      int hashCode()  
      boolean isAllow()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.jcr.security.AccessControlEntry

        getPrivileges
    • Constructor Detail

      • ACE

        public ACE​(@Nullable
                   @Nullable java.security.Principal principal,
                   @Nullable
                   @Nullable PrivilegeBits privilegeBits,
                   boolean isAllow,
                   @Nullable
                   @Nullable java.util.Set<Restriction> restrictions,
                   @NotNull
                   @NotNull NamePathMapper namePathMapper)
            throws javax.jcr.security.AccessControlException
        Creates a new access control entry.
        Parameters:
        principal - The principal associated with this entry.
        privilegeBits - The privilege bits defined for this entry.
        isAllow - true if the entry is granting privileges.
        restrictions - A optional set of restrictions.
        namePathMapper - The name-path mapper
        Throws:
        javax.jcr.security.AccessControlException - If the given principal or privilegeBits are null or if privilegeBits are empty.
    • Method Detail

      • getPrivilegeBits

        @NotNull
        public @NotNull PrivilegeBits getPrivilegeBits()
      • getRestrictions

        @NotNull
        public @NotNull java.util.Set<Restriction> getRestrictions()
      • getPrincipal

        @NotNull
        public @NotNull java.security.Principal getPrincipal()
        Specified by:
        getPrincipal in interface javax.jcr.security.AccessControlEntry
      • isAllow

        public boolean isAllow()
        Specified by:
        isAllow in interface JackrabbitAccessControlEntry
        Returns:
        true if this entry adds Privileges for the principal; false otherwise.
      • getRestriction

        @Nullable
        public @Nullable javax.jcr.Value getRestriction​(@NotNull
                                                        @NotNull java.lang.String restrictionName)
                                                 throws javax.jcr.RepositoryException
        Description copied from interface: JackrabbitAccessControlEntry
        Return the value of the restriction with the specified name or null if no such restriction exists. In case the restriction with the specified name contains multiple value this method will call ValueFormatException.
        Specified by:
        getRestriction in interface JackrabbitAccessControlEntry
        Parameters:
        restrictionName - The of the restriction as obtained through JackrabbitAccessControlEntry.getRestrictionNames().
        Returns:
        value of the restriction with the specified name or null if no such restriction exists.
        Throws:
        javax.jcr.ValueFormatException - If the restriction with the specified name contains multiple values.
        javax.jcr.RepositoryException - if an error occurs.
        See Also:
        JackrabbitAccessControlEntry.getRestrictions(String)
      • getRestrictions

        @Nullable
        public @Nullable javax.jcr.Value[] getRestrictions​(@NotNull
                                                           @NotNull java.lang.String restrictionName)
        Description copied from interface: JackrabbitAccessControlEntry
        Return the values of the restriction with the specified name or null if no such restriction exists. For restrictions that contain just a single value this method is expected to return an array with a single element even if the underlying implementation stored the restriction in single-value JCR property.
        Specified by:
        getRestrictions in interface JackrabbitAccessControlEntry
        Parameters:
        restrictionName - The of the restriction as obtained through JackrabbitAccessControlEntry.getRestrictionNames().
        Returns:
        the values of the restriction with the specified name as an array or null if no such restriction exists. The array may contain zero, one or multiple values.
        See Also:
        JackrabbitAccessControlEntry.getRestriction(String)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object