Package db.buffers
Class ManagedBufferFileAdapter
java.lang.Object
db.buffers.BufferFileAdapter
db.buffers.ManagedBufferFileAdapter
- All Implemented Interfaces:
BufferFile,ManagedBufferFile
ManagedBufferFileAdapter provides a ManagedBufferFile implementation which
wraps a ManagedBufferFileHandle.-
Constructor Summary
ConstructorsConstructorDescriptionManagedBufferFileAdapter(ManagedBufferFileHandle remoteManagedBufferFile) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanSave()Returns true if a save file is provided for creating a new version of this buffer file.longReturns the checkin ID corresponding to this buffer file.byte[]getForwardModMapData(int oldVersion) Returns a bit map corresponding to all buffers modified since oldVersion.getNextChangeDataFile(boolean getFirst) Get the next change data file which corresponds to this buffer file.Returns a temporary change data buffer file which should be used to store a application-level ChangeSet associated with this new buffer file version.Returns a Save file if available.voidsaveCompleted(boolean commit) After getting the save file, this method must be invoked to terminate the save.voidsetVersionComment(String comment) Set the comment which will be associated with this buffer file if saved.Methods inherited from class db.buffers.BufferFileAdapter
clearParameters, close, delete, dispose, get, getBufferSize, getFreeIndexes, getIndexCount, getParameter, getParameterNames, isReadOnly, isRemote, put, setFreeIndexes, setParameter, setReadOnlyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface db.buffers.BufferFile
clearParameters, close, delete, dispose, get, getBufferSize, getFreeIndexes, getIndexCount, getParameter, getParameterNames, isReadOnly, put, setFreeIndexes, setParameter, setReadOnly
-
Constructor Details
-
ManagedBufferFileAdapter
Constructor.- Parameters:
remoteManagedBufferFile- remote buffer file handle
-
-
Method Details
-
getSaveFile
Description copied from interface:ManagedBufferFileReturns a Save file if available. Returns null if a save can not be performed. This method may block for an extended period of time if the pre-save process has not already completed. This method does not accept a monitor since a remote TaskMonitor does not yet exist.- Specified by:
getSaveFilein interfaceManagedBufferFile- Throws:
IOException- if an I/O error occurs
-
saveCompleted
Description copied from interface:ManagedBufferFileAfter getting the save file, this method must be invoked to terminate the save.- Specified by:
saveCompletedin interfaceManagedBufferFile- Parameters:
commit- if true the save file will be reopened as read-only for update. If false, the save file will be deleted and the object will become invalid.- Throws:
IOException
-
canSave
Description copied from interface:ManagedBufferFileReturns true if a save file is provided for creating a new version of this buffer file.- Specified by:
canSavein interfaceManagedBufferFile- Throws:
IOException- if an I/O error occurs- See Also:
-
setVersionComment
Description copied from interface:ManagedBufferFileSet the comment which will be associated with this buffer file if saved. The comment must be set prior to invoking close or setReadOnly.- Specified by:
setVersionCommentin interfaceManagedBufferFile- Parameters:
comment- comment text- Throws:
IOException- if an I/O error occurs
-
getNextChangeDataFile
Description copied from interface:ManagedBufferFileGet the next change data file which corresponds to this buffer file. This method acts like an iterator which each successive invocation returning the next available file. Null is returned when no more files are available. The invoker is responsible for closing each file returned. It is highly recommended that each file be closed prior to requesting the next file.- Specified by:
getNextChangeDataFilein interfaceManagedBufferFile- Parameters:
getFirst- causes the iterator to reset and return the first available file.- Throws:
IOException- if an I/O error occurs
-
getSaveChangeDataFile
Description copied from interface:ManagedBufferFileReturns a temporary change data buffer file which should be used to store a application-level ChangeSet associated with this new buffer file version. The getSaveFile method must be successfully invoked prior to invoking this method.- Specified by:
getSaveChangeDataFilein interfaceManagedBufferFile- Returns:
- change data file or null if one is not available.
- Throws:
IOException- if an I/O error occurs
-
getCheckinID
Description copied from interface:ManagedBufferFileReturns the checkin ID corresponding to this buffer file. The returned value is only valid if this buffer file has an associated buffer file manager and is either being created (see isReadOnly) or is intended for update (see canSave).- Specified by:
getCheckinIDin interfaceManagedBufferFile- Throws:
IOException- if an I/O error occurs
-
getForwardModMapData
Description copied from interface:ManagedBufferFileReturns a bit map corresponding to all buffers modified since oldVersion. This identifies all buffers contained within the oldVersion which have been modified during any revision up until this file version. Buffers added since oldVersion are not identified NOTE: The bit mask may identify empty/free buffers within this file version.- Specified by:
getForwardModMapDatain interfaceManagedBufferFile- Parameters:
oldVersion- indicates the older version of this file for which a change map will be returned. This method may only be invoked if this file is at version 2 or higher, has an associated BufferFileManager and the oldVersion related files still exist.- Returns:
- ModMap buffer change map data
- Throws:
IOException- if an I/O error occurs
-