public class ProtectionEntry extends MapEntry implements IProtectionEntry
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/...
IMapEntry.EntryType
comment, elementPattern, elementPatternStr, left, order, right, type
ORDER_UNKNOWN
Constructor and Description |
---|
ProtectionEntry()
Default constructor -- sets all fields to null, zero, or false.
|
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.
|
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.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getHost()
Gets the client host.
|
java.lang.String |
getMode()
Gets the protection mode for this entry.
|
java.lang.String |
getName()
Gets the name of the grantee (user or group).
|
java.lang.String |
getPath()
Gets the depot path.
|
boolean |
isGroup()
Checks if the grantee is a group.
|
boolean |
isPathExcluded()
Checks if the path is excluded.
|
void |
setGroup(boolean group)
Sets the group indicator (true/false).
|
void |
setHost(java.lang.String host)
Sets the client host.
|
void |
setMode(java.lang.String mode)
Sets the protection mode for this entry.
|
void |
setName(java.lang.String name)
Sets the name of the grantee (user or group).
|
void |
setPath(java.lang.String path)
Sets the depot path.
|
void |
setPathExcluded(boolean pathExcluded)
Sets the path excluded indicator (true/false).
|
java.lang.String |
toString()
Returns string representation of the protection entry.
|
getComment, getComment, getLeft, getLeft, getOrder, getRight, getRight, getType, parseComments, parseViewMappingString, quoteWhitespaceString, setComment, setLeft, setOrder, setRight, setType, stripComments, stripTypePrefix, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComment, getComment, getLeft, getLeft, getOrder, getRight, getRight, getType, setComment, setLeft, setOrder, setRight, setType, toString
public 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)
order
- ordermode
- modegroup
- grouphost
- hostname
- namepath
- pathpathExcluded
- pathExcludedpublic ProtectionEntry(java.util.Map<java.lang.String,java.lang.Object> map, int order)
map
- maporder
- orderpublic java.lang.String getHost()
IProtectionEntry
getHost
in interface IProtectionEntry
public java.lang.String getMode()
IProtectionEntry
getMode
in interface IProtectionEntry
public java.lang.String getName()
IProtectionEntry
getName
in interface IProtectionEntry
public java.lang.String getPath()
IProtectionEntry
getPath
in interface IProtectionEntry
public boolean isGroup()
IProtectionEntry
isGroup
in interface IProtectionEntry
public void setGroup(boolean group)
IProtectionEntry
setGroup
in interface IProtectionEntry
group
- the group indicator (true/false).public void setHost(java.lang.String host)
IProtectionEntry
setHost
in interface IProtectionEntry
host
- the client hostpublic void setMode(java.lang.String mode)
IProtectionEntry
setMode
in interface IProtectionEntry
mode
- the protection modepublic void setName(java.lang.String name)
IProtectionEntry
setName
in interface IProtectionEntry
name
- the name of the granteepublic void setPath(java.lang.String path)
IProtectionEntry
setPath
in interface IProtectionEntry
path
- the depot pathpublic boolean isPathExcluded()
IProtectionEntry
isPathExcluded
in interface IProtectionEntry
public void setPathExcluded(boolean pathExcluded)
IProtectionEntry
setPathExcluded
in interface IProtectionEntry
pathExcluded
- the path excluded indicator (true/false)