Class LabelDelegator
- java.lang.Object
-
- com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
-
- com.perforce.p4java.impl.mapbased.server.cmd.LabelDelegator
-
- All Implemented Interfaces:
ILabelDelegator
public class LabelDelegator extends BaseDelegator implements ILabelDelegator
Implementation to handle the Label 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 LabelDelegator(IOptionsServer server)
Instantiate a new LabelDelegator, 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.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.
-
-
-
Constructor Detail
-
LabelDelegator
public LabelDelegator(IOptionsServer server)
Instantiate a new LabelDelegator, 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
-
getLabel
public ILabel getLabel(java.lang.String labelName) throws ConnectionException, RequestException, AccessException
Description copied from interface:ILabelDelegator
Get a specific named Perforce label.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.
- Specified by:
getLabel
in interfaceILabelDelegator
- Parameters:
labelName
- non-null label name- Returns:
- ILabel representing the associated Perforce label, or null if no such label exists on the server.
- 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 requestAccessException
- if the Perforce server denies access to the caller
-
createLabel
public java.lang.String createLabel(ILabel label) throws ConnectionException, RequestException, AccessException
Description copied from interface:ILabelDelegator
Create a new Perforce label in the Perforce server.- Specified by:
createLabel
in interfaceILabelDelegator
- Parameters:
label
- non-null ILabel to be saved- 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:
ConnectionException
- 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 caller
-
updateLabel
public java.lang.String updateLabel(ILabel label) throws ConnectionException, RequestException, AccessException
Description copied from interface:ILabelDelegator
Update an existing Perforce label in the Perforce server.- Specified by:
updateLabel
in interfaceILabelDelegator
- Parameters:
label
- non-null ILabel to be updated- 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:
ConnectionException
- 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 caller
-
deleteLabel
public java.lang.String deleteLabel(java.lang.String labelName, boolean force) throws ConnectionException, RequestException, AccessException
Description copied from interface:ILabelDelegator
Delete a named Perforce label from the Perforce server.- Specified by:
deleteLabel
in interfaceILabelDelegator
- Parameters:
labelName
- non-null label nameforce
- if true, forces the deletion of any label; normally labels can only be deleted by their owner- 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:
ConnectionException
- 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 caller
-
deleteLabel
public java.lang.String deleteLabel(java.lang.String labelName, DeleteLabelOptions opts) throws P4JavaException
Description copied from interface:ILabelDelegator
Delete a named Perforce label from the Perforce server.- Specified by:
deleteLabel
in interfaceILabelDelegator
- Parameters:
labelName
- non-null label nameopts
- DeleteLabelOptions 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.
-
-