public class BranchDelegator extends BaseDelegator implements IBranchDelegator
MAX_LIMIT_SUPPORTED_MIN_VERSION, QUERY_EXPRESSIONS_SUPPORTED_MIN_VERSION, USER_RESTRICTIONS_SUPPORTED_MIN_VERSION| Constructor and Description |
|---|
BranchDelegator(IOptionsServer server)
Instantiate a new BranchDelegator, providing the server object that will be used to
execute Perforce Helix attribute commands.
|
| Modifier and Type | Method and Description |
|---|---|
String |
createBranchSpec(IBranchSpec branchSpec)
TODO: This should be moved up to Server and changed to delegate to
createBranchSpec with an options class.
|
String |
deleteBranchSpec(String branchSpecName,
boolean force)
Delete a branch spec specifing whether it should be a forced operation.
|
String |
deleteBranchSpec(String branchSpecName,
DeleteBranchSpecOptions opts)
Delete a named Perforce branch spec from the Perforce server.
|
IBranchSpec |
getBranchSpec(String name)
Get the branch spec for the given name.
|
IBranchSpec |
getBranchSpec(String name,
GetBranchSpecOptions opts)
Get a specific named Perforce branch spec from the Perforce server.
|
String |
updateBranchSpec(IBranchSpec branchSpec)
Update the data fields in an existing branch spec.
|
public BranchDelegator(IOptionsServer server)
server - a concrete implementation of a Perforce Helix Serverpublic String createBranchSpec(@Nonnull IBranchSpec branchSpec) throws ConnectionException, RequestException, AccessException
IBranchDelegatorcreateBranchSpec in interface IBranchDelegatorbranchSpec - the spec object containing the branch data fields.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 authorisedpublic IBranchSpec getBranchSpec(String name) throws ConnectionException, RequestException, AccessException
IBranchDelegatorgetBranchSpec in interface IBranchDelegatorname - the name of the branchConnectionException - 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 authorisedpublic IBranchSpec getBranchSpec(String name, GetBranchSpecOptions opts) throws P4JavaException
IBranchDelegatorNote 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.
getBranchSpec in interface IBranchDelegatorname - non-null Perforce branch name.opts - GetBranchSpecOptions object describing optional parameters; if
null, no options are set.P4JavaException - if any error occurs in the processing of this method.public String updateBranchSpec(@Nonnull IBranchSpec branchSpec) throws ConnectionException, RequestException, AccessException
IBranchDelegatorupdateBranchSpec in interface IBranchDelegatorbranchSpec - the branch dataConnectionException - 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 authorisedpublic String deleteBranchSpec(String branchSpecName, boolean force) throws ConnectionException, RequestException, AccessException
IBranchDelegatordeleteBranchSpec in interface IBranchDelegatorbranchSpecName - the name of the spec to deleteforce - whether to force the operation throughConnectionException - 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 authorisedpublic String deleteBranchSpec(String branchSpecName, DeleteBranchSpecOptions opts) throws P4JavaException
IBranchDelegatordeleteBranchSpec in interface IBranchDelegatorbranchSpecName - non-null name of the branch spec to be deleted.opts - DeleteBranchSpecOptions object describing optional parameters;
if null, no options are set.P4JavaException - if any error occurs in the processing of this method.Copyright © 2017 Perforce Software. All Rights Reserved.