Class PropertyDelegator

    • Constructor Detail

      • PropertyDelegator

        public PropertyDelegator​(IOptionsServer server)
        Instantiate a new PropertyDelegator, 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

      • setProperty

        public java.lang.String setProperty​(java.lang.String name,
                                            java.lang.String value,
                                            PropertyOptions opts)
                                     throws P4JavaException
        Description copied from interface: IPropertyDelegator
        Updates a property value in the Perforce server, or adds the property value to the Perforce server if it is not yet there.

        This method require that the user have 'admin' access granted by 'p4 protect'.

        Specified by:
        setProperty in interface IPropertyDelegator
        Parameters:
        name - non-null property name.
        value - property value.
        opts - PropertyOptions object describing optional parameters; if null, no options are set.
        Returns:
        non-null result message string from the set (add/update) operation.
        Throws:
        P4JavaException - if an error occurs processing this method and its parameters.
      • getProperty

        public java.util.List<IProperty> getProperty​(GetPropertyOptions opts)
                                              throws P4JavaException
        Description copied from interface: IPropertyDelegator
        Gets a list of one or more property values from the Perforce server.

        The -A flag require that the user have 'admin' access granted by 'p4 protect'.

        Note that specifying the -n flag when using the -l flag substantially improves the performance of this command.

        Specified by:
        getProperty in interface IPropertyDelegator
        Parameters:
        opts - GetPropertyOptions object describing optional parameters; if null, no options are set.
        Returns:
        a non-null (but possibly empty) list of property values.
        Throws:
        P4JavaException - if an error occurs processing this method and its parameters.
      • deleteProperty

        public java.lang.String deleteProperty​(java.lang.String name,
                                               PropertyOptions opts)
                                        throws P4JavaException
        Description copied from interface: IPropertyDelegator
        Deletes a property value from the Perforce server.

        This method require that the user have 'admin' access granted by 'p4 protect'.

        Specified by:
        deleteProperty in interface IPropertyDelegator
        Parameters:
        name - non-null property name.
        opts - PropertyOptions object describing optional parameters; if null, no options are set.
        Returns:
        non-null result message string from the delete operation.
        Throws:
        P4JavaException - if an error occurs processing this method and its parameters.