|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.starteam.CheckoutManager
public class CheckoutManager
Provides a way to check out multiple files, applying a consistent set of options across all files. Files may be aggregated or overwritten (using the different flavors of the checkout api's) until ready to commit all the changes The commit() method must be called to save all identified changes to the local file system Files will be checked out either from the StarTeam server or from the closest cache agent If a cache agent is being used, file checkouts are multi-threaded, and are based on the HTTP protocol The commit is non-transactional, and is executed in two primary phases During the first phase of the checkout, events are fired to the calling client application, at which point, the application may decide to overwrite earlier decisions, such as ignoring certain files, force checking out others, checking out to a different stream, etc. Usage CheckoutManager cm = myView.createCheckoutManager(); cm.checkout(file1); cm.checkoutTo(file2, new java.io.File("c://myprojects//myworkspace//file2.txt"); cm.checkout(file3, new CheckoutOptions(myView)); if (cm.canCommit()) cm.commit();
| Nested Class Summary | |
|---|---|
static class |
CheckoutManager.Progress
Information on the progress of a checkout operation from CheckoutManager. |
static class |
CheckoutManager.WebCacheCheckoutManager
|
| Method Summary | |
|---|---|
void |
addCheckoutListener(CheckoutListener listener)
Adds a listener for checkout-related events. |
boolean |
bytesTransferred(int bytes)
the number of bytes transferred from the server to the client |
boolean |
canCommit()
returns true if the session can be committed For the session to be in a commit-able state, all files being checked out should be in a relevant state, e.g. |
void |
checkout(File starTeamFile)
Checks out a single file to the default location. |
void |
checkout(File[] files)
Checks out the given set of files. |
void |
checkout(File starTeamFile,
CheckoutOptions options)
Checks out a file with the specified set of options. |
void |
checkout(Folder folder)
Checks out all the files in the given folder. |
void |
checkout(Folder folder,
int depth)
Checks out all the files in the given folder, and in all sub-folders to the given depth. |
void |
checkoutTo(File starTeamFile,
java.io.File diskFile)
Checks out a file in the context of the specified starTeam File Object to the specified file system disk file. |
void |
checkoutTo(File starTeamFile,
java.io.OutputStream stream)
Checks out a single file to an output stream. |
java.lang.Object |
clone()
clone a checkout manager from this one |
File[] |
commit()
Commit all the changes to the local file system. |
CheckoutOptions |
getOptions()
Gets the checkout options currently in effect. |
CheckoutManager.Progress |
getProgress()
Gets a snapshot of the state of the current checkout operation. |
View |
getView()
returns the containing view |
boolean |
hasCheckoutListeners()
Returns true if there is at least one registered listener for checkout events |
void |
ignore(Item starTeamItem)
Remove this item from consideration for the commit If the item was to be checked out, it will not be checked out If the item is a folder, then all child files, descendant folders and child files of descendant folders will be removed from consideration |
boolean |
isCanceled()
Indicates whether or not pending checkout operations have been canceled. |
boolean |
isRunning()
Determines whether or not there is currently a checkout operation in progress. |
void |
removeCheckoutListener(CheckoutListener listener)
Removes a listener for checkout-related events. |
void |
setCanceled()
Cancels any pending checkout operations. |
void |
setOptions(CheckoutOptions checkoutOptions)
Changes the checkout 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 CheckoutManager, useful for debugging. |
| 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()
CheckoutManager.isCanceled()public boolean isCanceled()
CheckoutManager.setCanceled()
public void checkoutTo(File starTeamFile,
java.io.File diskFile)
throws java.io.IOException
starTeamFile - File a starTeam File Object instancediskFile - File a java.io.File to checkout to
java.io.IOExceptionCheckoutOptions.setForceCheckout(boolean)public void checkout(File starTeamFile)
starTeamFile - The file to be checked out.CheckoutManager.commit()
public void checkout(File starTeamFile,
CheckoutOptions options)
starTeamFile - The file to checkoutoptions - the checkout options to use. These options override the
default options assigned when this checkout manager was
created.CheckoutManager.commit()
public void checkoutTo(File starTeamFile,
java.io.OutputStream stream)
starTeamFile - The file to be checked out.stream - The stream to which the checked out content is written.public boolean canCommit()
public long size()
public File[] commit()
public void ignore(Item starTeamItem)
starTeamItem - public void checkout(File[] files)
files - The files to be checked out.CheckoutManager.commit(),
Folder.getItems(com.starteam.Item.Type)public void checkout(Folder folder)
folder - The StarTeam folder whose files are to be checked out.Folder,
CheckoutManager.checkout(Folder,int)
public void checkout(Folder folder,
int depth)
folder - The StarTeam folder whose files are to be checked out.depth - Indicates which sub-folders also contain files to be checked
out. 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 the folder should be 'checked out'public boolean isRunning()
public void addCheckoutListener(CheckoutListener listener)
listener - Application-specific event handler for checkout-related
events.CheckoutListener,
CheckoutEvent,
CheckoutManager.removeCheckoutListener(com.starteam.events.CheckoutListener)public void removeCheckoutListener(CheckoutListener listener)
listener - A previously-registered event handler for checkout-related
events.CheckoutManager.addCheckoutListener(com.starteam.events.CheckoutListener)public boolean hasCheckoutListeners()
public java.lang.String toString()
toString in class java.lang.Objectpublic CheckoutOptions getOptions()
Note that individual options can be overridden on a file-by-file basis by registering a CheckoutListener, and changing options as necessary in the onStartFile event handler.
CheckoutOptions,
CheckoutManager.addCheckoutListener(com.starteam.events.CheckoutListener)public void setOptions(CheckoutOptions checkoutOptions)
checkoutOptions - The new checkout options.public CheckoutManager.Progress getProgress()
CheckoutManager.Progress,
CheckoutManager.isRunning()public View getView()
public boolean bytesTransferred(int bytes)
bytesTransferred in interface StreamUtils.Listenerbytes - the number of bytes transferred from the server to the client
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||