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 Summary
Fields Modifier and Type Field Description static java.lang.String
GRAPH_RECEIVE_PACK_COMMAND_PART
static java.lang.String
OPTIONS_SPECS
-
Fields inherited from class com.perforce.p4java.option.Options
immutable, optionList
-
-
Constructor Summary
Constructors Constructor Description GraphReceivePackOptions()
Default constructorGraphReceivePackOptions(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 commitjava.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 filevoid
setForcePackedRef(java.lang.String forcePackedRef)
Sets the SHA for -p optionvoid
setForceRef(java.lang.String forceRef)
Sets the SHA for -F optionvoid
setPackedRef(java.lang.String packedRef)
Sets the SHA representing the master packvoid
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 commandvoid
setUser(java.lang.String user)
The user who owns the pack filevoid
setVerbose(boolean verbose)
Sets the verbosity, option -v, of the command-
Methods inherited from class com.perforce.p4java.option.Options
getOptions, isImmutable, processFields, setImmutable, setOptions
-
-
-
-
Field Detail
-
GRAPH_RECEIVE_PACK_COMMAND_PART
public static final java.lang.String GRAPH_RECEIVE_PACK_COMMAND_PART
- See Also:
- Constant Field Values
-
OPTIONS_SPECS
public static final java.lang.String OPTIONS_SPECS
- 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 classOptions
- 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
-
-