Class ContentEntityDatabaseDataExporter
java.lang.Object
com.atlassian.confluence.impl.backuprestore.backup.exporters.ContentEntityDatabaseDataExporter
- All Implemented Interfaces:
Exporter
,Persister
,Subscriber
public class ContentEntityDatabaseDataExporter
extends Object
implements Persister, Exporter, Subscriber
Responsible for exporting all content entitity objects.
It starts with the current versions first and then continues with historical versions.
- Since:
- 7.20.0
-
Field Summary
-
Constructor Summary
ConstructorDescriptionContentEntityDatabaseDataExporter
(DatabaseExporterHelper databaseExporterHelper, boolean keepCollectionsForContentProperties, ContentPropertyDataExporter contentPropertyDataExporter, Converter databaseDataConverter, CommonPersister commonPersister) Creates an instance of content entity exporter. -
Method Summary
Modifier and TypeMethodDescriptionReturns default entity info for persister.getEntityInfo
(Class<?> exportedClass) Returns default entity info for the particular class.Collection<Class<?>>
Return a collection of entity classes that subscriber will monitor the object export events.void
onMonitoredObjectsExport
(Class<?> exportedClass, Collection<Object> idList) It is called when the collection of objects was exported.void
persistObjects
(Collection<Object> objectIds) Retrieve a list of EntityObjectReadyForExport from object IDs and persist retrieved records for backup file NOTED: in order to deal with multiple underlining datatype from different DBs we will need to useAbstractDatabaseDataConverter.convertToLong(Object)
to convert ID from Object to Long
-
Field Details
-
CONTENT_IDS
- See Also:
-
-
Constructor Details
-
ContentEntityDatabaseDataExporter
public ContentEntityDatabaseDataExporter(DatabaseExporterHelper databaseExporterHelper, boolean keepCollectionsForContentProperties, ContentPropertyDataExporter contentPropertyDataExporter, Converter databaseDataConverter, CommonPersister commonPersister) Creates an instance of content entity exporter.- Parameters:
databaseExporterHelper
- just helper containing set of useful functions allowing to retrieve data from the DB.keepCollectionsForContentProperties
- set to true when it has to generate data in legacy format (with a collection of references to Content Properties).contentPropertyDataExporter
- reference to content property exporter (used for legacy format only)
-
-
Method Details
-
getWatchingEntityClasses
Description copied from interface:Subscriber
Return a collection of entity classes that subscriber will monitor the object export events. This is called when DatabaseExporterHelper register subscribers for all exporters. See UseDatabaseExporterHelper.registerSubscriber(Subscriber)
- Specified by:
getWatchingEntityClasses
in interfaceSubscriber
-
getEntityInfo
Description copied from interface:Exporter
Returns default entity info for persister. Will fail if the persister has to work with multiple hibernate entitites.- Specified by:
getEntityInfo
in interfaceExporter
-
getEntityInfo
Description copied from interface:Exporter
Returns default entity info for the particular class.- Specified by:
getEntityInfo
in interfaceExporter
-
persistObjects
public void persistObjects(Collection<Object> objectIds) throws InterruptedException, BackupRestoreException Description copied from interface:Persister
Retrieve a list of EntityObjectReadyForExport from object IDs and persist retrieved records for backup file NOTED: in order to deal with multiple underlining datatype from different DBs we will need to useAbstractDatabaseDataConverter.convertToLong(Object)
to convert ID from Object to Long- Specified by:
persistObjects
in interfacePersister
- Throws:
InterruptedException
BackupRestoreException
-
onMonitoredObjectsExport
Description copied from interface:Subscriber
It is called when the collection of objects was exported. This is called only for objects that this class is watching. SeegetWatchingEntityClasses()
- Specified by:
onMonitoredObjectsExport
in interfaceSubscriber
- Parameters:
exportedClass
- the exported classidList
- the list of ids of exported objects
-