Class 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
    • Constructor Summary

      Constructors 
      Constructor Description
      GraphReceivePackOptions()
      Default constructor
      GraphReceivePackOptions​(java.lang.String repo, java.lang.String user, java.lang.String file, java.lang.String ref, java.lang.String forceRef, java.lang.String packedRef, java.lang.String forcePackedRef, boolean verbose)
      Constructs receive pack option with the given arguments
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getFile()  
      java.lang.String getForcePackedRef()  
      java.lang.String getForceRef()  
      java.lang.String getPackedRef()  
      java.lang.String getRef()
      The SHA reference to the master commit
      java.lang.String getRepo()  
      java.lang.String getUser()  
      boolean isVerbose()  
      java.util.List<java.lang.String> processOptions​(IServer server)
      Turn this (specific) options object into a list of strings to be sent to the Perforce server as options for a specific command.
      void setFile​(java.lang.String file)
      Sets the path to the pack file
      void setForcePackedRef​(java.lang.String forcePackedRef)
      Sets the SHA for -p option
      void setForceRef​(java.lang.String forceRef)
      Sets the SHA for -F option
      void setPackedRef​(java.lang.String packedRef)
      Sets the SHA representing the master pack
      void setRef​(java.lang.String ref)  
      void setRepo​(java.lang.String repo)
      Sets the repository that must exist or will be created by the receive-pack command
      void setUser​(java.lang.String user)
      The user who owns the pack file
      void setVerbose​(boolean verbose)
      Sets the verbosity, option -v, of the command
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • GRAPH_RECEIVE_PACK_COMMAND_PART

        public static final java.lang.String GRAPH_RECEIVE_PACK_COMMAND_PART
        See Also:
        Constant Field Values
    • Constructor Detail

      • GraphReceivePackOptions

        public GraphReceivePackOptions​(java.lang.String repo,
                                       java.lang.String user,
                                       java.lang.String file,
                                       java.lang.String ref,
                                       java.lang.String forceRef,
                                       java.lang.String packedRef,
                                       java.lang.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 Detail

      • processOptions

        public java.util.List<java.lang.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​(java.lang.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 java.lang.String getRepo()
        Returns:
        the repo containing the extracted pack content
      • setUser

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

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

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

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

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

        public void setRef​(java.lang.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 java.lang.String getPackedRef()
        Returns:
        Returns the SHA reference to the commit to receive
      • setPackedRef

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

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

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

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

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