Class KeyDelegator
java.lang.Object
com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
com.perforce.p4java.impl.mapbased.server.cmd.KeyDelegator
- All Implemented Interfaces:
IKeyDelegator
Implementation to handle the Key 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
ConstructorsConstructorDescriptionKeyDelegator(IOptionsServer server) Instantiate a new KeyDelegator, providing the server object that will be used to execute Perforce Helix attribute commands. -
Method Summary
Modifier and TypeMethodDescriptionDelete a key on a Perforce server.Get the value of a named Perforce key from the Perforce server.setKey(String keyName, String value, KeyOptions opts) Create, set or delete a key on a Perforce server.setMultipleKeyValuePair(String[] pairs) It takes the pair list defining multiple set and delete operations to be performed.
-
Constructor Details
-
KeyDelegator
Instantiate a new KeyDelegator, 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 Details
-
deleteKey
Description copied from interface:IKeyDelegatorDelete a key on a Perforce server.- Specified by:
deleteKeyin interfaceIKeyDelegator- Parameters:
keyName- non-null key name.- Returns:
- non-null result message string (empty) from the delete operation.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters.
-
setKey
Description copied from interface:IKeyDelegatorCreate, set or delete a key on a Perforce server. This method can be used to create, set, increment, or delete a key according to the specific options set in the associated options object.- Specified by:
setKeyin interfaceIKeyDelegator- Parameters:
keyName- non-null key name.value- value the key should be set to; can be null if the set operation is an increment.opts- KeyOptions object describing optional parameters; if null, no options are set.- Returns:
- possibly-null current (post-set, post-increment) value; may be empty if the operation was a delete.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters.
-
getKey
Description copied from interface:IKeyDelegatorGet the value of a named Perforce key from the Perforce server. Note that this method will return a zero string (i.e. "0") if the named key doesn't exist (rather than throw an exception); use getKeys to see if a key actually exists before you use it.- Specified by:
getKeyin interfaceIKeyDelegator- Parameters:
keyName- non-null key name.- Returns:
- non-null (but possibly zero, if non-existing) key value associated with keyName.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters.
-
setMultipleKeyValuePair
Description copied from interface:IKeyDelegatorIt takes the pair list defining multiple set and delete operations to be performed. Each operation is defined by a value pair in the pair list. To set a key, use a name and value, to delete a key, use a - (hyphen) followed by the name.- Specified by:
setMultipleKeyValuePairin interfaceIKeyDelegator- Parameters:
pairs- List of multiple key name and value pairs- Returns:
- non-null (but possibly zero, if non-existing) key value associated with keyName.
- Throws:
P4JavaException- if an error occurs processing this method and its parameters.
-