Record Class AclEntry

java.lang.Object
java.lang.Record
com.norconex.committer.core.acl.AclEntry
Record Components:
kind - what the principal is
dir - the directory the id belongs to, as <system>:<name> (for example ad:CORP, entra:<tenant id>, google:acme.com, unix:<host>, source:<kind> for groups that exist only inside the source); null for AclKind.SPECIAL principals
id - the principal's identifier in that directory: the most stable one the source gives (an object id or a SID rather than a name, when it gives both)
name - a readable name, when the source gives one besides the id; may be null
access - allowed or denied; null for an owner

public record AclEntry(@NonNull AclKind kind, String dir, @NonNull String id, String name, AclAccess access) extends Record
One principal of an Acl, and whether it is allowed or denied reading. As an owner (see Acl.owners()), access is null.
  • Field Details

  • Constructor Details

    • AclEntry

      public AclEntry(@NonNull @NonNull AclKind kind, String dir, @NonNull @NonNull String id, String name, AclAccess access)
      Creates an instance of a AclEntry record class.
      Parameters:
      kind - the value for the kind record component
      dir - the value for the dir record component
      id - the value for the id record component
      name - the value for the name record component
      access - the value for the access record component
  • Method Details

    • allow

      public static AclEntry allow(AclKind kind, String dir, String id)
      An allowed principal.
      Parameters:
      kind - what the principal is
      dir - the directory it belongs to
      id - its id in that directory
      Returns:
      the entry
    • deny

      public static AclEntry deny(AclKind kind, String dir, String id)
      A denied principal.
      Parameters:
      kind - what the principal is
      dir - the directory it belongs to
      id - its id in that directory
      Returns:
      the entry
    • allowSpecial

      public static AclEntry allowSpecial(String id)
      An allowed principal with a reserved meaning.
      Parameters:
      id - one of the SPECIAL_* constants
      Returns:
      the entry
    • owner

      public static AclEntry owner(AclKind kind, String dir, String id)
      An owner.
      Parameters:
      kind - what the principal is
      dir - the directory it belongs to
      id - its id in that directory
      Returns:
      the entry
    • withName

      public AclEntry withName(String name)
      Parameters:
      name - a readable name
      Returns:
      a copy of this entry with the given readable name
    • principalText

      public String principalText()
      This principal as one text value, the way flat fields carry it: kind:dir:id, or special:id.
      Returns:
      the principal as text
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • kind

      @NonNull public @NonNull AclKind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • dir

      public String dir()
      Returns the value of the dir record component.
      Returns:
      the value of the dir record component
    • id

      @NonNull public @NonNull String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • access

      public AclAccess access()
      Returns the value of the access record component.
      Returns:
      the value of the access record component