Class BranchDelegator
- java.lang.Object
-
- com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
-
- com.perforce.p4java.impl.mapbased.server.cmd.BranchDelegator
-
- All Implemented Interfaces:
IBranchDelegator
public class BranchDelegator extends BaseDelegator implements IBranchDelegator
- Since:
- 21/09/2016
-
-
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 BranchDelegator(IOptionsServer server)
Instantiate a new BranchDelegator, providing the server object that will be used to execute Perforce Helix attribute commands.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
createBranchSpec(IBranchSpec branchSpec)
TODO: This should be moved up to Server and changed to delegate to createBranchSpec with an options class.java.lang.String
deleteBranchSpec(java.lang.String branchSpecName, boolean force)
Deprecated.java.lang.String
deleteBranchSpec(java.lang.String branchSpecName, DeleteBranchSpecOptions opts)
Delete a named Perforce branch spec from the Perforce server.IBranchSpec
getBranchSpec(java.lang.String name)
Get the branch spec for the given name.IBranchSpec
getBranchSpec(java.lang.String name, GetBranchSpecOptions opts)
Get a specific named Perforce branch spec from the Perforce server.java.lang.String
updateBranchSpec(IBranchSpec branchSpec)
Update the data fields in an existing branch spec.
-
-
-
Constructor Detail
-
BranchDelegator
public BranchDelegator(IOptionsServer server)
Instantiate a new BranchDelegator, 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
-
createBranchSpec
public java.lang.String createBranchSpec(@Nonnull IBranchSpec branchSpec) throws ConnectionException, RequestException, AccessException
Description copied from interface:IBranchDelegator
TODO: This should be moved up to Server and changed to delegate to createBranchSpec with an options class. This would also allow for a force option.- Specified by:
createBranchSpec
in interfaceIBranchDelegator
- Parameters:
branchSpec
- the spec object containing the branch data fields.- Returns:
- The name of the newly create branch spec
- Throws:
ConnectionException
- when there is an error talking to the Helix serverRequestException
- when there is a problem with the data provided in the requestAccessException
- when access to the branch command is not authorised
-
getBranchSpec
public IBranchSpec getBranchSpec(java.lang.String name) throws ConnectionException, RequestException, AccessException
Description copied from interface:IBranchDelegator
Get the branch spec for the given name.- Specified by:
getBranchSpec
in interfaceIBranchDelegator
- Parameters:
name
- the name of the branch- Returns:
- a populated branch spec object
- Throws:
ConnectionException
- when there is an error talking to the Helix serverRequestException
- when there is a problem with the data provided in the requestAccessException
- when access to the branch command is not authorised
-
getBranchSpec
public IBranchSpec getBranchSpec(java.lang.String name, GetBranchSpecOptions opts) throws P4JavaException
Description copied from interface:IBranchDelegator
Get a specific named Perforce branch spec from the Perforce server.Note that since the Perforce server usually interprets asking for a non-existent branch spec as equivalent to asking for a template for a new branch spec, you will normally always get back a result here. It is best to first use the getBranchSpecList method to see if the branch spec exists, then use this method to retrieve a specific branch spec once you know it exists.
- Specified by:
getBranchSpec
in interfaceIBranchDelegator
- Parameters:
name
- non-null Perforce branch name.opts
- GetBranchSpecOptions object describing optional parameters; if null, no options are set.- Returns:
- potentially-null IBranchSpec for the named Perforce branch spec.
- Throws:
P4JavaException
- if any error occurs in the processing of this method.
-
updateBranchSpec
public java.lang.String updateBranchSpec(@Nonnull IBranchSpec branchSpec) throws ConnectionException, RequestException, AccessException
Description copied from interface:IBranchDelegator
Update the data fields in an existing branch spec.- Specified by:
updateBranchSpec
in interfaceIBranchDelegator
- Parameters:
branchSpec
- the branch data- Returns:
- the name of the updated spec
- Throws:
ConnectionException
- when there is an error talking to the Helix serverRequestException
- when there is a problem with the data provided in the requestAccessException
- when access to the branch command is not authorised
-
deleteBranchSpec
@Deprecated public java.lang.String deleteBranchSpec(java.lang.String branchSpecName, boolean force) throws ConnectionException, RequestException, AccessException
Deprecated.Description copied from interface:IBranchDelegator
Delete a branch spec specifing whether it should be a forced operation.- Specified by:
deleteBranchSpec
in interfaceIBranchDelegator
- Parameters:
branchSpecName
- the name of the spec to deleteforce
- whether to force the operation through- Returns:
- name of the deleted spec
- Throws:
ConnectionException
- when there is an error talking to the Helix serverRequestException
- when there is a problem with the data provided in the requestAccessException
- when access to the branch command is not authorised
-
deleteBranchSpec
public java.lang.String deleteBranchSpec(java.lang.String branchSpecName, DeleteBranchSpecOptions opts) throws P4JavaException
Description copied from interface:IBranchDelegator
Delete a named Perforce branch spec from the Perforce server.- Specified by:
deleteBranchSpec
in interfaceIBranchDelegator
- Parameters:
branchSpecName
- non-null name of the branch spec to be deleted.opts
- DeleteBranchSpecOptions object describing optional parameters; if null, no options are set.- Returns:
- non-null result message string from the Perforce server; this may include form trigger output pre-pended and / or appended to the "normal" message
- Throws:
P4JavaException
- if any error occurs in the processing of this method.
-
-