|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.starteam.CheckinManager
public class CheckinManager
Provides a way to check in multiple files, applying a consistent set of options across all files. Files may be aggregated or overwritten (using the different flavors of the checkin api's) until ready to commit all the changes Files may also be deleted or moved from their current parent folder to a different folder in the same view The commit() method must be called to save all the changes to the repository The commit consists of a non-transactional phase, followed by a transactional one, which additionally creates a ChangePackage that encompasses the set of changes, i.e. files added, modified, deleted and moved During the non-transactional phase of the commit, events are fired to the calling client application, at which point, the application may still decide to overwrite earlier decisions such as ignoring certain files, force checking in others, checking in from a different stream, etc. Usage CheckinManager cm = myView.createCheckinManager(); cm.checkin(file1); cm.checkinFrom(file2, new java.io.File("c://myprojects//myworkspace//file2.txt"); cm.delete(file3); cm.move(file4, myView.getRootFolder()); if (cm.canCommit()) cm.commit();
| Nested Class Summary | |
|---|---|
static class |
CheckinManager.Progress
Information on the progress of a checkin operation from CheckinManager. |
static class |
CheckinManager.WebCacheCheckinManager
|
| Method Summary | |
|---|---|
void |
addCheckinListener(CheckinListener listener)
Adds a listener for checkin-related events. |
boolean |
bytesTransferred(int bytes)
The number of bytes transferred from client to server |
boolean |
canCommit()
returns true if the session can be committed For the session to be in a commit-able state, all files being checked in should be in a relevant state, e.g. |
void |
checkin(File starTeamFile)
Checks in a single file from the default location. |
void |
checkin(File[] files)
Checks in the given set of files. |
void |
checkin(File starTeamFile,
CheckinOptions options)
Checks in a file with the specified set of options. |
void |
checkin(Folder folder)
Checks in all the files in the given folder. |
void |
checkin(Folder folder,
int depth)
Checks in all the files in the given folder, and in all sub-folders to the given depth. |
void |
checkinFrom(File starTeamFile,
java.io.File diskFile)
Checks in a file in the context of the specified starTeam File Object. |
void |
checkinFrom(File starTeamFile,
java.io.InputStream stream)
Checks in a single file from an input stream. |
java.lang.Object |
clone()
Clone a checkin manager from this one |
void |
commit()
Commit all the changes to the repository |
ChangePackage |
getChangePackage()
Returns the Change Package created as the outcome of this checkin operation Returns NULL if this checkin has not yet run or if the server does not support Change Packages |
java.lang.String |
getName()
Returns the name of the ChangePackage for this session. |
CheckinOptions |
getOptions()
Gets the default checkin options currently in effect. |
CheckinManager.Progress |
getProgress()
Gets a snapshot of the state of the current checkin operation. |
View |
getView()
returns the containing view |
boolean |
hasCheckinListeners()
Returns true if there is at least one registered listener for checkin events |
void |
ignore(Item starTeamItem)
Remove this item from consideration for the commit If the item was to be checked in, it will not be checked in if it was to be deleted, it will not be deleted, if it was to be moved, it will not be moved If the item is a folder, then all child items, descendant folders and child items of descendant folders will be removed from consideration |
boolean |
isCanceled()
Indicates whether or not pending checkin operations have been canceled. |
boolean |
isRunning()
Determines whether or not there is currently a checkin operation in progress. |
void |
moveTo(Item starTeamItem,
Folder toFolder,
boolean moveLocal)
Move an item from it's current parent folder to the folder specified The specified folder MUST be a folder in the same view as the item is in, and as the CheckinManager is operating in. |
void |
remove(Item starTeamItem,
boolean deleteLocal)
Remove an item from the repository. |
void |
removeCheckinListener(CheckinListener listener)
Removes a listener for checkin-related events. |
void |
setCanceled()
Cancels any pending checkin operations. |
void |
setName(java.lang.String name)
Sets the name of the ChangePackage for this session. |
void |
setOptions(CheckinOptions checkinOptions)
Changes the checkin options currently in effect. |
long |
size()
returns a count of the amount of work to be done by this manager |
java.lang.String |
toString()
Gets a string representation of this CheckinManager, useful for debugging. |
void |
update(Item starTeamItem)
Update an Item in the repository. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public java.lang.Object clone()
clone in class java.lang.Objectpublic void setCanceled()
CheckinManager.isCanceled()public boolean isCanceled()
CheckinManager.setCanceled()public void checkin(File starTeamFile)
starTeamFile - The file to be checked in.CheckinManager.commit()
public void checkinFrom(File starTeamFile,
java.io.InputStream stream)
starTeamFile - The file to be checked in.stream - The stream from which the content is to be read.CheckinManager.commit()public void checkin(File[] files)
files - The files to be checked in.CheckinManager.commit(),
Folder.getItems(com.starteam.Item.Type)public void checkin(Folder folder)
folder - The StarTeam folder whose files are to be checked in.CheckinManager.commit(),
Folder,
CheckinManager.checkin(Folder,int)
public void checkin(Folder folder,
int depth)
folder - The StarTeam folder whose files are to be checked in.depth - Indicates which sub-folders also contain files to be checked
in. Zero indicates that no sub-folders should be included; 1
indicates that this folder and its immediate child folders
should be included; -1 indicates that this folder and all
child folders at any depth should be included. -2 indicates
that only this folder will be included, without any of it's
containing files or sub-folders if depth == -2, it is expected
that the folder being checked in is a not-in-view folderCheckinManager.commit()
public void checkinFrom(File starTeamFile,
java.io.File diskFile)
starTeamFile - File a starTeam File Object instancediskFile - java.io.File the working file on disk to checkin fromCheckinManager.commit()
public void checkin(File starTeamFile,
CheckinOptions options)
starTeamFile - The file to checkinoptions - the checkin options to use. These options override the default
options assigned when this checkin manager was created.CheckinManager.commit()public void update(Item starTeamItem)
starTeamItem - the item to update
public void remove(Item starTeamItem,
boolean deleteLocal)
starTeamItem - The starTeam item to removedeleteLocal - if true, and if the item is a file, then delete the local
working file
public void moveTo(Item starTeamItem,
Folder toFolder,
boolean moveLocal)
starTeamItem - the item to move to a different folder in the repositorytoFolder - the folder to move the item to.moveLocal - if the item is a File, move the local disk file on the file
system toopublic long size()
public boolean canCommit()
public void ignore(Item starTeamItem)
starTeamItem - public void commit()
public boolean isRunning()
public void addCheckinListener(CheckinListener listener)
listener - Application-specific event handler for checkin-related events.CheckinListener,
CheckinEvent,
CheckinManager.removeCheckinListener(com.starteam.events.CheckinListener)public void removeCheckinListener(CheckinListener listener)
listener - A previously-registered event handler for checkin-related
events.CheckinManager.addCheckinListener(com.starteam.events.CheckinListener)public boolean hasCheckinListeners()
public java.lang.String toString()
toString in class java.lang.Objectpublic CheckinOptions getOptions()
Note that individual options can be overridden on a file-by-file basis by registering a CheckinListener, and changing options as necessary in the onStartFile event handler.
CheckinOptions,
CheckinManager.addCheckinListener(com.starteam.events.CheckinListener)public void setOptions(CheckinOptions checkinOptions)
checkinOptions - The new checkin options.public ChangePackage getChangePackage()
public CheckinManager.Progress getProgress()
CheckinManager.Progress,
CheckinManager.isRunning()public View getView()
public boolean bytesTransferred(int bytes)
bytesTransferred in interface StreamUtils.Listenerbytes - the bytes transferred from client to server
public void setName(java.lang.String name)
name - the name of the ChangePackage for this sessionpublic java.lang.String getName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||