Class ProtectsDelegator
- java.lang.Object
-
- com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
-
- com.perforce.p4java.impl.mapbased.server.cmd.ProtectsDelegator
-
- All Implemented Interfaces:
IProtectsDelegator
public class ProtectsDelegator extends BaseDelegator implements IProtectsDelegator
Implementation to handle the Protects command.
-
-
Field Summary
-
Fields inherited from class com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
MAX_LIMIT_SUPPORTED_MIN_VERSION, QUERY_EXPRESSIONS_SUPPORTED_MIN_VERSION, USER_RESTRICTIONS_SUPPORTED_MIN_VERSION
-
-
Constructor Summary
Constructors Constructor Description ProtectsDelegator(IOptionsServer server)
Instantiate a new ProtectsDelegator, providing the server object that will be used to execute Perforce Helix attribute commands.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<IProtectionEntry>
getProtectionEntries(boolean allUsers, java.lang.String hostName, java.lang.String userName, java.lang.String groupName, java.util.List<IFileSpec> fileList)
Get a list of Perforce protection entries for the passed-in arguments.java.util.List<IProtectionEntry>
getProtectionEntries(java.util.List<IFileSpec> fileList, GetProtectionEntriesOptions opts)
Get a list of Perforce protection entries for the passed-in arguments.
-
-
-
Constructor Detail
-
ProtectsDelegator
public ProtectsDelegator(IOptionsServer server)
Instantiate a new ProtectsDelegator, providing the server object that will be used to execute Perforce Helix attribute commands.- Parameters:
server
- a concrete implementation of a Perforce Helix Server
-
-
Method Detail
-
getProtectionEntries
public java.util.List<IProtectionEntry> getProtectionEntries(boolean allUsers, java.lang.String hostName, java.lang.String userName, java.lang.String groupName, java.util.List<IFileSpec> fileList) throws ConnectionException, RequestException, AccessException
Description copied from interface:IProtectsDelegator
Get a list of Perforce protection entries for the passed-in arguments.Note that the behavior of this method is unspecified when using clashing options (e.g. having both userName and groupName set non-null). Consult the main Perforce admin documentation for semantics and usage.
Note that the annotations in the file paths will be dropped. The reason is the Perforce server 'protects' command requires a file list devoid of annotated revision specificity.
- Specified by:
getProtectionEntries
in interfaceIProtectsDelegator
- Parameters:
allUsers
- if true, protection lines for all users are displayed.hostName
- only protection entries that apply to the given host (IP address) are displayed.userName
- protection lines Perforce user "userName" are displayed.groupName
- protection lines for Perforce group "groupName" are displayed.fileList
- if non-null, only those protection entries that apply to the specified files are displayed.- Returns:
- non-null but possibly empty list of protection entries.
- Throws:
ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its processing of the request.AccessException
- if the Perforce server denies access to the caller.
-
getProtectionEntries
public java.util.List<IProtectionEntry> getProtectionEntries(java.util.List<IFileSpec> fileList, GetProtectionEntriesOptions opts) throws P4JavaException
Description copied from interface:IProtectsDelegator
Get a list of Perforce protection entries for the passed-in arguments.Note that the behavior of this method is unspecified when using clashing options (e.g. having both userName and groupName set non-null). Consult the main Perforce admin documentation for semantics and usage.
Note that any annotations in the file paths will be ignored. The reason is the Perforce server 'protects' command requires a file list devoid of annotated revision specificity.
- Specified by:
getProtectionEntries
in interfaceIProtectsDelegator
- Parameters:
fileList
- if non-null, only those protection entries that apply to the specified files are displayed.opts
- GetProtectionEntriesOptions object describing optional parameters; if null, no options are set.- Returns:
- non-null but possibly empty list of protection entries.
- Throws:
P4JavaException
- if any error occurs in the processing of this method.
-
-