public class SvnCommitPacket
extends java.lang.Object
SvnCommitItem
objects which represent information on versioned items intended
for being committed to a repository.
Used by commit-related operations to collect and hold information on paths that are to be committed.
Each SvnCommitPacket
is committed in a single transaction.
SvnCommitItem
Modifier and Type | Field and Description |
---|---|
private java.util.Map<SVNURL,java.util.Collection<SvnCommitItem>> |
items |
private java.util.Map<java.lang.String,SvnCommitItem> |
itemsByPath |
private java.lang.Object |
lockingContext |
private java.util.Map<SVNURL,java.lang.String> |
lockTokens |
private ISvnCommitRunner |
runner |
private java.util.concurrent.atomic.AtomicInteger |
sharedIndex |
private java.util.Set<java.lang.String> |
skippedPaths |
Modifier | Constructor and Description |
---|---|
|
SvnCommitPacket()
Creates a commit packet and initializes its fields with empty lists.
|
private |
SvnCommitPacket(java.util.Map<SVNURL,java.util.Collection<SvnCommitItem>> items,
java.util.Map<java.lang.String,SvnCommitItem> itemsByPath,
java.lang.Object lockingContext,
java.util.Map<SVNURL,java.lang.String> lockTokens,
ISvnCommitRunner runner,
java.util.Set<java.lang.String> skippedPaths) |
Modifier and Type | Method and Description |
---|---|
SvnCommitItem |
addItem(java.io.File path,
SVNNodeKind kind,
SVNURL repositoryRoot,
java.lang.String repositoryPath,
long revision,
java.lang.String copyFromPath,
long copyFromRevision,
java.io.File movedFromAbsPath,
int flags)
Adds commit item with the path, kind, repository root URL, repository path, revision number,
copied from path, copied from revision number, flags to the commit packet.
|
SvnCommitItem |
addItem(java.io.File path,
SVNURL rootUrl,
SVNNodeKind kind,
SVNURL url,
long revision,
SVNURL copyFromUrl,
long copyFromRevision,
int flags)
Adds commit item with the path, repository root URL, kind, URL, revision number,
revision number, copied from path, copied from revision number, flags to the commit packet.
|
void |
addItem(SvnCommitItem item,
SVNURL repositoryRoot)
Adds commit item to the commit packet with the repository root URL.
|
void |
dispose()
Disposes the commit packet, if commit runner is set method calls
ISvnCommitRunner#disposeCommitPacket(Object) with the commit packet |
SvnCommitItem |
getItem(java.io.File path)
Returns the commit item with the path
|
private java.lang.String |
getItemKey(SvnCommitItem item,
SVNURL rootURL,
boolean combinePackets) |
java.util.Collection<SvnCommitItem> |
getItems(SVNURL url)
Returns all commit items in the commit packet with the corresponding repository root URL
|
java.lang.Object |
getLockingContext()
Returns commit packet's locking context.
|
java.util.Map<SVNURL,java.lang.String> |
getLockTokens()
Returns all lock tokens of commit packet.
|
java.util.Collection<SVNURL> |
getRepositoryRoots()
Returns all unique repository root URLs of all commit items in the commit packet
|
ISvnCommitRunner |
getRunner()
Returns commit packet's runner.
|
boolean |
hasItem(java.io.File path)
Tests if the commit packet contains the commit item with the path
|
boolean |
isEmpty()
Tests whether the commit packet has commit items.
|
boolean |
isEmpty(SVNURL repositoryRootUrl)
Tests whether the commit packet has commit items with the repository root URL.
|
boolean |
isItemSkipped(java.io.File file) |
boolean |
isLastPacket() |
SvnCommitPacket |
removeSkippedItems() |
void |
setItemSkipped(java.io.File file,
boolean skipped) |
void |
setLockingContext(ISvnCommitRunner commitRunner,
java.lang.Object context) |
void |
setLockTokens(java.util.Map<SVNURL,java.lang.String> lockTokens)
Sets commit packet's lock tokens, containing the information about locks within commit packet URLs.
|
(package private) SvnCommitPacket[] |
split(boolean combinePackets) |
private java.util.Map<SVNURL,java.util.Collection<SvnCommitItem>> items
private java.util.Map<java.lang.String,SvnCommitItem> itemsByPath
private java.lang.Object lockingContext
private ISvnCommitRunner runner
private java.util.Map<SVNURL,java.lang.String> lockTokens
private java.util.Set<java.lang.String> skippedPaths
private java.util.concurrent.atomic.AtomicInteger sharedIndex
public SvnCommitPacket()
private SvnCommitPacket(java.util.Map<SVNURL,java.util.Collection<SvnCommitItem>> items, java.util.Map<java.lang.String,SvnCommitItem> itemsByPath, java.lang.Object lockingContext, java.util.Map<SVNURL,java.lang.String> lockTokens, ISvnCommitRunner runner, java.util.Set<java.lang.String> skippedPaths)
public boolean hasItem(java.io.File path)
path
- the path of the commit item to testtrue
if commit item with the path is contained in the commit packet, otherwise false
public SvnCommitItem getItem(java.io.File path)
path
- the path of the commit itempublic java.util.Collection<SVNURL> getRepositoryRoots()
public java.util.Collection<SvnCommitItem> getItems(SVNURL url)
public void addItem(SvnCommitItem item, SVNURL repositoryRoot)
item
- commit itemrepositoryRoot
- repository root URLpublic SvnCommitItem addItem(java.io.File path, SVNNodeKind kind, SVNURL repositoryRoot, java.lang.String repositoryPath, long revision, java.lang.String copyFromPath, long copyFromRevision, java.io.File movedFromAbsPath, int flags) throws SVNException
path
- path of the commit itemkind
- node kind of the commit itemrepositoryRoot
- repository root URL of the commit itemrepositoryPath
- repository path of the commit itemrevision
- revision number of the commit itemcopyFromPath
- path from those commit item was copiedcopyFromRevision
- revision of the repository item from those commit item was copiedflags
- commit item flagsSVNException
- if URL parse error occurredpublic SvnCommitItem addItem(java.io.File path, SVNURL rootUrl, SVNNodeKind kind, SVNURL url, long revision, SVNURL copyFromUrl, long copyFromRevision, int flags) throws SVNException
path
- path of the commit itemrootUrl
- repository root URL of the commit itemkind
- node kind of the commit itemurl
- repository URL of the commit itemrevision
- revision number of the commit itemcopyFromUrl
- url from those commit item was copiedcopyFromRevision
- revision of the repository item from those commit item was copiedflags
- commit item flagsSVNException
- if URL parse error occurredpublic void setLockingContext(ISvnCommitRunner commitRunner, java.lang.Object context)
commitRunner
- context
- public void dispose() throws SVNException
ISvnCommitRunner#disposeCommitPacket(Object)
with the commit packetSVNException
public void setLockTokens(java.util.Map<SVNURL,java.lang.String> lockTokens)
lockTokens
- hash of URL, lock tokens for this URLpublic java.util.Map<SVNURL,java.lang.String> getLockTokens()
public boolean isEmpty()
true
if the commit packet has no commit items, otherwise false
public boolean isEmpty(SVNURL repositoryRootUrl)
true
if the commit packet has no commit items with the repository root, otherwise false
public java.lang.Object getLockingContext()
public ISvnCommitRunner getRunner()
public void setItemSkipped(java.io.File file, boolean skipped)
public boolean isItemSkipped(java.io.File file)
public SvnCommitPacket removeSkippedItems()
SvnCommitPacket[] split(boolean combinePackets) throws SVNException
SVNException
private java.lang.String getItemKey(SvnCommitItem item, SVNURL rootURL, boolean combinePackets) throws SVNException
SVNException
public boolean isLastPacket()