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 |
---|---|
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.
|
public BranchDelegator(IOptionsServer server)
server
- a concrete implementation of a Perforce Helix Serverpublic java.lang.String createBranchSpec(@Nonnull IBranchSpec branchSpec) throws ConnectionException, RequestException, AccessException
IBranchDelegator
createBranchSpec
in interface IBranchDelegator
branchSpec
- 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(java.lang.String name) throws ConnectionException, RequestException, AccessException
IBranchDelegator
getBranchSpec
in interface IBranchDelegator
name
- 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(java.lang.String name, GetBranchSpecOptions opts) throws P4JavaException
IBranchDelegator
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.
getBranchSpec
in interface IBranchDelegator
name
- 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 java.lang.String updateBranchSpec(@Nonnull IBranchSpec branchSpec) throws ConnectionException, RequestException, AccessException
IBranchDelegator
updateBranchSpec
in interface IBranchDelegator
branchSpec
- 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 authorised@Deprecated public java.lang.String deleteBranchSpec(java.lang.String branchSpecName, boolean force) throws ConnectionException, RequestException, AccessException
IBranchDelegator
deleteBranchSpec
in interface IBranchDelegator
branchSpecName
- 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 java.lang.String deleteBranchSpec(java.lang.String branchSpecName, DeleteBranchSpecOptions opts) throws P4JavaException
IBranchDelegator
deleteBranchSpec
in interface IBranchDelegator
branchSpecName
- 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.