Class ProtectionEntry
- java.lang.Object
-
- com.perforce.p4java.impl.generic.core.MapEntry
-
- com.perforce.p4java.impl.generic.admin.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/...
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.perforce.p4java.core.IMapEntry
IMapEntry.EntryType
-
-
Field Summary
-
Fields inherited from class com.perforce.p4java.impl.generic.core.MapEntry
comment, elementPattern, elementPatternStr, left, order, right, type
-
Fields inherited from interface com.perforce.p4java.core.IMapEntry
ORDER_UNKNOWN
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHost()Gets the client host.java.lang.StringgetMode()Gets the protection mode for this entry.java.lang.StringgetName()Gets the name of the grantee (user or group).java.lang.StringgetPath()Gets the depot path.java.lang.StringgetPermMax()Returns the single word summarybooleanisGroup()Checks if the grantee is a group.booleanisPathExcluded()Checks if the path is excluded.voidsetGroup(boolean group)Sets the group indicator (true/false).voidsetHost(java.lang.String host)Sets the client host.voidsetMode(java.lang.String mode)Sets the protection mode for this entry.voidsetName(java.lang.String name)Sets the name of the grantee (user or group).voidsetPath(java.lang.String path)Sets the depot path.voidsetPathExcluded(boolean pathExcluded)Sets the path excluded indicator (true/false).java.lang.StringtoString()Returns string representation of the protection entry.-
Methods inherited from class com.perforce.p4java.impl.generic.core.MapEntry
getComment, getComment, getLeft, getLeft, getOrder, getRight, getRight, getType, parseComments, parseViewMappingString, quoteWhitespaceString, setComment, setLeft, setOrder, setRight, setType, stripComments, stripTypePrefix, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.perforce.p4java.core.IMapEntry
getComment, getComment, getLeft, getLeft, getOrder, getRight, getRight, getType, setComment, setLeft, setOrder, setRight, setType, toString
-
-
-
-
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- ordermode- modegroup- grouphost- hostname- namepath- pathpathExcluded- 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- maporder- order
-
-
Method Detail
-
getHost
public java.lang.String getHost()
Description copied from interface:IProtectionEntryGets the client host.- Specified by:
getHostin interfaceIProtectionEntry- Returns:
- the client host
-
getMode
public java.lang.String getMode()
Description copied from interface:IProtectionEntryGets the protection mode for this entry.- Specified by:
getModein interfaceIProtectionEntry- Returns:
- the protection mode
-
getName
public java.lang.String getName()
Description copied from interface:IProtectionEntryGets the name of the grantee (user or group).- Specified by:
getNamein interfaceIProtectionEntry- Returns:
- the name of the grantee
-
getPath
public java.lang.String getPath()
Description copied from interface:IProtectionEntryGets the depot path.- Specified by:
getPathin interfaceIProtectionEntry- Returns:
- the depot path
-
isGroup
public boolean isGroup()
Description copied from interface:IProtectionEntryChecks if the grantee is a group.- Specified by:
isGroupin interfaceIProtectionEntry- Returns:
- true, if the grantee is a group.
-
setGroup
public void setGroup(boolean group)
Description copied from interface:IProtectionEntrySets the group indicator (true/false).- Specified by:
setGroupin interfaceIProtectionEntry- Parameters:
group- the group indicator (true/false).
-
setHost
public void setHost(java.lang.String host)
Description copied from interface:IProtectionEntrySets the client host.- Specified by:
setHostin interfaceIProtectionEntry- Parameters:
host- the client host
-
setMode
public void setMode(java.lang.String mode)
Description copied from interface:IProtectionEntrySets the protection mode for this entry.- Specified by:
setModein interfaceIProtectionEntry- Parameters:
mode- the protection mode
-
setName
public void setName(java.lang.String name)
Description copied from interface:IProtectionEntrySets the name of the grantee (user or group).- Specified by:
setNamein interfaceIProtectionEntry- Parameters:
name- the name of the grantee
-
setPath
public void setPath(java.lang.String path)
Description copied from interface:IProtectionEntrySets the depot path.- Specified by:
setPathin interfaceIProtectionEntry- Parameters:
path- the depot path
-
isPathExcluded
public boolean isPathExcluded()
Description copied from interface:IProtectionEntryChecks if the path is excluded.- Specified by:
isPathExcludedin interfaceIProtectionEntry- Returns:
- true, if the path is excluded
-
setPathExcluded
public void setPathExcluded(boolean pathExcluded)
Description copied from interface:IProtectionEntrySets the path excluded indicator (true/false).- Specified by:
setPathExcludedin interfaceIProtectionEntry- Parameters:
pathExcluded- the path excluded indicator (true/false)
-
getPermMax
public java.lang.String getPermMax()
Description copied from interface:IProtectionEntryReturns the single word summary- Specified by:
getPermMaxin interfaceIProtectionEntry- Returns:
- permMax
-
-