Class LabelsDelegator

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

public class LabelsDelegator extends BaseDelegator implements ILabelsDelegator
Implementation to handle the Labels command.
  • Constructor Details

    • LabelsDelegator

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

    • getLabels

      public List<ILabelSummary> getLabels(String user, int maxLabels, String nameFilter, List<IFileSpec> fileList) throws ConnectionException, RequestException, AccessException
      Description copied from interface: ILabelsDelegator
      Get a list of Perforce labels, optionally tied to a specific set of files.

      Note that the ILabel objects returned here do not have views associated with them (i.e. the getViewMapping() method will return an empty list. If you need to get the view mapping for a specific label, use the getLabel() method.

      Specified by:
      getLabels in interface ILabelsDelegator
      Parameters:
      user - if non-null, limit labels to those owned by the named user
      maxLabels - if larger than zero, return only the first maxLabels (or fewer) qualifying labels
      nameFilter - if not null, limits output to labels whose name matches the nameFilter pattern, e.g. -e 'svr-dev-rel*'
      fileList - if not null, limits its report to labels that contain those files
      Returns:
      non-null (but possibly-empty) list of qualifying Perforce labels
      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
    • getLabels

      public List<ILabelSummary> getLabels(List<IFileSpec> fileList, GetLabelsOptions opts) throws P4JavaException
      Description copied from interface: ILabelsDelegator
      Get a list of Perforce labels, optionally tied to a specific set of files.

      Note that the ILabel objects returned here do not have views associated with them (i.e. the getViewMapping() method will return an empty list. If you need to get the view mapping for a specific label, use the getLabel() method.

      Specified by:
      getLabels in interface ILabelsDelegator
      Parameters:
      fileList - if not null, limits its report to labels that contain those files
      opts - GetLabelsOptions object describing optional parameters; if null, no options are set.
      Returns:
      non-null (but possibly-empty) list of qualifying Perforce labels
      Throws:
      P4JavaException - if any error occurs in the processing of this method.