public class TagsMigrator extends AbstractRepositoryMigrator
Modifier and Type | Class and Description |
---|---|
protected static class |
TagsMigrator.Tag
A label + username.
|
AbstractRepositoryMigrator.MigrationShutdownException
Modifier and Type | Field and Description |
---|---|
protected static int |
BATCH_SIZE |
protected static String |
QUERY_TAGGING |
migrationContext
Constructor and Description |
---|
TagsMigrator() |
Modifier and Type | Method and Description |
---|---|
protected void |
addTags(CoreSession session,
String docId,
Set<TagsMigrator.Tag> tags) |
protected void |
addTags(DocumentModel doc,
Set<TagsMigrator.Tag> tags) |
protected void |
migrateSession(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.
|
checkShutdownRequested, migrateRepository, probeRepository, processBatched, reportProgress, reportProgress
protected static final String QUERY_TAGGING
protected static final int BATCH_SIZE
public TagsMigrator()
public void notifyStatusChange()
MigrationService.Migrator
public String probeState()
MigrationService.Migrator
Assumes no migration step is currently running.
THIS METHOD MAY TAKE A WHILE as it needs to get information from persistent storage.
null
if it cannot be determinedprotected String probeSession(CoreSession session)
probeSession
in class AbstractRepositoryMigrator
public void run(String step, MigrationService.MigrationContext migrationContext)
MigrationService.Migrator
This method should periodically check for MigrationService.MigrationContext.isShutdownRequested()
and
Thread.isInterrupted()
and return if true
.
step
- the migration step to runmigrationContext
- the migration context.protected void migrateSession(CoreSession session)
migrateSession
in class AbstractRepositoryMigrator
protected void removeDocument(CoreSession session, String docId)
protected void addTags(CoreSession session, String docId, Set<TagsMigrator.Tag> tags)
protected void addTags(DocumentModel doc, Set<TagsMigrator.Tag> tags)
Copyright © 2019 Nuxeo. All rights reserved.