Class SVNReplicationEditor
- java.lang.Object
-
- org.tmatesoft.svn.core.replicator.SVNReplicationEditor
-
- All Implemented Interfaces:
ISVNDeltaConsumer,ISVNEditor
public class SVNReplicationEditor extends java.lang.Object implements ISVNEditor
The SVNReplicationEditor is an editor implementation used by a repository replicator as a bridge between an update editor for the source repository and a commit editor of the target one. This editor is provided to an update method of a source SVNRepository driver to properly translate the calls of that driver to calls to a commit editor of the destination SVNRepository driver.- Since:
- 1.2
- Version:
- 1.3
- Author:
- TMate Software Ltd.
- See Also:
SVNRepository
-
-
Constructor Summary
Constructors Constructor Description SVNReplicationEditor(SVNRepository repository, ISVNEditor commitEditor, SVNLogEntry revision)Creates a new replication editor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabortEdit()Aborts the transaction.voidabsentDir(java.lang.String path)Does nothing.voidabsentFile(java.lang.String path)Does nothing.voidaddDir(java.lang.String path, java.lang.String copyFromPath, long copyFromRevision)Adds a new directory under the specifiedpathto the target repository.voidaddFile(java.lang.String path, java.lang.String copyFromPath, long copyFromRevision)Adds a new file.voidapplyTextDelta(java.lang.String path, java.lang.String baseChecksum)Starts applying text delta.voidchangeDirProperty(java.lang.String name, SVNPropertyValue value)Changes a property of the current directory.voidchangeFileProperty(java.lang.String path, java.lang.String name, SVNPropertyValue value)Changes file property.voidcloseDir()Closes the current opened dir.SVNCommitInfocloseEdit()Commits the transaction.voidcloseFile(java.lang.String path, java.lang.String textChecksum)Closes the current opened file.voiddeleteEntry(java.lang.String path, long revision)Removespathfrom the paths to be committed.SVNCommitInfogetCommitInfo()Returns commit information on the revision committed to the replication destination repository.voidopenDir(java.lang.String path, long revision)Opens a correspondingpathin the target repository.voidopenFile(java.lang.String path, long revision)Opens a file.voidopenRoot(long revision)Starts a next replication transaction.voidtargetRevision(long revision)Saves the targetrevision.java.io.OutputStreamtextDeltaChunk(java.lang.String path, SVNDiffWindow diffWindow)Applies a next chunk of delta.voidtextDeltaEnd(java.lang.String path)Handles text delta end.
-
-
-
Constructor Detail
-
SVNReplicationEditor
public SVNReplicationEditor(SVNRepository repository, ISVNEditor commitEditor, SVNLogEntry revision)
Creates a new replication editor.repositorymust be created for the root location of the source repository which is to be replicated.- Parameters:
repository- a source repositorycommitEditor- a commit editor received from the destination repository driver (which also must be point to the root location of the destination repository)revision- log information of the revision to be copied
-
-
Method Detail
-
targetRevision
public void targetRevision(long revision) throws SVNExceptionSaves the targetrevision.- Specified by:
targetRevisionin interfaceISVNEditor- Parameters:
revision- revision- Throws:
SVNException
-
openRoot
public void openRoot(long revision) throws SVNExceptionStarts a next replication transaction.- Specified by:
openRootin interfaceISVNEditor- Parameters:
revision- target revision- Throws:
SVNException
-
deleteEntry
public void deleteEntry(java.lang.String path, long revision) throws SVNExceptionRemovespathfrom the paths to be committed.- Specified by:
deleteEntryin interfaceISVNEditor- Parameters:
path-revision-- Throws:
SVNException- exception withSVNErrorCode.UNKNOWNerror code - if somehow chanded paths fetched from the log of the resource repository did not reflectpathdeletion inrevision
-
absentDir
public void absentDir(java.lang.String path) throws SVNExceptionDoes nothing.- Specified by:
absentDirin interfaceISVNEditor- Parameters:
path-- Throws:
SVNException
-
absentFile
public void absentFile(java.lang.String path) throws SVNExceptionDoes nothing.- Specified by:
absentFilein interfaceISVNEditor- Parameters:
path-- Throws:
SVNException
-
addDir
public void addDir(java.lang.String path, java.lang.String copyFromPath, long copyFromRevision) throws SVNExceptionAdds a new directory under the specifiedpathto the target repository.- Specified by:
addDirin interfaceISVNEditor- Parameters:
path- target directory pathcopyFromPath- not usedcopyFromRevision- not used- Throws:
SVNException- exception withSVNErrorCode.UNKNOWNerror code - if somehow chanded paths fetched from the log of the resource repository did not reflectpathaddition
-
openDir
public void openDir(java.lang.String path, long revision) throws SVNExceptionOpens a correspondingpathin the target repository.- Specified by:
openDirin interfaceISVNEditor- Parameters:
path- target directory path relative to the root of the editrevision- target directory revision- Throws:
SVNException
-
changeDirProperty
public void changeDirProperty(java.lang.String name, SVNPropertyValue value) throws SVNExceptionChanges a property of the current directory.- Specified by:
changeDirPropertyin interfaceISVNEditor- Parameters:
name-value-- Throws:
SVNException- See Also:
ISVNEditor.openDir(String, long)
-
closeDir
public void closeDir() throws SVNExceptionCloses the current opened dir.- Specified by:
closeDirin interfaceISVNEditor- Throws:
SVNException
-
addFile
public void addFile(java.lang.String path, java.lang.String copyFromPath, long copyFromRevision) throws SVNExceptionAdds a new file.- Specified by:
addFilein interfaceISVNEditor- Parameters:
path-copyFromPath-copyFromRevision-- Throws:
SVNException
-
openFile
public void openFile(java.lang.String path, long revision) throws SVNExceptionOpens a file.- Specified by:
openFilein interfaceISVNEditor- Parameters:
path-revision-- Throws:
SVNException
-
applyTextDelta
public void applyTextDelta(java.lang.String path, java.lang.String baseChecksum) throws SVNExceptionStarts applying text delta.- Specified by:
applyTextDeltain interfaceISVNDeltaConsumer- Parameters:
path-baseChecksum-- Throws:
SVNException
-
textDeltaChunk
public java.io.OutputStream textDeltaChunk(java.lang.String path, SVNDiffWindow diffWindow) throws SVNExceptionApplies a next chunk of delta.- Specified by:
textDeltaChunkin interfaceISVNDeltaConsumer- Parameters:
path-diffWindow-- Returns:
- dummy output stream
- Throws:
SVNException
-
textDeltaEnd
public void textDeltaEnd(java.lang.String path) throws SVNExceptionHandles text delta end.- Specified by:
textDeltaEndin interfaceISVNDeltaConsumer- Parameters:
path-- Throws:
SVNException
-
changeFileProperty
public void changeFileProperty(java.lang.String path, java.lang.String name, SVNPropertyValue value) throws SVNExceptionChanges file property.- Specified by:
changeFilePropertyin interfaceISVNEditor- Parameters:
path-name-value-- Throws:
SVNException
-
closeFile
public void closeFile(java.lang.String path, java.lang.String textChecksum) throws SVNExceptionCloses the current opened file.- Specified by:
closeFilein interfaceISVNEditor- Parameters:
path-textChecksum-- Throws:
SVNException
-
closeEdit
public SVNCommitInfo closeEdit() throws SVNException
Commits the transaction.- Specified by:
closeEditin interfaceISVNEditor- Returns:
- commit info
- Throws:
SVNException
-
abortEdit
public void abortEdit() throws SVNExceptionAborts the transaction.- Specified by:
abortEditin interfaceISVNEditor- Throws:
SVNException
-
getCommitInfo
public SVNCommitInfo getCommitInfo()
Returns commit information on the revision committed to the replication destination repository.- Returns:
- commit info (revision, author, date)
-
-