Class StashObjectsReaderImpl
java.lang.Object
com.atlassian.confluence.impl.backuprestore.restore.stash.StashObjectsReaderImpl
- All Implemented Interfaces:
StashObjectsReader
Implementation of StashObjectsReader that reads data from the file where each object is stored in the format:
- 4 bytes: object length (N)
- N bytes: object itself
- Since:
- 8.1.0
-
Constructor Summary
ConstructorDescriptionStashObjectsReaderImpl
(StashObjectsWriter stashObjectsWriter, StashObjectsSerialiser stashObjectsSerialiser, File file) StashObjectsReaderImpl
(StashObjectsWriter stashObjectsWriter, StashObjectsSerialiser stashObjectsSerialiser, File file, IOFriendlyFunction<File, FileInputStream> fileInputStreamFunction) -
Method Summary
Modifier and TypeMethodDescriptionlong
boolean
readObjects
(int numberOfObjects) Reads objects from stash.
-
Constructor Details
-
StashObjectsReaderImpl
public StashObjectsReaderImpl(StashObjectsWriter stashObjectsWriter, StashObjectsSerialiser stashObjectsSerialiser, File file) -
StashObjectsReaderImpl
public StashObjectsReaderImpl(StashObjectsWriter stashObjectsWriter, StashObjectsSerialiser stashObjectsSerialiser, File file, IOFriendlyFunction<File, FileInputStream> fileInputStreamFunction)
-
-
Method Details
-
readObjects
Description copied from interface:StashObjectsReader
Reads objects from stash.- Specified by:
readObjects
in interfaceStashObjectsReader
- Parameters:
numberOfObjects
- number of objects.- Returns:
- list of objects (can be fewer than numberOfObjects if there is not enough objects in the stash)
- Throws:
BackupRestoreException
-
getNumberOfRetrievedObjects
public long getNumberOfRetrievedObjects()- Specified by:
getNumberOfRetrievedObjects
in interfaceStashObjectsReader
- Returns:
- number of already retrieved objects.
-
hasMoreRecords
public boolean hasMoreRecords()- Specified by:
hasMoreRecords
in interfaceStashObjectsReader
- Returns:
- true if the end of stash is not reached.
-