Class StashObjectsReaderImpl
- java.lang.Object
-
- com.atlassian.confluence.impl.backuprestore.restore.stash.StashObjectsReaderImpl
-
- All Implemented Interfaces:
StashObjectsReader
public class StashObjectsReaderImpl extends Object implements 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
Constructors Constructor Description StashObjectsReaderImpl(StashObjectsWriter stashObjectsWriter, StashObjectsSerialiser stashObjectsSerialiser, File file)
StashObjectsReaderImpl(StashObjectsWriter stashObjectsWriter, StashObjectsSerialiser stashObjectsSerialiser, File file, IOFriendlyFunction<File,FileInputStream> fileInputStreamFunction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getNumberOfRetrievedObjects()
boolean
hasMoreRecords()
List<ImportedObjectV2>
readObjects(int numberOfObjects)
Reads objects from stash.
-
-
-
Constructor Detail
-
StashObjectsReaderImpl
public StashObjectsReaderImpl(StashObjectsWriter stashObjectsWriter, StashObjectsSerialiser stashObjectsSerialiser, File file)
-
StashObjectsReaderImpl
public StashObjectsReaderImpl(StashObjectsWriter stashObjectsWriter, StashObjectsSerialiser stashObjectsSerialiser, File file, IOFriendlyFunction<File,FileInputStream> fileInputStreamFunction)
-
-
Method Detail
-
readObjects
public List<ImportedObjectV2> readObjects(int numberOfObjects) throws BackupRestoreException
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.
-
-