Class ProtectionEntry

  • All Implemented Interfaces:
    IProtectionEntry, IMapEntry

    public class ProtectionEntry
    extends MapEntry
    implements IProtectionEntry
    Default IProtectionEntry implementation class.

    Note that the order of this protection entry in the protections table is part of the protection entry key when pass to the server for updating the protections table.

    When exclusionary mappings are used, order is relevant: the exclusionary mapping overrides any matching protections listed above it in the table. No matter what access level is being denied in the exclusionary protection, all the access levels for the matching users, files, and IP addresses are denied.

     Protections0: super user p4java * //depot/...
     Protections1: write group p4users * //depot/project1/...
     Protections2: write group p4users * -//depot/project1/build/...
     Protections3: read user p4jtestuser * //depot/...
     Protections4: read user p4jtestuser * -//depot/topsecret/...
     
    • Constructor Detail

      • ProtectionEntry

        public ProtectionEntry()
        Default constructor -- sets all fields to null, zero, or false.
      • ProtectionEntry

        public ProtectionEntry​(int order,
                               java.lang.String mode,
                               boolean group,
                               java.lang.String host,
                               java.lang.String name,
                               java.lang.String path,
                               boolean pathExcluded)
        Explicit-value constructor.
        Parameters:
        order - order
        mode - mode
        group - group
        host - host
        name - name
        path - path
        pathExcluded - pathExcluded
      • ProtectionEntry

        public ProtectionEntry​(java.util.Map<java.lang.String,​java.lang.Object> map,
                               int order)
        Constructs a ProtectionEntry from the passed-in map; this map must have come from a Perforce IServer method call or it may fail. If map is null, equivalent to calling the default constructor.
        Parameters:
        map - map
        order - order
    • Method Detail

      • getHost

        public java.lang.String getHost()
        Description copied from interface: IProtectionEntry
        Gets the client host.
        Specified by:
        getHost in interface IProtectionEntry
        Returns:
        the client host
      • getMode

        public java.lang.String getMode()
        Description copied from interface: IProtectionEntry
        Gets the protection mode for this entry.
        Specified by:
        getMode in interface IProtectionEntry
        Returns:
        the protection mode
      • getName

        public java.lang.String getName()
        Description copied from interface: IProtectionEntry
        Gets the name of the grantee (user or group).
        Specified by:
        getName in interface IProtectionEntry
        Returns:
        the name of the grantee
      • getPath

        public java.lang.String getPath()
        Description copied from interface: IProtectionEntry
        Gets the depot path.
        Specified by:
        getPath in interface IProtectionEntry
        Returns:
        the depot path
      • isGroup

        public boolean isGroup()
        Description copied from interface: IProtectionEntry
        Checks if the grantee is a group.
        Specified by:
        isGroup in interface IProtectionEntry
        Returns:
        true, if the grantee is a group.
      • setGroup

        public void setGroup​(boolean group)
        Description copied from interface: IProtectionEntry
        Sets the group indicator (true/false).
        Specified by:
        setGroup in interface IProtectionEntry
        Parameters:
        group - the group indicator (true/false).
      • setHost

        public void setHost​(java.lang.String host)
        Description copied from interface: IProtectionEntry
        Sets the client host.
        Specified by:
        setHost in interface IProtectionEntry
        Parameters:
        host - the client host
      • setMode

        public void setMode​(java.lang.String mode)
        Description copied from interface: IProtectionEntry
        Sets the protection mode for this entry.
        Specified by:
        setMode in interface IProtectionEntry
        Parameters:
        mode - the protection mode
      • setName

        public void setName​(java.lang.String name)
        Description copied from interface: IProtectionEntry
        Sets the name of the grantee (user or group).
        Specified by:
        setName in interface IProtectionEntry
        Parameters:
        name - the name of the grantee
      • setPath

        public void setPath​(java.lang.String path)
        Description copied from interface: IProtectionEntry
        Sets the depot path.
        Specified by:
        setPath in interface IProtectionEntry
        Parameters:
        path - the depot path
      • isPathExcluded

        public boolean isPathExcluded()
        Description copied from interface: IProtectionEntry
        Checks if the path is excluded.
        Specified by:
        isPathExcluded in interface IProtectionEntry
        Returns:
        true, if the path is excluded
      • setPathExcluded

        public void setPathExcluded​(boolean pathExcluded)
        Description copied from interface: IProtectionEntry
        Sets the path excluded indicator (true/false).
        Specified by:
        setPathExcluded in interface IProtectionEntry
        Parameters:
        pathExcluded - the path excluded indicator (true/false)
      • toString

        public java.lang.String toString()
        Returns string representation of the protection entry.
        Specified by:
        toString in interface IMapEntry
        Overrides:
        toString in class MapEntry
        Returns:
        the string representation of the protection entry
        See Also:
        Object.toString()