Class LabelDelegator

    • 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 interface ILabelDelegator
        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 request
        AccessException - 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 interface ILabelDelegator
        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 request
        AccessException - 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 interface ILabelDelegator
        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 request
        AccessException - 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 interface ILabelDelegator
        Parameters:
        labelName - non-null label name
        force - 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 request
        AccessException - 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 interface ILabelDelegator
        Parameters:
        labelName - non-null label name
        opts - 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.