public class LabelDelegator extends BaseDelegator implements ILabelDelegator
MAX_LIMIT_SUPPORTED_MIN_VERSION, QUERY_EXPRESSIONS_SUPPORTED_MIN_VERSION, USER_RESTRICTIONS_SUPPORTED_MIN_VERSION
Constructor and Description |
---|
LabelDelegator(IOptionsServer server)
Instantiate a new LabelDelegator, providing the server object that will be used to
execute Perforce Helix attribute commands.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
createLabel(ILabel label)
Create a new Perforce label in the Perforce server.
|
java.lang.String |
deleteLabel(java.lang.String labelName,
boolean force)
Delete a named Perforce label from the Perforce server.
|
java.lang.String |
deleteLabel(java.lang.String labelName,
DeleteLabelOptions opts)
Delete a named Perforce label from the Perforce server.
|
ILabel |
getLabel(java.lang.String labelName)
Get a specific named Perforce label.
|
java.lang.String |
updateLabel(ILabel label)
Update an existing Perforce label in the Perforce server.
|
public LabelDelegator(IOptionsServer server)
server
- a concrete implementation of a Perforce Helix Serverpublic ILabel getLabel(java.lang.String labelName) throws ConnectionException, RequestException, AccessException
ILabelDelegator
Unlike the getLabelList method, the getViewMapping method on the returned label will be valid. Note though that changes to the returned label or its view will not be reflected on to the server unless the updateLabel method is called with the label as an argument.
getLabel
in interface ILabelDelegator
labelName
- non-null label nameConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String createLabel(ILabel label) throws ConnectionException, RequestException, AccessException
ILabelDelegator
createLabel
in interface ILabelDelegator
label
- non-null ILabel to be savedConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String updateLabel(ILabel label) throws ConnectionException, RequestException, AccessException
ILabelDelegator
updateLabel
in interface ILabelDelegator
label
- non-null ILabel to be updatedConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String deleteLabel(java.lang.String labelName, boolean force) throws ConnectionException, RequestException, AccessException
ILabelDelegator
deleteLabel
in interface ILabelDelegator
labelName
- non-null label nameforce
- if true, forces the deletion of any label; normally labels can
only be deleted by their ownerConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its
processing of the requestAccessException
- if the Perforce server denies access to the callerpublic java.lang.String deleteLabel(java.lang.String labelName, DeleteLabelOptions opts) throws P4JavaException
ILabelDelegator
deleteLabel
in interface ILabelDelegator
labelName
- non-null label nameopts
- DeleteLabelOptions object describing optional parameters; if
null, no options are set.P4JavaException
- if any error occurs in the processing of this method.