Class KeyDelegator

    • Constructor Detail

      • KeyDelegator

        public KeyDelegator​(IOptionsServer server)
        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 Detail

      • deleteKey

        public java.lang.String deleteKey​(java.lang.String keyName)
                                   throws P4JavaException
        Description copied from interface: IKeyDelegator
        Delete a key on a Perforce server.
        Specified by:
        deleteKey in interface IKeyDelegator
        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

        public java.lang.String setKey​(java.lang.String keyName,
                                       java.lang.String value,
                                       KeyOptions opts)
                                throws P4JavaException
        Description copied from interface: IKeyDelegator
        Create, 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:
        setKey in interface IKeyDelegator
        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

        public java.lang.String getKey​(java.lang.String keyName)
                                throws P4JavaException
        Description copied from interface: IKeyDelegator
        Get 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:
        getKey in interface IKeyDelegator
        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.