com.perforce.p4java.impl.generic.admin
Class ProtectionEntry

java.lang.Object
  extended by com.perforce.p4java.impl.generic.core.MapEntry
      extended by 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
elementPattern, elementPatternStr, left, order, right, type
 
Fields inherited from interface com.perforce.p4java.core.IMapEntry
EXCLUDE_PREFIX, ORDER_UNKNOWN, OVERLAY_PREFIX
 
Constructor Summary
ProtectionEntry()
          Default constructor -- sets all fields to null, zero, or false.
ProtectionEntry(int order, String mode, boolean group, String host, String name, String path, boolean pathExcluded)
          Explicit-value constructor.
ProtectionEntry(Map<String,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
 String getHost()
          Gets the client host.
 String getMode()
          Gets the protection mode for this entry.
 String getName()
          Gets the name of the grantee (user or group).
 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(String host)
          Sets the client host.
 void setMode(String mode)
          Sets the protection mode for this entry.
 void setName(String name)
          Sets the name of the grantee (user or group).
 void setPath(String path)
          Sets the depot path.
 void setPathExcluded(boolean pathExcluded)
          Sets the path excluded indicator (true/false).
 String toString()
          Returns string representation of the protection entry.
 
Methods inherited from class com.perforce.p4java.impl.generic.core.MapEntry
getLeft, getLeft, getOrder, getRight, getRight, getType, parseViewMappingString, quoteWhitespaceString, setLeft, setOrder, setRight, setType, 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
getLeft, getLeft, getOrder, getRight, getRight, getType, 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,
                       String mode,
                       boolean group,
                       String host,
                       String name,
                       String path,
                       boolean pathExcluded)
Explicit-value constructor.


ProtectionEntry

public ProtectionEntry(Map<String,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.

Method Detail

getHost

public String getHost()
Description copied from interface: IProtectionEntry
Gets the client host.

Specified by:
getHost in interface IProtectionEntry
Returns:
the client host
See Also:
IProtectionEntry.getHost()

getMode

public String getMode()
Description copied from interface: IProtectionEntry
Gets the protection mode for this entry.

Specified by:
getMode in interface IProtectionEntry
Returns:
the protection mode
See Also:
IProtectionEntry.getMode()

getName

public 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
See Also:
IProtectionEntry.getName()

getPath

public String getPath()
Description copied from interface: IProtectionEntry
Gets the depot path.

Specified by:
getPath in interface IProtectionEntry
Returns:
the depot path
See Also:
IProtectionEntry.getPath()

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.
See Also:
IProtectionEntry.isGroup()

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).
See Also:
IProtectionEntry.setGroup(boolean)

setHost

public void setHost(String host)
Description copied from interface: IProtectionEntry
Sets the client host.

Specified by:
setHost in interface IProtectionEntry
Parameters:
host - the client host
See Also:
IProtectionEntry.setHost(java.lang.String)

setMode

public void setMode(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
See Also:
IProtectionEntry.setMode(java.lang.String)

setName

public void setName(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
See Also:
IProtectionEntry.setName(java.lang.String)

setPath

public void setPath(String path)
Description copied from interface: IProtectionEntry
Sets the depot path.

Specified by:
setPath in interface IProtectionEntry
Parameters:
path - the depot path
See Also:
IProtectionEntry.setPath(java.lang.String)

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
See Also:
IProtectionEntry.isPathExcluded()

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)
See Also:
IProtectionEntry.setPathExcluded(boolean)

toString

public 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()


Copyright © 2015 Perforce Software. All Rights Reserved.