Class ChangeDelegator

java.lang.Object
com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator
com.perforce.p4java.impl.mapbased.server.cmd.ChangeDelegator
All Implemented Interfaces:
IChangeDelegator

public class ChangeDelegator extends BaseDelegator implements IChangeDelegator
Implementation to handle the change command.
  • Constructor Details

    • ChangeDelegator

      public ChangeDelegator(IOptionsServer server)
      Instantiates a new change delegator.
      Parameters:
      server - the server
  • Method Details

    • getChangelist

      public IChangelist getChangelist(int id) throws ConnectionException, RequestException, AccessException
      Description copied from interface: IChangeDelegator
      Get a specific Perforce changelist from a Perforce server.

      Corresponds fairly well to the p4 command-line command "change -o", and (like "change -o") does not include the associated changelist files (if any) in the returned changelist object -- you must use getChangelistFiles (or similar) to properly populate the changelist for submission, for example.

      Specified by:
      getChangelist in interface IChangeDelegator
      Parameters:
      id - the Perforce changelist ID; if id is IChangelist.DEFAULT, get the default changelist for the current client (if available)
      Returns:
      non-null IChangelist describing the changelist; if no such changelist, a RequestException is thrown.
      Throws:
      ConnectionException - the connection exception
      RequestException - the request exception
      AccessException - the access exception
    • deletePendingChangelist

      public String deletePendingChangelist(int id) throws ConnectionException, RequestException, AccessException
      Description copied from interface: IChangeDelegator
      Delete a pending Perforce changelist. Throws a P4JavaException if the changelist was associated with opened files or was not a pending changelist.

      Note: any IChangelist object associated with the given changelist will no longer be valid after this operation, and using that object may cause undefined results or even global disaster -- you must ensure that the object is not used again improperly.

      Specified by:
      deletePendingChangelist in interface IChangeDelegator
      Parameters:
      id - the ID of the Perforce pending changelist to be deleted.
      Returns:
      possibly-null operation result message string from the Perforce server
      Throws:
      ConnectionException - the connection exception
      RequestException - the request exception
      AccessException - the access exception
    • deletePendingChangelist

      public String deletePendingChangelist(int id, ChangelistOptions opts) throws P4JavaException
      Description copied from interface: IChangeDelegator
      Delete a pending Perforce changelist. Throws a P4JavaException if the changelist was associated with opened files or was not a pending changelist.

      Note: any IChangelist object associated with the given changelist will no longer be valid after this operation, and using that object may cause undefined results or even global disaster -- you must ensure that the object is not used again improperly.

      Specified by:
      deletePendingChangelist in interface IChangeDelegator
      Parameters:
      id - the ID of the Perforce pending changelist to be deleted.
      opts - ChangelistOptions object describing optional parameters; if null, no options are set.
      Returns:
      possibly-null operation result message string from the Perforce server
      Throws:
      P4JavaException - if any error occurs in the processing of this method
    • getChangelist

      public IChangelist getChangelist(int id, ChangelistOptions opts) throws P4JavaException
      Description copied from interface: IChangeDelegator
      Get a specific Perforce changelist from a Perforce server.

      Corresponds fairly well to the p4 command-line command "change -o", and (like "change -o") does not include the associated changelist files (if any) in the returned changelist object -- you must use getChangelistFiles (or similar) to properly populate the changelist for submission, for example.

      Specified by:
      getChangelist in interface IChangeDelegator
      Parameters:
      id - the Perforce changelist ID; if id is IChangelist.DEFAULT, get the default changelist for the current client (if available)
      opts - ChangelistOptions object describing optional parameters; if null, no options are set.
      Returns:
      non-null IChangelist describing the changelist; if no such changelist, a RequestException is thrown.
      Throws:
      P4JavaException - if any error occurs in the processing of this method