Package org.tmatesoft.svn.core.wc2
Class SvnOperation<V>
java.lang.Object
org.tmatesoft.svn.core.wc2.SvnOperation<V>
- Type Parameters:
V
- type of returning value inrun()
method
- All Implemented Interfaces:
ISvnOperationOptionsProvider
- Direct Known Subclasses:
AbstractSvnUpdate
,SvnCanonicalizeUrls
,SvnCat
,SvnCleanup
,SvnCopy
,SvnDiff
,SvnGetMergeInfo
,SvnGetStatusSummary
,SvnMarkReplaced
,SvnMerge
,SvnPatch
,SvnReceivingOperation
,SvnRelocate
,SvnRepositoryOperation
,SvnRepositorySyncInfo
,SvnResolve
,SvnRevert
,SvnScheduleForAddition
,SvnScheduleForRemoval
,SvnSetChangelist
,SvnSetWCDbVersion
,SvnSuggestMergeSources
,SvnUpgrade
Base class for all Svn* operations.
Encapsulates mostly used parameters, operation state, different methods used by implementations.
Those parameters includes:
- operation's target(s)
- operation's revision
- operation's depth
- operation's changelists
- whether to sleep after operation fails
- base implementation of
run
method, starts the operation execution - methods for access to the factory that created the object and its options, event handler, canceler
- variety of methods for getting, setting, recognition operation's targets
- cancel the operation
- access to the authentication manager
- Version:
- 1.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Collection<String>
private SVNDepth
private boolean
private boolean
private SvnOperationFactory
private SVNRevision
private org.tmatesoft.sqljet.core.internal.SqlJetPagerJournalMode
private Collection<SvnTarget>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds one target to the operation's targets.void
cancel()
Cancels the operation.protected void
protected void
protected void
Gets changelists to operate only on members of.Gets operation's authentication manager, provided bySvnOperationFactory.getAuthenticationManager()
.Gets the cancel handler of the operation, provided bySvnOperationFactory.getCanceller()
.getDepth()
Gets the limit of the operation by depth.Gets the event handler for the operation, provided bySvnOperationFactory.getEventHandler()
.Returns first target of the operation.protected int
protected int
protected File
Gets the factory that created the operation.Gets operation's options, provided bySvnOperationFactory.getOptions()
.Gets the operation's pool of repositories, provided bySvnOperationFactory.getRepositoryPool()
.Gets revision to operate on.org.tmatesoft.sqljet.core.internal.SqlJetPagerJournalMode
Returns all targets of the operation.boolean
Analyzes the targets and returns whether or not operation has at least one file in targets.boolean
Gets whether or not the operation has local targets.boolean
Gets whether or not the operation has remote targets.protected void
boolean
Gets whether or not the operation is cancelled.boolean
Gets whether the operation changes working copyboolean
Gets whether or not the operation should sleep after if fails.boolean
Gets whether or not to use parent working copy format.protected boolean
run()
Executes the operation.void
setApplicalbeChangelists
(Collection<String> changelists) Sets changelists to operate only on members of.void
Sets the limit of the operation by depth.void
setRevision
(SVNRevision revision) Sets revision of the operation.void
setSingleTarget
(SvnTarget target) Sets one target of the operation.void
setSleepForTimestamp
(boolean isSleepForTimestamp) Sets whether or not the operation should sleep after if fails.void
setSqliteJournalMode
(org.tmatesoft.sqljet.core.internal.SqlJetPagerJournalMode journalMode)
-
Field Details
-
depth
-
targets
-
revision
-
changelists
-
operationFactory
-
isSleepForTimestamp
private boolean isSleepForTimestamp -
sqliteJournalMode
private org.tmatesoft.sqljet.core.internal.SqlJetPagerJournalMode sqliteJournalMode -
isCancelled
private volatile boolean isCancelled
-
-
Constructor Details
-
SvnOperation
-
-
Method Details
-
getEventHandler
Gets the event handler for the operation, provided bySvnOperationFactory.getEventHandler()
. This event handler will be dispatchedSVNEvent
objects to provide detailed information about actions and progress state of version control operations performed byrun()
method ofSVN*
operation classes.- Specified by:
getEventHandler
in interfaceISvnOperationOptionsProvider
- Returns:
- handler for events
- See Also:
-
getOptions
Gets operation's options, provided bySvnOperationFactory.getOptions()
.- Specified by:
getOptions
in interfaceISvnOperationOptionsProvider
- Returns:
- options of the operation
-
initDefaults
protected void initDefaults() -
setSingleTarget
Sets one target of the operation.- Parameters:
target
- target of the operation- See Also:
-
addTarget
Adds one target to the operation's targets.- Parameters:
target
- target of the operation- See Also:
-
getTargets
Returns all targets of the operation.- Returns:
- targets of the operation
- See Also:
-
getFirstTarget
Returns first target of the operation.- Returns:
- first target of the operation
- See Also:
-
setDepth
Sets the limit of the operation by depth.- Parameters:
depth
- depth of the operation
-
getDepth
Gets the limit of the operation by depth.- Returns:
- depth of the operation
-
setRevision
Sets revision of the operation. In most cases if revision equalsSVNRevision.UNDEFINED
, the operation's revision will beSVNRevision.WORKING
if target(s) are local; it will be will beSVNRevision.HEAD
it targets are remote.- Parameters:
revision
- revision of the operation
-
getRevision
Gets revision to operate on.- Returns:
- revision of the operation
- See Also:
-
setApplicalbeChangelists
Sets changelists to operate only on members of.- Parameters:
changelists
- changelists of the operation
-
getApplicableChangelists
Gets changelists to operate only on members of.- Returns:
- changelists of the operation
-
getOperationFactory
Gets the factory that created the operation.- Returns:
- creation factory of the operations
-
hasLocalTargets
public boolean hasLocalTargets()Gets whether or not the operation has local targets.- Returns:
true
if the operation has local targets, otherwisefalse
-
hasRemoteTargets
public boolean hasRemoteTargets()Gets whether or not the operation has remote targets.- Returns:
true
if the operation has remote targets, otherwisefalse
-
ensureEnoughTargets
- Throws:
SVNException
-
getMinimumTargetsCount
protected int getMinimumTargetsCount() -
getMaximumTargetsCount
protected int getMaximumTargetsCount() -
cancel
public void cancel()Cancels the operation. Execution of operation will be stopped at the next point of checkingisCancelled
state. If canceler is set,ISVNCanceller.checkCancelled()
is called, otherwiseSVNCancelException
is raised at the point of checkingisCancelled
state. -
isCancelled
public boolean isCancelled()Gets whether or not the operation is cancelled.- Returns:
true
if the operation is cancelled, otherwisefalse
-
run
Executes the operation.- Returns:
- result depending on operation type
- Throws:
SVNException
-
ensureArgumentsAreValid
- Throws:
SVNException
-
needsHomohenousTargets
protected boolean needsHomohenousTargets() -
ensureHomohenousTargets
- Throws:
SVNException
-
getRepositoryPool
Gets the operation's pool of repositories, provided bySvnOperationFactory.getRepositoryPool()
.- Specified by:
getRepositoryPool
in interfaceISvnOperationOptionsProvider
- Returns:
- pool of repositories
-
getAuthenticationManager
Gets operation's authentication manager, provided bySvnOperationFactory.getAuthenticationManager()
.- Specified by:
getAuthenticationManager
in interfaceISvnOperationOptionsProvider
- Returns:
- authentication manager
-
getCanceller
Gets the cancel handler of the operation, provided bySvnOperationFactory.getCanceller()
.- Specified by:
getCanceller
in interfaceISvnOperationOptionsProvider
- Returns:
- cancel handler
- See Also:
-
isSleepForTimestamp
public boolean isSleepForTimestamp()Gets whether or not the operation should sleep after if fails.- Returns:
true
if the operation should sleep, otherwisefalse
- Since:
- 1.7
- See Also:
-
setSleepForTimestamp
public void setSleepForTimestamp(boolean isSleepForTimestamp) Sets whether or not the operation should sleep after if fails.- Parameters:
isSleepForTimestamp
-true
if the operation should sleep, otherwisefalse
- Since:
- 1.7
- See Also:
-
hasFileTargets
public boolean hasFileTargets()Analyzes the targets and returns whether or not operation has at least one file in targets.- Returns:
true
if operation has at least one file in targets, otherwisefalse
-
isUseParentWcFormat
public boolean isUseParentWcFormat()Gets whether or not to use parent working copy format.- Returns:
true
if parent working copy format should be used, otherwisefalse
-
isChangesWorkingCopy
public boolean isChangesWorkingCopy()Gets whether the operation changes working copy- Returns:
true
if the operation changes the working copy, otherwisefalse
-
getSqliteJournalMode
public org.tmatesoft.sqljet.core.internal.SqlJetPagerJournalMode getSqliteJournalMode() -
setSqliteJournalMode
public void setSqliteJournalMode(org.tmatesoft.sqljet.core.internal.SqlJetPagerJournalMode journalMode) -
getOperationalWorkingCopy
-