Class BranchDelegator

    • Constructor Detail

      • BranchDelegator

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

      • getBranchSpec

        public IBranchSpec getBranchSpec​(java.lang.String name,
                                         GetBranchSpecOptions opts)
                                  throws P4JavaException
        Description copied from interface: IBranchDelegator
        Get a specific named Perforce branch spec from the Perforce server.

        Note that since the Perforce server usually interprets asking for a non-existent branch spec as equivalent to asking for a template for a new branch spec, you will normally always get back a result here. It is best to first use the getBranchSpecList method to see if the branch spec exists, then use this method to retrieve a specific branch spec once you know it exists.

        Specified by:
        getBranchSpec in interface IBranchDelegator
        Parameters:
        name - non-null Perforce branch name.
        opts - GetBranchSpecOptions object describing optional parameters; if null, no options are set.
        Returns:
        potentially-null IBranchSpec for the named Perforce branch spec.
        Throws:
        P4JavaException - if any error occurs in the processing of this method.
      • deleteBranchSpec

        @Deprecated
        public java.lang.String deleteBranchSpec​(java.lang.String branchSpecName,
                                                 boolean force)
                                          throws ConnectionException,
                                                 RequestException,
                                                 AccessException
        Deprecated.
        Description copied from interface: IBranchDelegator
        Delete a branch spec specifing whether it should be a forced operation.
        Specified by:
        deleteBranchSpec in interface IBranchDelegator
        Parameters:
        branchSpecName - the name of the spec to delete
        force - whether to force the operation through
        Returns:
        name of the deleted spec
        Throws:
        ConnectionException - when there is an error talking to the Helix server
        RequestException - when there is a problem with the data provided in the request
        AccessException - when access to the branch command is not authorised
      • deleteBranchSpec

        public java.lang.String deleteBranchSpec​(java.lang.String branchSpecName,
                                                 DeleteBranchSpecOptions opts)
                                          throws P4JavaException
        Description copied from interface: IBranchDelegator
        Delete a named Perforce branch spec from the Perforce server.
        Specified by:
        deleteBranchSpec in interface IBranchDelegator
        Parameters:
        branchSpecName - non-null name of the branch spec to be deleted.
        opts - DeleteBranchSpecOptions 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.