Package org.nuxeo.ecm.platform.tag
Class TagsMigrator
- java.lang.Object
-
- org.nuxeo.ecm.core.migrator.AbstractRepositoryMigrator
-
- org.nuxeo.ecm.platform.tag.TagsMigrator
-
- All Implemented Interfaces:
MigrationService.Migrator
public class TagsMigrator extends AbstractRepositoryMigrator
Migrator of tags.- Since:
- 9.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
TagsMigrator.Tag
A label + username.-
Nested classes/interfaces inherited from class org.nuxeo.ecm.core.migrator.AbstractRepositoryMigrator
AbstractRepositoryMigrator.MigrationShutdownException
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
BATCH_SIZE
protected static String
QUERY_TAGGING
-
Fields inherited from class org.nuxeo.ecm.core.migrator.AbstractRepositoryMigrator
migrationContext
-
-
Constructor Summary
Constructors Constructor Description TagsMigrator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addTags(CoreSession session, String docId, Set<TagsMigrator.Tag> tags)
protected void
addTags(DocumentModel doc, Set<TagsMigrator.Tag> tags)
protected void
migrateSession(String step, MigrationService.MigrationContext migrationContext, CoreSession session)
void
notifyStatusChange()
Allows notification of status change for a running step or new state.protected String
probeSession(CoreSession session)
String
probeState()
Probes the current state of a migration by analyzing persistent data.protected void
removeDocument(CoreSession session, String docId)
void
run(String step, MigrationService.MigrationContext migrationContext)
Runs a migration step.-
Methods inherited from class org.nuxeo.ecm.core.migrator.AbstractRepositoryMigrator
checkShutdownRequested, checkShutdownRequested, migrateRepository, migrateRepository, migrateSession, probeRepository, processBatched, processBatched, reportProgress, reportProgress
-
-
-
-
Field Detail
-
QUERY_TAGGING
protected static final String QUERY_TAGGING
- See Also:
- Constant Field Values
-
BATCH_SIZE
protected static final int BATCH_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
notifyStatusChange
public void notifyStatusChange()
Description copied from interface:MigrationService.Migrator
Allows notification of status change for a running step or new state.
-
probeState
public String probeState()
Description copied from interface:MigrationService.Migrator
Probes the current state of a migration by analyzing persistent data.Assumes no migration step is currently running.
THIS METHOD MAY TAKE A WHILE as it needs to get information from persistent storage.
- Returns:
- the probed state, or
null
if it cannot be determined
-
probeSession
protected String probeSession(CoreSession session)
- Specified by:
probeSession
in classAbstractRepositoryMigrator
-
run
public void run(String step, MigrationService.MigrationContext migrationContext)
Description copied from interface:MigrationService.Migrator
Runs a migration step.This method should periodically check for
MigrationService.MigrationContext.isShutdownRequested()
andThread.isInterrupted()
and return iftrue
.- Parameters:
step
- the migration step to runmigrationContext
- the migration context.
-
migrateSession
protected void migrateSession(String step, MigrationService.MigrationContext migrationContext, CoreSession session)
- Specified by:
migrateSession
in classAbstractRepositoryMigrator
-
removeDocument
protected void removeDocument(CoreSession session, String docId)
-
addTags
protected void addTags(CoreSession session, String docId, Set<TagsMigrator.Tag> tags)
-
addTags
protected void addTags(DocumentModel doc, Set<TagsMigrator.Tag> tags)
-
-