Package org.tmatesoft.svn.core.wc2
Class SvnOperationFactory
java.lang.Object
org.tmatesoft.svn.core.wc2.SvnOperationFactory
- All Implemented Interfaces:
ISvnOperationOptionsProvider
Represents factory for the Svn* operations.
Contains corresponding create*() methods for all supported operations.
Provides operation options by implementing
ISvnOperationOptionsProvider interface.
Handles working copy access and provides access to it getWcContext(), isAutoCloseContext().
Has set of working copy utility methods: getWorkingCopyRoot(File, boolean), isWorkingCopyRoot(File),
isVersionedDirectory(File), detectWcGeneration(File, boolean),
setPrimaryWcGeneration(SvnWcGeneration), isPrimaryWcGenerationOnly()- Version:
- 1.7
- Author:
- TMate Software Ltd.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates operation factory and initializes it with emptycontext.SvnOperationFactory(org.tmatesoft.svn.core.internal.wc17.SVNWCContext context) Creates operation factory and initializes it withcontext. -
Method Summary
Modifier and TypeMethodDescriptionCreates annotate operation.Creates canonicalize URLs operation.Creates cat operation.Creates checkout operation.Creates cleanup operation.Creates commit operation.Creates copy operation.Creates diff operation.Creates diff summarize operation.Creates export operation.Creates get changelist paths operation.Creates get info operation.Creates get merge info operation.Creates get properties operation.Creates operation for retrieving file size from the repositoryCreates get status operation.Creates get status summary operation.Creates import operation.Creates list operation.Creates log operation.Creates log merge info operation.Creates mark replaced operation.Creates merge operation.Creates remote make directory operation.Creates patch operation.Creates relocate operation.Creates remote copy operation.Creates remote delete operation.Creates remote make directory operation.Creates remote set property operation.Creates copy revision properties synchronization operation.Creates repository create administrative operation.Creates repository dump administrative operation.Creates dumpfilter operation.Creates operation for retrieving author from the repository.Creates operation for retrieving file contents from the repository.Creates operation for retrieving changed paths from the repository.Creates operation for retrieving changed directories from the repository.Creates operation for retrieving date from the repository.Creates repository diff operation.Creates operation for retrieving the history from the repository.Creates operation for retrieving info from the repository.Creates operation for retrieving the lock from the repository.Creates operation for retrieving repository log.Creates operation for retrieving properties from the repository.Creates operation for retrieving property from the repository.Creates operation for retrieving revision properties from the repository.Creates operation for retrieving revision property from the repository.Creates operation for retrieving items tree from the repository.Creates operation for retrieving repository UUID.Creates operation for retrieving the latest revision from the repository.Creates repository hot copy administrative operation.Creates initialize synchronization operation.Creates administrative operation for retrieving list of locks from the repository.Creates administrative operation for retrieving list of transactions from the repository.Creates repository load administrative operation.Creates repository pack administrative operation.Creates repository recover administrative operation.Creates repository remove locks administrative operation.Creates repository remove transactions administrative operation.Creates repository set UUID administrative operation.Creates repository synchronize operation.Creates operation for retrieving repository synchronization info.Creates repository upgrade administrative operation.Creates repository verify administrative operation.Creates resolve operation.Creates revert operation.Creates add operation.Creates delete operation.Creates set changelist operation.Creates set lock operation.Creates set property operation.Creates suggest merge sources operation.Creates switch operation.Creates unlock operation.Creates update operation.Creates upgrade operation.static org.tmatesoft.svn.core.internal.wc2.SvnWcGenerationdetectWcGeneration(File path, boolean climbUp) Detects working copy generation (1.6 or 1.7 format) by the working copy path.static org.tmatesoft.svn.core.internal.wc2.SvnWcGenerationdetectWcGeneration(File path, boolean climbUp, boolean isAdditionMode) Detects working copy generation (1.6 or 1.7 format) by the working copy path in (not in) the addition mode.voiddispose()Disposes context and repository pool if needed.Gets operation's authentication manager.Gets the cancel handler of the operation.Gets the event handler for the operation.protected ISvnOperationRunner<?,SvnOperation<?>> getImplementation(SvnOperation<?> operation) Get a callback that is called before and after each operationGets operation's options.org.tmatesoft.svn.core.internal.wc2.SvnWcGenerationReturns primary (default) working copy generation.Gets the pool of repositories.org.tmatesoft.svn.core.internal.wc2.SvnWcGenerationReturns secondary working copy generation.org.tmatesoft.svn.core.internal.wc17.SVNWCContextReturns working copy context.static FilegetWorkingCopyRoot(File versionedDir, boolean stopOnExternals) Searches working copy root path by the versioned directory.booleanbooleanReturns whether to dispose context when operation finishes.booleanReturns whether the operations should work only on primary working copy generation (for example only on SVN 1.7 working copy) or on both primary and secondary generations.static booleanisVersionedDirectory(File directory) Detects whether the directory is versioned directory.static booleanisVersionedDirectory(File directory, boolean isAdditionMode) Detects whether the directory is versioned directory in or (not in) the addition mode.booleanstatic booleanisWorkingCopyRoot(File versionedDir) Detects whether the versioned directory is working copy root.protected voidregisterOperationRunner(Class<?> operationClass, ISvnOperationRunner<?, ? extends SvnOperation<?>> runner) protected Objectrun(SvnOperation<?> operation) voidsetAuthenticationManager(ISVNAuthenticationManager authenticationManager) Sets operation's authentication manager.voidsetAutoCloseContext(boolean autoCloseContext) Sets whether to dispose context when operation finishes.voidsetAutoDisposeRepositoryPool(boolean dispose) Sets whether to dispose repository pool ondispose()call.voidsetCanceller(ISVNCanceller canceller) Sets the cancel handler of the operation.voidsetEventHandler(ISVNEventHandler eventHandler) Sets the event handler for the operation.voidsetOperationHandler(ISvnOperationHandler operationHandler) Sets a callback that is called before and after each operationvoidsetOptions(ISVNOptions options) Sets operation's options and disposes working copy context.voidsetPrimaryWcGeneration(org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration primaryWcGeneration) (Re)sets primary (default) working copy generation.voidsetRepositoryPool(ISVNRepositoryPool repositoryPool) Sets pool of repositories.voidsetWcGenerationSticky(boolean isWcGenerationSticky) When set to true, first encountered working copy generation becomes 'sticky' for this instance ofSvnOperationFactoryand no working copy format detection will be performed for subsequent operation.
-
Constructor Details
-
SvnOperationFactory
public SvnOperationFactory()Creates operation factory and initializes it with emptycontext. -
SvnOperationFactory
public SvnOperationFactory(org.tmatesoft.svn.core.internal.wc17.SVNWCContext context) Creates operation factory and initializes it withcontext. Ifcontextis set, retrieves itsoptionsandeventHandlerand setsautoCloseContexttofalse, otherwise setsautoCloseContexttotrue.- Parameters:
context- operation's context
-
-
Method Details
-
isAutoCloseContext
public boolean isAutoCloseContext()Returns whether to dispose context when operation finishes.- Returns:
trueif the context should be disposed, otherwisefalse
-
setAutoCloseContext
public void setAutoCloseContext(boolean autoCloseContext) Sets whether to dispose context when operation finishes.- Parameters:
autoCloseContext-trueif the context should be disposed, otherwisefalse
-
getAuthenticationManager
Gets operation's authentication manager. If not set, creates default authentication manager.- Specified by:
getAuthenticationManagerin interfaceISvnOperationOptionsProvider- Returns:
- authentication manager
-
getCanceller
Gets the cancel handler of the operation. If client'scanceleris not set, returnseventHandleras a canceler.- Specified by:
getCancellerin interfaceISvnOperationOptionsProvider- Returns:
- cancel handler
-
getEventHandler
Gets the event handler for the operation. This event handler will be dispatchedSVNEventobjects to provide detailed information about actions and progress state of version control operations. IfwcContextis set, returnsSVNWCContext.getEventHandler()- Specified by:
getEventHandlerin interfaceISvnOperationOptionsProvider- Returns:
- handler for events
- See Also:
-
getOperationHandler
Get a callback that is called before and after each operation- Returns:
- a callback that is called before and after each operation
-
getRepositoryPool
Gets the pool of repositories. If pool is not created, createsDefaultSVNRepositoryPoolwith the authentication manager, options, andautoDisposeRepositoryPool=true.- Specified by:
getRepositoryPoolin interfaceISvnOperationOptionsProvider- Returns:
- pool of repositories
-
getOptions
Gets operation's options. If options are not set, creates default readonly options.- Specified by:
getOptionsin interfaceISvnOperationOptionsProvider- Returns:
- options of the operation
-
setAuthenticationManager
Sets operation's authentication manager. IfrepositoryPoolis set, set its authentication manager to this value.- Parameters:
authenticationManager- authentication manager
-
setCanceller
Sets the cancel handler of the operation.- Parameters:
canceller- cancel handler
-
setEventHandler
Sets the event handler for the operation. This event handler will be dispatchedSVNEventobjects to provide detailed information about actions and progress state of version control operations. IfwcContextis set, sets its event handler to this one. IfwcContextis not set, disposes it.- Parameters:
eventHandler- handler for events- See Also:
-
setOptions
Sets operation's options and disposes working copy context.- Parameters:
options- options of the operation
-
setRepositoryPool
Sets pool of repositories. IfrepositoryPoolis notnullsetsautoDisposeRepositoryPooltofalse, otherwise totrue- Parameters:
repositoryPool- pool of repositories
-
setOperationHandler
Sets a callback that is called before and after each operation- Parameters:
operationHandler- callback to call before and after operation
-
dispose
public void dispose()Disposes context and repository pool if needed. -
createAnnotate
Creates annotate operation.- Returns:
- new
SvnAnnotateobject
-
createCat
Creates cat operation.- Returns:
- new
SvnCatobject
-
createImport
Creates import operation.- Returns:
- new
SvnImportobject
-
createCopy
Creates copy operation.- Returns:
- new
SvnCatobject
-
createRemoteCopy
Creates remote copy operation.- Returns:
- new
SvnRemoteCopyobject
-
createRemoteMkDir
Creates remote make directory operation.- Returns:
- new
SvnRemoteMkDirobject
-
createRemoteSetProperty
Creates remote set property operation.- Returns:
- new
SvnRemoteSetPropertyobject
-
createSetChangelist
Creates set changelist operation.- Returns:
- new
SvnSetChangelistobject
-
createGetChangelistPaths
Creates get changelist paths operation.- Returns:
- new
SvnGetChangelistPathsobject
-
createSetLock
Creates set lock operation.- Returns:
- new
SvnSetLockobject
-
createUnlock
Creates unlock operation.- Returns:
- new
SvnUnlockobject
-
createUpgrade
Creates upgrade operation.- Returns:
- new
SvnUpgradeobject
-
createGetInfo
Creates get info operation.- Returns:
- new
SvnGetInfoobject
-
createGetProperties
Creates get properties operation.- Returns:
- new
SvnGetPropertiesobject
-
createGetStatus
Creates get status operation.- Returns:
- new
SvnGetStatusobject
-
createUpdate
Creates update operation.- Returns:
- new
SvnUpdateobject
-
createSwitch
Creates switch operation.- Returns:
- new
SvnSwitchobject
-
createCheckout
Creates checkout operation.- Returns:
- new
SvnCheckoutobject
-
createRelocate
Creates relocate operation.- Returns:
- new
SvnRelocateobject
-
createExport
Creates export operation.- Returns:
- new
SvnExportobject
-
createScheduleForAddition
Creates add operation.- Returns:
- new
SvnScheduleForAdditionobject
-
createCommit
Creates commit operation.- Returns:
- new
SvnCommitobject
-
createScheduleForRemoval
Creates delete operation.- Returns:
- new
SvnScheduleForRemovalobject
-
createMarkReplaced
Creates mark replaced operation.- Returns:
- new
SvnMarkReplacedobject
-
createRevert
Creates revert operation.- Returns:
- new
SvnRevertobject
-
createSetProperty
Creates set property operation.- Returns:
- new
SvnSetPropertyobject
-
createLog
Creates log operation.- Returns:
- new
SvnLogobject
-
createMkDir
Creates remote make directory operation.- Returns:
- new
SvnRemoteMkDirobject
-
createRemoteDelete
Creates remote delete operation.- Returns:
- new
SvnRemoteDeleteobject
-
createMerge
Creates merge operation.- Returns:
- new
SvnMergeobject
-
createDiff
Creates diff operation.- Returns:
- new
SvnDiffobject
-
createPatch
Creates patch operation.- Returns:
- new
SvnPatchobject
-
createDiffSummarize
Creates diff summarize operation.- Returns:
- new
SvnDiffSummarizeobject
-
createSuggestMergeSources
Creates suggest merge sources operation.- Returns:
- new
SvnSuggestMergeSourcesobject
-
createGetMergeInfo
Creates get merge info operation.- Returns:
- new
SvnGetMergeInfoobject
-
createLogMergeInfo
Creates log merge info operation.- Returns:
- new
SvnLogMergeInfoobject
-
createResolve
Creates resolve operation.- Returns:
- new
SvnResolveobject
-
createCleanup
Creates cleanup operation.- Returns:
- new
SvnCleanupobject
-
createList
Creates list operation.- Returns:
- new
SvnListobject
-
createCanonicalizeUrls
Creates canonicalize URLs operation.- Returns:
- new
SvnCanonicalizeUrlsobject
-
createRepositoryDump
Creates repository dump administrative operation.- Returns:
- new
SvnRepositoryDumpobject
-
createRepositoryCreate
Creates repository create administrative operation.- Returns:
- new
SvnRepositoryCreateobject
-
createRepositoryHotCopy
Creates repository hot copy administrative operation.- Returns:
- new
SvnRepositoryHotCopyobject
-
createRepositoryLoad
Creates repository load administrative operation.- Returns:
- new
SvnRepositoryLoadobject
-
createRepositoryListLocks
Creates administrative operation for retrieving list of locks from the repository.- Returns:
- new
SvnRepositoryListLocksobject
-
createRepositoryListTransactions
Creates administrative operation for retrieving list of transactions from the repository.- Returns:
- new
SvnRepositoryListTransactionsobject
-
createRepositoryPack
Creates repository pack administrative operation.- Returns:
- new
SvnRepositoryPackobject
-
createRepositoryRecover
Creates repository recover administrative operation.- Returns:
- new
SvnRepositoryRecoverobject
-
createRepositoryRemoveLocks
Creates repository remove locks administrative operation.- Returns:
- new
SvnRepositoryRemoveLocksobject
-
createRepositoryRemoveTransactions
Creates repository remove transactions administrative operation.- Returns:
- new
SvnRepositoryRemoveTransactionsobject
-
createRepositorySetUUID
Creates repository set UUID administrative operation.- Returns:
- new
SvnRepositorySetUUIDobject
-
createRepositoryUpgrade
Creates repository upgrade administrative operation.- Returns:
- new
SvnRepositoryUpgradeobject
-
createRepositoryVerify
Creates repository verify administrative operation.- Returns:
- new
SvnRepositoryVerifyobject
-
createRepositoryInitialize
Creates initialize synchronization operation.- Returns:
- new
SvnRepositoryInitializeobject
-
createRepositorySyncInfo
Creates operation for retrieving repository synchronization info.- Returns:
- new
SvnRepositorySyncInfoobject
-
createRepositoryCopyRevisionProperties
Creates copy revision properties synchronization operation.- Returns:
- new
SvnRepositoryCopyRevisionPropertiesobject
-
createRepositorySynchronize
Creates repository synchronize operation.- Returns:
- new
SvnRepositorySynchronizeobject
-
createRepositoryFilter
Creates dumpfilter operation.- Returns:
- new
SvnRepositoryFilterobject
-
createRepositoryGetAuthor
Creates operation for retrieving author from the repository.- Returns:
- new
SvnRepositoryGetAuthorobject
-
createRepositoryGetDate
Creates operation for retrieving date from the repository.- Returns:
- new
SvnRepositoryGetDateobject
-
createRepositoryGetInfo
Creates operation for retrieving info from the repository.- Returns:
- new
SvnRepositoryGetInfoobject
-
createRepositoryGetLock
Creates operation for retrieving the lock from the repository.- Returns:
- new
SvnRepositoryGetLockobject
-
createRepositoryGetLog
Creates operation for retrieving repository log.- Returns:
- new
SvnRepositoryGetLogobject
-
createRepositoryGetUUID
Creates operation for retrieving repository UUID.- Returns:
- new
SvnRepositoryGetUUIDobject
-
createRepositoryGetYoungest
Creates operation for retrieving the latest revision from the repository.- Returns:
- new
SvnRepositoryGetYoungestobject
-
createRepositoryGetProperty
Creates operation for retrieving property from the repository.- Returns:
- new
SvnRepositoryGetPropertyobject
-
createRepositoryGetRevisionProperty
Creates operation for retrieving revision property from the repository.- Returns:
- new
SvnRepositoryGetRevisionPropertyobject
-
createRepositoryGetProperties
Creates operation for retrieving properties from the repository.- Returns:
- new
SvnRepositoryGetPropertiesobject
-
createRepositoryGetCat
Creates operation for retrieving file contents from the repository.- Returns:
- new
SvnRepositoryCatobject
-
createRepositoryGetChanged
Creates operation for retrieving changed paths from the repository.- Returns:
- new
SvnRepositoryGetChangedobject
-
createRepositoryGetChangedDirectories
Creates operation for retrieving changed directories from the repository.- Returns:
- new
SvnRepositoryGetChangedDirectoriesobject
-
createRepositoryGetDiff
Creates repository diff operation.- Returns:
- new
SvnRepositoryGetDiffobject
-
createRepositoryGetHistory
Creates operation for retrieving the history from the repository.- Returns:
- new
SvnRepositoryGetHistoryobject
-
createRepositoryGetTree
Creates operation for retrieving items tree from the repository.- Returns:
- new
SvnRepositoryGetTreeobject
-
createRepositoryGetRevisionProperties
Creates operation for retrieving revision properties from the repository.- Returns:
- new
SvnRepositoryGetRevisionPropertiesobject
-
createGetRepositoryFileSize
Creates operation for retrieving file size from the repository- Returns:
- new
SvnRepositoryGetFileSizeobject
-
createGetStatusSummary
Creates get status summary operation.- Returns:
- new
SvnStatusSummaryobject
-
createSetWCDbVersion
-
setAutoDisposeRepositoryPool
public void setAutoDisposeRepositoryPool(boolean dispose) Sets whether to dispose repository pool ondispose()call. This flag has sense only ifrepositoryPoolfield is notnull. Otherwise the flag value can be overwritten bysetRepositoryPool(ISVNRepositoryPool)orgetRepositoryPool()calls.- Parameters:
dispose- whether to dispose repository pool ondispose()call
-
run
- Throws:
SVNException
-
getImplementation
protected ISvnOperationRunner<?,SvnOperation<?>> getImplementation(SvnOperation<?> operation) throws SVNException - Throws:
SVNException
-
isPrimaryWcGenerationOnly
public boolean isPrimaryWcGenerationOnly()Returns whether the operations should work only on primary working copy generation (for example only on SVN 1.7 working copy) or on both primary and secondary generations.- Returns:
trueoperations should work only on primary working copy generation, iffalseboth primary and secondary generations are supported
-
isAssertRefCount
public boolean isAssertRefCount() -
registerOperationRunner
protected void registerOperationRunner(Class<?> operationClass, ISvnOperationRunner<?, ? extends SvnOperation<?>> runner) -
isWorkingCopyRoot
Detects whether the versioned directory is working copy root.- Parameters:
versionedDir- directory to check- Returns:
trueif the directory is working copy root, otherwisefalse
-
isVersionedDirectory
Detects whether the directory is versioned directory.- Parameters:
directory- directory to check- Returns:
trueif the directory is versioned directory, otherwisefalse
-
isVersionedDirectory
Detects whether the directory is versioned directory in or (not in) the addition mode.- Parameters:
directory- directory to checkisAdditionMode-trueif it is addition mode, otherwisefalse- Returns:
trueif the directory is versioned directory, otherwisefalse
-
getWorkingCopyRoot
public static File getWorkingCopyRoot(File versionedDir, boolean stopOnExternals) throws SVNException Searches working copy root path by the versioned directory.- Parameters:
versionedDir- versioned directorystopOnExternals-trueif externals should not be searched, otherwisefalse- Returns:
- working copy root
- Throws:
SVNException
-
detectWcGeneration
public static org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration detectWcGeneration(File path, boolean climbUp) throws SVNException Detects working copy generation (1.6 or 1.7 format) by the working copy path. Recursively searches the by path's parents up to the root ifclimbUpistrue.- Parameters:
path- working copy pathclimbUp-trueif search recursively in path's parents, otherwisefalse- Returns:
- working copy generation
- Throws:
SVNException
-
detectWcGeneration
public static org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration detectWcGeneration(File path, boolean climbUp, boolean isAdditionMode) throws SVNException Detects working copy generation (1.6 or 1.7 format) by the working copy path in (not in) the addition mode. Recursively searches the by path's parents up to the root ifclimbUpistrue.- Parameters:
path- working copy pathclimbUp-trueif search recursively in path's parents, otherwisefalseisAdditionMode-trueif it is addition mode, otherwisefalse- Returns:
- working copy generation
- Throws:
SVNException
-
getWcContext
public org.tmatesoft.svn.core.internal.wc17.SVNWCContext getWcContext()Returns working copy context.- Returns:
- working copy context
-
getPrimaryWcGeneration
public org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration getPrimaryWcGeneration()Returns primary (default) working copy generation.- Returns:
- working copy generation
-
getSecondaryWcGeneration
public org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration getSecondaryWcGeneration()Returns secondary working copy generation.- Returns:
- working copy generation
-
setPrimaryWcGeneration
public void setPrimaryWcGeneration(org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration primaryWcGeneration) (Re)sets primary (default) working copy generation. IfprimaryWcGenerationis notnull, registers operations' runners.- Parameters:
primaryWcGeneration-
-
setWcGenerationSticky
public void setWcGenerationSticky(boolean isWcGenerationSticky) When set to true, first encountered working copy generation becomes 'sticky' for this instance ofSvnOperationFactoryand no working copy format detection will be performed for subsequent operation.- Parameters:
isWcGenerationSticky-
-
isWcGenerationSticky
public boolean isWcGenerationSticky()- Returns:
- true when this instance of
SvnOperationFactory - See Also:
-