Class Changelist
- java.lang.Object
-
- com.perforce.p4java.impl.generic.core.ServerResource
-
- com.perforce.p4java.impl.generic.core.ChangelistSummary
-
- com.perforce.p4java.impl.generic.core.Changelist
-
- All Implemented Interfaces:
IChangelist
,IChangelistSummary
,IServerResource
public class Changelist extends ChangelistSummary implements IChangelist
Simple default generic implementation class for the IChangelist interface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.perforce.p4java.core.IChangelist
IChangelist.Type
-
Nested classes/interfaces inherited from interface com.perforce.p4java.core.IChangelistSummary
IChangelistSummary.Visibility
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_DESCRIPTION
The default description string for new changelists created by newChangelist.protected java.util.List<IExtendedFileSpec>
extendedFileSpecs
protected java.util.List<IFileSpec>
fileSpecs
protected java.util.List<java.lang.String>
jobIds
protected IOptionsServer
serverImpl
-
Fields inherited from class com.perforce.p4java.impl.generic.core.ChangelistSummary
changelistStream, clientId, date, DATE_FORMAT, description, id, shelved, status, username, visibility
-
Fields inherited from class com.perforce.p4java.impl.generic.core.ServerResource
refreshable, server, updateable
-
Fields inherited from interface com.perforce.p4java.core.IChangelist
DEFAULT, UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description Changelist()
Default constructor; calls default superclass constructor.Changelist(int id, java.lang.String clientId, java.lang.String username, ChangelistStatus status, java.util.Date date, java.lang.String description, boolean shelved, Server serverImpl)
Construct a changelist implementation given an explicit set of initial field values.Changelist(int id, java.lang.String clientId, java.lang.String username, ChangelistStatus status, java.util.Date date, java.lang.String description, boolean shelved, Server serverImpl, IChangelistSummary.Visibility visibility)
Construct a changelist implementation given an explicit set of initial field values.Changelist(IChangelistSummary summary, IOptionsServer server, boolean refresh)
Construct a new Changelist using the passed-in changelist as a template.Changelist(IChangelistSummary summary, IServer server, boolean refresh)
Deprecated.Changelist(java.util.Map<java.lang.String,java.lang.Object> map, IOptionsServer serverImpl)
Construct a changelist impl from the passed-in map and serverImpl parameters.Changelist(java.util.Map<java.lang.String,java.lang.Object> map, IServer serverImpl)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.List<java.lang.String>
getCachedJobIdList()
Return a cached list of job Id's associated with this changelist.java.lang.String
getClientId()
Get the ID of the Perforce client workspace associated with this changelist.java.util.Date
getDate()
Get the date the changelist was created or last updated.java.lang.String
getDescription()
Return the description associated with this changelist.java.io.InputStream
getDiffs(DiffType diffType)
Get an InputStream onto the file diffs associated with this changelist.java.io.InputStream
getDiffsStream(GetChangelistDiffsOptions opts)
Get an InputStream onto the file diffs associated with this changelist.java.util.List<IExtendedFileSpec>
getExtendedFiles(boolean refresh)
java.util.List<IExtendedFileSpec>
getExtendedFiles(boolean refresh, boolean bypassServer)
java.util.List<IFileSpec>
getFiles(boolean refresh)
Get the list of files associated with this changelist, optionally refreshing the list from the server.java.util.List<IFileSpec>
getFiles(boolean refresh, boolean bypassServer)
java.util.List<IFileSpec>
getFileSpecs()
int
getId()
Return the Perforce changelist's ID.java.util.List<java.lang.String>
getJobIds()
Return a list of Perforce jobs IDs for jobs marked as associated with this changelist.java.util.List<IJob>
getJobs()
Return a list of Perforce jobs marked as associated with this changelist.IServer
getServer()
ChangelistStatus
getStatus()
Get the status of this changelist, if known.java.lang.String
getUsername()
Get the user name of the user associated with this changelist.boolean
isShelved()
Does this changelist contain at least one shelved file? This only applies to changelists whoseIChangelistSummary.getStatus()
isChangelistStatus.PENDING
and that have been returned as IChangelistSummary objects.static Changelist
newChangelist(IClient client, java.lang.String description)
Return a new local Changelist object with default values by calling newChangelist with server and client name values taken from the passed-in client object.static Changelist
newChangelist(IServer server, java.lang.String clientName, java.lang.String description)
Return a new local Changelist object with default values.void
refresh()
Refresh the underlying object from the Perforce server.void
setClientId(java.lang.String clientId)
Set the client ID.void
setDate(java.util.Date date)
Set the changelist date.java.lang.String
setDescription(java.lang.String description)
Set the description string for this changelist.void
setFileSpecs(java.util.List<IFileSpec> fileSpecs)
void
setId(int id)
Set the changelist ID.void
setServerImpl(Server serverImpl)
void
setShelved(boolean shelved)
Set the changelist as shelved or not shelvedvoid
setStatus(ChangelistStatus status)
Set the changelist status.void
setUsername(java.lang.String username)
Set the changelist owner ID.java.util.List<IFileSpec>
submit(boolean reOpen)
Submit this changelist.java.util.List<IFileSpec>
submit(boolean reOpen, java.util.List<java.lang.String> jobIds, java.lang.String jobStatus)
Submit this changelist and associate it with the passed-in jobs.java.util.List<IFileSpec>
submit(SubmitOptions opts)
Submit this changelist and associate it with any jobs in the passed-in options.void
submit(SubmitOptions opts, IStreamingCallback callback, int key)
Submit this changelist and associate it with any jobs in the passed-in options.void
update()
Update the Perforce server object associated with the underlying P4Java object, if possible.void
update(boolean force)
Force (if true) update the Perforce server object associated with the underlying P4Java object, if possible.void
update(Options opts)
Update the Perforce server object associated with the underlying P4Java object and its options, if possible.void
updateOnServer(boolean refresh)
Deprecated.use update optionally followed by refresh()-
Methods inherited from class com.perforce.p4java.impl.generic.core.ChangelistSummary
getChangelistStream, getVisibility, setVisibility
-
Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, parseDate, setRawField, setRawFields, setRefreshable, setServer, toDateString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.perforce.p4java.core.IChangelistSummary
getChangelistStream, getVisibility, setVisibility
-
Methods inherited from interface com.perforce.p4java.core.IServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, setRawField, setRawFields, setServer
-
-
-
-
Field Detail
-
serverImpl
protected IOptionsServer serverImpl
-
fileSpecs
protected java.util.List<IFileSpec> fileSpecs
-
extendedFileSpecs
protected java.util.List<IExtendedFileSpec> extendedFileSpecs
-
jobIds
protected java.util.List<java.lang.String> jobIds
-
DEFAULT_DESCRIPTION
public static final java.lang.String DEFAULT_DESCRIPTION
The default description string for new changelists created by newChangelist.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Changelist
public Changelist()
Default constructor; calls default superclass constructor.Actual users of this constructor need to ensure that the super-super-class ServeResource fields are set appropriately after calling this constructor.
-
Changelist
public Changelist(int id, java.lang.String clientId, java.lang.String username, ChangelistStatus status, java.util.Date date, java.lang.String description, boolean shelved, Server serverImpl)
Construct a changelist implementation given an explicit set of initial field values.This constructor requires a Server object as its serverImpl parameter; note that any server object returned by the ServerFactory will work, as long as it's downcast to Server. If it doesn't cast cleanly, then it is not suitable for use here.
- Parameters:
id
- idclientId
- clientusername
- user namestatus
- statusdate
- datedescription
- descriptionshelved
- shelvedserverImpl
- server
-
Changelist
public Changelist(int id, java.lang.String clientId, java.lang.String username, ChangelistStatus status, java.util.Date date, java.lang.String description, boolean shelved, Server serverImpl, IChangelistSummary.Visibility visibility)
Construct a changelist implementation given an explicit set of initial field values.This constructor requires a Server object as its serverImpl parameter; note that any server object returned by the ServerFactory will work, as long as it's downcast to Server. If it doesn't cast cleanly, then it is not suitable for use here.
- Parameters:
id
- idclientId
- clientusername
- user namestatus
- statusdate
- datedescription
- descriptionshelved
- shelvedserverImpl
- servervisibility
- visibility
-
Changelist
public Changelist(IChangelistSummary summary, IOptionsServer server, boolean refresh) throws ConnectionException, RequestException, AccessException
Construct a new Changelist using the passed-in changelist as a template. If summary and server are not null and refresh is true, perform a refresh from the Perforce server to initialize the full changelist.If changelist is null, this is equivalent to calling the default constructor.
- Parameters:
summary
- summaryserver
- serverrefresh
- refresh- 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 requestAccessException
- if the Perforce server denies access to the caller
-
Changelist
@Deprecated public Changelist(IChangelistSummary summary, IServer server, boolean refresh) throws ConnectionException, RequestException, AccessException
Deprecated.
-
Changelist
public Changelist(java.util.Map<java.lang.String,java.lang.Object> map, IOptionsServer serverImpl)
Construct a changelist impl from the passed-in map and serverImpl parameters. Calls super(map, false, serverImpl) and additionally sets job ids associated with this changelist, if any.This constructor requires a Server object as its serverImpl parameter; note that any server object returned by the ServerFactory will work, as long as it's downcast to Server. If it doesn't cast cleanly, then it is not suitable for use here.
- Parameters:
map
- mapserverImpl
- server
-
Changelist
@Deprecated public Changelist(java.util.Map<java.lang.String,java.lang.Object> map, IServer serverImpl)
Deprecated.
-
-
Method Detail
-
newChangelist
public static Changelist newChangelist(IServer server, java.lang.String clientName, java.lang.String description)
Return a new local Changelist object with default values. Default values for all fields not mentioned in the parameter list are as given for the default Changelist and ChangelistSummary default constructors; the main exception is the user name, which is filled in with the current user name.Note that this object is a local object only -- you must subsequently call the client's createChangelist method to also create it on the server (or use the Factory.createChangelist convenience method).
- Parameters:
server
- non-null IServer object to be associated with this changelist.clientName
- non-null name of the client to be associated with this changelistdescription
- if not null, the changelist description string; if null, defaults to Changelist.DEFAULT_DESCRIPTION.- Returns:
- new local Changelist object.
-
newChangelist
public static Changelist newChangelist(IClient client, java.lang.String description)
Return a new local Changelist object with default values by calling newChangelist with server and client name values taken from the passed-in client object.Note that this object is a local object only -- you must subsequently call the client's createChangelist method to also create it on the server (or use the Factory.createChangelist convenience method).
- Parameters:
client
- non-null client to be associated withdescription
- if not null, the changelist description string; if null, defaults to Changelist.DEFAULT_DESCRIPTION.- Returns:
- new local Changelist object.
-
isShelved
public boolean isShelved()
Description copied from interface:IChangelistSummary
Does this changelist contain at least one shelved file? This only applies to changelists whoseIChangelistSummary.getStatus()
isChangelistStatus.PENDING
and that have been returned as IChangelistSummary objects. The value here is unreliable for full IChangelist objects returned from getChangelist, etc.- Specified by:
isShelved
in interfaceIChangelistSummary
- Overrides:
isShelved
in classChangelistSummary
- Returns:
- - true if changelist contains shelved files, false otherwise
- See Also:
IChangelistSummary.isShelved()
-
setShelved
public void setShelved(boolean shelved)
Set the changelist as shelved or not shelved- Specified by:
setShelved
in interfaceIChangelistSummary
- Overrides:
setShelved
in classChangelistSummary
- Parameters:
shelved
- new shelved value.- See Also:
IChangelistSummary.setShelved(boolean)
-
getId
public int getId()
Description copied from interface:IChangelistSummary
Return the Perforce changelist's ID.- Specified by:
getId
in interfaceIChangelistSummary
- Overrides:
getId
in classChangelistSummary
- Returns:
- changelist ID, or UNKNOWN if unknown or not yet allocated.
- See Also:
IChangelistSummary.getId()
-
setId
public void setId(int id)
Description copied from interface:IChangelistSummary
Set the changelist ID. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.- Specified by:
setId
in interfaceIChangelistSummary
- Overrides:
setId
in classChangelistSummary
- Parameters:
id
- new changelist ID.- See Also:
IChangelistSummary.setId(int)
-
getClientId
public java.lang.String getClientId()
Description copied from interface:IChangelistSummary
Get the ID of the Perforce client workspace associated with this changelist.- Specified by:
getClientId
in interfaceIChangelistSummary
- Overrides:
getClientId
in classChangelistSummary
- Returns:
- the ID of the client associated with this changelist, or null if not known.
- See Also:
IChangelistSummary.getClientId()
-
setClientId
public void setClientId(java.lang.String clientId)
Description copied from interface:IChangelistSummary
Set the client ID. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.- Specified by:
setClientId
in interfaceIChangelistSummary
- Overrides:
setClientId
in classChangelistSummary
- Parameters:
clientId
- new client ID.- See Also:
IChangelistSummary.setClientId(java.lang.String)
-
getUsername
public java.lang.String getUsername()
Description copied from interface:IChangelistSummary
Get the user name of the user associated with this changelist.- Specified by:
getUsername
in interfaceIChangelistSummary
- Overrides:
getUsername
in classChangelistSummary
- Returns:
- the user name of the user associated with this changelist, or null if no such name exists or can be determined.
- See Also:
IChangelistSummary.getUsername()
-
setUsername
public void setUsername(java.lang.String username)
Description copied from interface:IChangelistSummary
Set the changelist owner ID. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.- Specified by:
setUsername
in interfaceIChangelistSummary
- Overrides:
setUsername
in classChangelistSummary
- Parameters:
username
- new owner's user name.- See Also:
IChangelistSummary.setUsername(java.lang.String)
-
getStatus
public ChangelistStatus getStatus()
Description copied from interface:IChangelistSummary
Get the status of this changelist, if known.- Specified by:
getStatus
in interfaceIChangelistSummary
- Overrides:
getStatus
in classChangelistSummary
- Returns:
- IChangelistStatus status, or null if not known.
- See Also:
IChangelistSummary.getStatus()
-
setStatus
public void setStatus(ChangelistStatus status)
Description copied from interface:IChangelistSummary
Set the changelist status. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.- Specified by:
setStatus
in interfaceIChangelistSummary
- Overrides:
setStatus
in classChangelistSummary
- Parameters:
status
- status
-
getDate
public java.util.Date getDate()
Description copied from interface:IChangelistSummary
Get the date the changelist was created or last updated.- Specified by:
getDate
in interfaceIChangelistSummary
- Overrides:
getDate
in classChangelistSummary
- Returns:
- the date the changelist was created or last updated, or null if unknown.
- See Also:
IChangelistSummary.getDate()
-
setDate
public void setDate(java.util.Date date)
Description copied from interface:IChangelistSummary
Set the changelist date. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.- Specified by:
setDate
in interfaceIChangelistSummary
- Overrides:
setDate
in classChangelistSummary
- Parameters:
date
- new changelist date- See Also:
IChangelistSummary.setDate(java.util.Date)
-
getDescription
public java.lang.String getDescription()
Description copied from interface:IChangelistSummary
Return the description associated with this changelist.- Specified by:
getDescription
in interfaceIChangelistSummary
- Overrides:
getDescription
in classChangelistSummary
- Returns:
- textual changelist description, or null if no such description.
- See Also:
IChangelistSummary.getDescription()
-
setDescription
public java.lang.String setDescription(java.lang.String description)
Description copied from interface:IChangelistSummary
Set the description string for this changelist.- Specified by:
setDescription
in interfaceIChangelistSummary
- Overrides:
setDescription
in classChangelistSummary
- Parameters:
description
- non-null new description string.- Returns:
- the old description string.
- See Also:
IChangelistSummary.setDescription(java.lang.String)
-
getServer
public IServer getServer()
-
setServerImpl
public void setServerImpl(Server serverImpl)
-
getFiles
public java.util.List<IFileSpec> getFiles(boolean refresh) throws ConnectionException, RequestException, AccessException
Description copied from interface:IChangelist
Get the list of files associated with this changelist, optionally refreshing the list from the server.If this is the first time this method has been called on this changelist, or if refresh is true, the file list is obtained from the server and copied locally to this object; otherwise, the local copy is returned.
Note that the actual file list is returned; this file list is guaranteed mutable and you can change it "live" (by, for example, deleting files from it (deleting files is, in fact, the only thing that makes sense from a Perforce point of view)). Such changes will only be reflected back to the server when a submit is done; adding files to this list results in undefined behavior.
The IFileSpec objects returned are not guaranteed to have any fields except depot path, version, and action valid (and, in fact, if it comes directly from the server, those are usually the only fields that are valid.
Note that the Perforce server side of the submit() processing expects all file lists to be in canonical depot path form; file specs in the associated submit file list that don't have a depot spec will be left untouched (this is a Perforce thing, not a P4Java thing).
This is one of the guaranteed "live" method on this interface, and will return the list as it exists when called (rather than when the underlying implementation object was created) if refresh is true. This can be an expensive method to evaluate, so don't use it willy-nilly.
- Specified by:
getFiles
in interfaceIChangelist
- Parameters:
refresh
- if true, get a new list from the server rather than return the local copy.- Returns:
- a non-null (but possibly-empty) list of files known to be associated with this changelist.
- 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 requestAccessException
- if the Perforce server denies access to the caller
-
getFiles
public java.util.List<IFileSpec> getFiles(boolean refresh, boolean bypassServer) throws ConnectionException, RequestException, AccessException
-
getExtendedFiles
public java.util.List<IExtendedFileSpec> getExtendedFiles(boolean refresh) throws ConnectionException, RequestException, AccessException
-
getExtendedFiles
public java.util.List<IExtendedFileSpec> getExtendedFiles(boolean refresh, boolean bypassServer) throws ConnectionException, RequestException, AccessException
-
getDiffs
public java.io.InputStream getDiffs(DiffType diffType) throws ConnectionException, RequestException, AccessException
Description copied from interface:IChangelist
Get an InputStream onto the file diffs associated with this changelist.This is one of the guaranteed "live" method on this interface, and will return the diff output as it exists when called (rather than when the underlying implementation object was created). This can be an expensive method to evaluate, and can generate reams and reams (and reams) of output, so don't use it willy-nilly.
You should remember to close the returned InputStream when finished with the stream, in order to release the underlying io resources. Failure to do this may leave temporary files lying around or cause inefficient memory usage.
- Specified by:
getDiffs
in interfaceIChangelist
- Parameters:
diffType
- diff type- Returns:
- InputStream onto the diff stream. Note that while this stream will not be null, it may be empty.
- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
IChangelist.getDiffs(com.perforce.p4java.core.file.DiffType)
-
getDiffsStream
public java.io.InputStream getDiffsStream(GetChangelistDiffsOptions opts) throws P4JavaException
Description copied from interface:IChangelist
Get an InputStream onto the file diffs associated with this changelist.This is one of the guaranteed "live" method on this interface, and will return the diff output as it exists when called (rather than when the underlying implementation object was created). This can be an expensive method to evaluate, and can generate reams and reams (and reams) of output, so don't use it willy-nilly.
You should remember to close the returned InputStream when finished with the stream, in order to release the underlying io resources. Failure to do this may leave temporary files lying around or cause inefficient memory usage.
- Specified by:
getDiffsStream
in interfaceIChangelist
- Parameters:
opts
- GetChangelistDiffs object describing optional parameters; if null, no options are set.- Returns:
- InputStream onto the diff stream. Note that while this stream will not be null, it may be empty.
- Throws:
P4JavaException
- if any error occurs in the processing of this method.- See Also:
IChangelist.getDiffsStream(com.perforce.p4java.option.server.GetChangelistDiffsOptions)
-
getJobIds
public java.util.List<java.lang.String> getJobIds() throws ConnectionException, RequestException, AccessException
Description copied from interface:IChangelist
Return a list of Perforce jobs IDs for jobs marked as associated with this changelist. This method is relatively lightweight compared to the getJobList method.Note that "associated" here usually means "fixed", but that is not always the case.
- Specified by:
getJobIds
in interfaceIChangelist
- Returns:
- non-null but potentially empty list of job ID strings
- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
IChangelist.getJobIds()
-
getCachedJobIdList
public java.util.List<java.lang.String> getCachedJobIdList() throws ConnectionException, RequestException, AccessException
Description copied from interface:IChangelist
Return a cached list of job Id's associated with this changelist. This method is not "live", meaning it's quick and cheap to call, but it does not necessarily reflect the current jobs associated with the list on the Perforce server -- it reflects only the jobs associated with the server when the changelist object was retrieved from the server, or when the last live getJobIdList method was called. Usually safe to call immediately after retrieving the changelist, or soon after a live getJobIdList call.- Specified by:
getCachedJobIdList
in interfaceIChangelist
- Returns:
- non-null but potentially empty list of job ID strings
- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
IChangelist.getCachedJobIdList()
-
getJobs
public java.util.List<IJob> getJobs() throws ConnectionException, RequestException, AccessException
Description copied from interface:IChangelist
Return a list of Perforce jobs marked as associated with this changelist. This method is relatively heavyweight compared to the getJobID method.Note that "associated" here usually means "fixed", but that is not always the case.
- Specified by:
getJobs
in interfaceIChangelist
- Returns:
- non-null but potentially empty list of Perforce jobs
- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
IChangelist.getJobs()
-
submit
public java.util.List<IFileSpec> submit(boolean reOpen, java.util.List<java.lang.String> jobIds, java.lang.String jobStatus) throws ConnectionException, RequestException, AccessException
Description copied from interface:IChangelist
Submit this changelist and associate it with the passed-in jobs. Will fail with a suitable request exception if this is not a pending changelist associated with the current client.If the submit is successful, the status of the underlying changelist will be updated to reflect the new status. Other fields will not be automatically updated and need to be refreshed with the refresh() method if you need to access them live.
Note that the list of filespecs returned from the submit will contain only summary filespecs for successful files -- generally only the depot path, action, and revisions fields will be valid; other fields may be null or undefined depending on the server and client implementations. That is, do not rely on the returned filespec list for anything other than depot paths.
Note also that any jobIds and / or job status arguments will override any jobIds already associated with this object on submission (i.e. jobs in the local object's job list).
- Specified by:
submit
in interfaceIChangelist
- Parameters:
reOpen
- if true, reopen the submitted files for editing after a successful submit.jobIds
- if non-null, contains a list of job IDs for jobs that will have their status changed to fixed or "jobStatus", below. This list will override any existing list attached to the changelist as a result of a refresh operation after fixing a job, etc.jobStatus
- if jobIds is non-null, contains a string to which the jobs in the jobIds list will be set on a successful submit; if null the jobs will be marked fixed.- Returns:
- list of affected file specs and / or info / error messages from the Perforce server
- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
IChangelist.submit(boolean, java.util.List, java.lang.String)
-
submit
public java.util.List<IFileSpec> submit(SubmitOptions opts) throws P4JavaException
Description copied from interface:IChangelist
Submit this changelist and associate it with any jobs in the passed-in options. Will fail with a suitable request exception if this is not a pending changelist associated with the current client.If the submit is successful, the status of the underlying changelist will be updated to reflect the new status. Other fields will not be automatically updated and need to be refreshed with the refresh() method if you need to access them live.
Note that the list of filespecs returned from the submit will contain only summary filespecs for successful files -- generally only the depot path, action, and revisions fields will be valid; other fields may be null or undefined depending on the server and client implementations. That is, do not rely on the returned filespec list for anything other than depot paths.
Note also that any jobIds and / or job status arguments given to the SubmitOptions argument will override any jobIds already associated with this object on submission (i.e. jobs in the local object's job list).
- Specified by:
submit
in interfaceIChangelist
- Parameters:
opts
- SubmitOptions object describing optional parameters; if null, no options are set.- Returns:
- list of affected file specs and / or info / error messages from the Perforce server.
- Throws:
P4JavaException
- if any error occurs in the processing of this method.- See Also:
IChangelist.submit(com.perforce.p4java.option.changelist.SubmitOptions)
-
submit
public void submit(SubmitOptions opts, IStreamingCallback callback, int key) throws P4JavaException
Description copied from interface:IChangelist
Submit this changelist and associate it with any jobs in the passed-in options. Will fail with a suitable request exception if this is not a pending changelist associated with the current client.Note that this method takes an IStreamingCallback parameter, and the results are sent to the user using the IStreamingCallback handleResult method; see the IStreamingCallback Javadoc for details. The payload passed to handleResult is usually the raw map gathered together deep in the RPC protocol layer, and the user is assumed to have the knowledge and technology to be able to parse it and use it.
- Specified by:
submit
in interfaceIChangelist
- Parameters:
opts
- SubmitOptions object describing optional parameters; if null, no options are set.callback
- a non-null IStreamingCallback to be used to process the incoming results.key
- an opaque integer key that is passed to the IStreamingCallback callback methods to identify the action as being associated with this specific call.- Throws:
P4JavaException
- if any error occurs in the processing of this method.- See Also:
IChangelist.submit(com.perforce.p4java.option.changelist.SubmitOptions, com.perforce.p4java.server.callback.IStreamingCallback, int)
-
submit
public java.util.List<IFileSpec> submit(boolean reOpen) throws ConnectionException, RequestException, AccessException
Description copied from interface:IChangelist
Submit this changelist. Will fail with a suitable request exception if this is not a pending changelist associated with the current client.If the submit is successful, the status of the underlying changelist will be updated to reflect the new status. Other fields will not be automatically updated and need to be refreshed with the refresh() method if you need to access them live.
Note that the list of filespecs returned from the submit will contain only summary filespecs for successful files -- generally only the depot path, action, and revisions fields will be valid; other fields may be null or undefined depending on the server and client implementations. That is, do not rely on the returned filespec list for anything other than depot paths.
- Specified by:
submit
in interfaceIChangelist
- Parameters:
reOpen
- if true, reopen the submitted files for editing after a successful submit.- Returns:
- list of affected file specs and / or info / error messages from the Perforce server
- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
IChangelist.submit(boolean)
-
refresh
public void refresh() throws ConnectionException, RequestException, AccessException
Description copied from interface:IServerResource
Refresh the underlying object from the Perforce server.The details of what "refreshable" means in this context are always object-dependent, but typically mean that "live" data and metadata will be updated from the server.
The results of calling this method on objects whose canRefresh method returns false are undefined (but will generally result in a UnimplementedError being thrown).
- Specified by:
refresh
in interfaceIChangelist
- Specified by:
refresh
in interfaceIServerResource
- Overrides:
refresh
in classServerResource
- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
IServerResource.refresh()
-
update
public void update() throws ConnectionException, RequestException, AccessException
Description copied from interface:IServerResource
Update the Perforce server object associated with the underlying P4Java object, if possible. The semantics of server updates are generally object-specific and will be spelled out for each participating object.The results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).
- Specified by:
update
in interfaceIServerResource
- Overrides:
update
in classServerResource
- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
ServerResource.update()
-
update
public void update(boolean force) throws ConnectionException, RequestException, AccessException
Description copied from interface:IServerResource
Force (if true) update the Perforce server object associated with the underlying P4Java object, if possible. The semantics of server updates are generally object-specific and will be spelled out for each participating object.Note, in order to force the change it may require super user / admin privileges to work properly.
The results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).
- Specified by:
update
in interfaceIServerResource
- Overrides:
update
in classServerResource
- Parameters:
force
- if true, force the update of the object on the server.- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
ServerResource.update(boolean)
-
update
public void update(Options opts) throws ConnectionException, RequestException, AccessException
Description copied from interface:IServerResource
Update the Perforce server object associated with the underlying P4Java object and its options, if possible. The semantics of server updates are generally object-specific and will be spelled out for each participating object.The results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).
- Specified by:
update
in interfaceIServerResource
- Overrides:
update
in classServerResource
- Parameters:
opts
- Options object describing optional parameters; if null, no options are set.- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
ServerResource.update(com.perforce.p4java.option.Options)
-
updateOnServer
@Deprecated public void updateOnServer(boolean refresh) throws ConnectionException, RequestException, AccessException
Deprecated.use update optionally followed by refresh()Description copied from interface:IChangelist
Update the Perforce server's version of this changelist. All known non-null fields will be updated. Basically, when called with a refresh parameter of false, this is a convenience method for the IServerResource update().- Specified by:
updateOnServer
in interfaceIChangelist
- Parameters:
refresh
- if true, does a refresh() behind the scenes after a successful return.- 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 requestAccessException
- if the Perforce server denies access to the caller- See Also:
IChangelist.updateOnServer(boolean)
-
getFileSpecs
public java.util.List<IFileSpec> getFileSpecs()
-
setFileSpecs
public void setFileSpecs(java.util.List<IFileSpec> fileSpecs)
-
-