Class GraphReceivePackOptions

java.lang.Object
com.perforce.p4java.option.Options
com.perforce.p4java.option.server.GraphReceivePackOptions

public class GraphReceivePackOptions extends Options
Options required by the graph receve-pack command Usage: receive-pack -n repo [-u user -v] -i files... [ -r refs... | -F refs... | -p packed-refs ] - option -i refer to the .pack file it self e.g ./p4 graph receive-pack -n //graph/scm-plugin -i scm-api-plugin.git/objects/pack/pack-156db553fe00511509f8395aaeb0eed2f0871e9c.pack - option -r refer to the SHA value of the master commit e.g ./p4 graph receive-pack -n //graph/scm-plugin -r master=5631932f5cdf6c3b829911b6fe5ab42d436d74da - option -p refer to the packed-refs
  • Field Details

  • Constructor Details

    • GraphReceivePackOptions

      public GraphReceivePackOptions(String repo, String user, String file, String ref, String forceRef, String packedRef, String forcePackedRef, boolean verbose)
      Constructs receive pack option with the given arguments
      Parameters:
      repo - Graph repo (-n repo)
      user - Owner (-u user)
      file - Pack file (-i file)
      ref - SHA reference (-r refs...)
      forceRef - Import at reference (-F refs...)
      packedRef - Packed Reference (-p packed-refs)
      forcePackedRef - Force option (-P)
      verbose - Verbose output (-v)
      Since:
      2017.1
    • GraphReceivePackOptions

      public GraphReceivePackOptions()
      Default constructor
  • Method Details

    • processOptions

      public List<String> processOptions(IServer server) throws OptionsException
      Description copied from class: Options
      Turn this (specific) options object into a list of strings to be sent to the Perforce server as options for a specific command. As a side effect, set the option list associated with this Option to the result.

      The method is used by the server object to generate the string-based arguments expected by the Perforce server corresponding to the state of this method-specific options object. Will return an empty list if there are no "interesting" options set or available. May simply return the superclass options string list if is non-null, but that behaviour is neither guaranteed nor required.

      Note that this method is not intended to be called directly by users but by the underlying P4Java plumbing; odd results may occur if this method is called in other contexts.

      Specified by:
      processOptions in class Options
      Parameters:
      server - possibly-null IServer representing the Perforce server the options are to be used against. If this parameter is null, it is acceptable to throw an OptionsException, but it is also possible to ignore it and do the best you can with what you've got...
      Returns:
      non-null (but possibly empty) string list representing the normalized Perforce server arguments corresponding to the state of this specific options object.
      Throws:
      OptionsException - if an error occurs in options processing that is not some species of ConnectionException, RequestException, AccessException, etc.
    • setRepo

      public void setRepo(String repo)
      Sets the repository that must exist or will be created by the receive-pack command
      Parameters:
      repo - - the repo containing the extracted pack content
    • getRepo

      public String getRepo()
      Returns:
      the repo containing the extracted pack content
    • setUser

      public void setUser(String user)
      The user who owns the pack file
      Parameters:
      user - - the user who owns the pack file
    • getUser

      public String getUser()
      Returns:
      the user who owns the pack file
    • setFile

      public void setFile(String file)
      Sets the path to the pack file
      Parameters:
      file - - The path to the pack file itself
    • getFile

      public String getFile()
      Returns:
      - The path to the pack file itself
    • getRef

      public String getRef()
      The SHA reference to the master commit
      Returns:
      Sets the -r option value
    • setRef

      public void setRef(String ref)
      Parameters:
      ref - - Sets the -r option value
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets the verbosity, option -v, of the command
      Parameters:
      verbose - - true or false
    • isVerbose

      public boolean isVerbose()
      Returns:
      verbosity is set to true or false
    • getPackedRef

      public String getPackedRef()
      Returns:
      Returns the SHA reference to the commit to receive
    • setPackedRef

      public void setPackedRef(String packedRef)
      Sets the SHA representing the master pack
      Parameters:
      packedRef - - the SHA reference to the commit to receive
    • getForceRef

      public String getForceRef()
      Returns:
      the SHA set for the -F option
    • setForceRef

      public void setForceRef(String forceRef)
      Sets the SHA for -F option
      Parameters:
      forceRef - - the SHA set for the -F option
    • getForcePackedRef

      public String getForcePackedRef()
      Returns:
      the SHA for -p option
    • setForcePackedRef

      public void setForcePackedRef(String forcePackedRef)
      Sets the SHA for -p option
      Parameters:
      forcePackedRef - - the SHA for -p option