public class TagsRelationsToFacetsMigrator extends Object implements MigrationService.Migrator
Modifier and Type | Class and Description |
---|---|
protected static class |
TagsRelationsToFacetsMigrator.MigrationShutdownException |
protected static class |
TagsRelationsToFacetsMigrator.Tag
A label + username.
|
Modifier and Type | Field and Description |
---|---|
protected static int |
BATCH_SIZE |
protected MigrationService.MigrationContext |
migrationContext |
Constructor and Description |
---|
TagsRelationsToFacetsMigrator() |
Modifier and Type | Method and Description |
---|---|
protected void |
addTags(CoreSession session,
String docId,
Set<TagsRelationsToFacetsMigrator.Tag> tags) |
protected void |
addTags(DocumentModel doc,
Set<TagsRelationsToFacetsMigrator.Tag> tags) |
protected void |
checkShutdownRequested() |
protected void |
migrateRepository(String repositoryName) |
protected void |
migrateSession(CoreSession session) |
protected <T> void |
processBatched(Collection<T> collection,
Consumer<T> consumer,
String progressMessage)
Runs a consumer on the collection, committing every BATCH_SIZE elements, reporting progress and checking for
shutdown request.
|
protected void |
removeDocument(CoreSession session,
String docId) |
protected void |
reportProgress(String message,
long num,
long total) |
void |
run(MigrationService.MigrationContext migrationContext)
Runs the migration.
|
protected static final int BATCH_SIZE
protected MigrationService.MigrationContext migrationContext
public TagsRelationsToFacetsMigrator()
public void run(MigrationService.MigrationContext migrationContext)
MigrationService.Migrator
This method should periodically check for MigrationService.MigrationContext.isShutdownRequested()
and
Thread.isInterrupted()
and return if true
.
run
in interface MigrationService.Migrator
migrationContext
- the migration context.protected void checkShutdownRequested()
protected void reportProgress(String message, long num, long total)
protected void migrateRepository(String repositoryName)
protected void migrateSession(CoreSession session)
protected void removeDocument(CoreSession session, String docId)
protected void addTags(CoreSession session, String docId, Set<TagsRelationsToFacetsMigrator.Tag> tags)
protected void addTags(DocumentModel doc, Set<TagsRelationsToFacetsMigrator.Tag> tags)
protected <T> void processBatched(Collection<T> collection, Consumer<T> consumer, String progressMessage)
Copyright © 2018 Nuxeo. All rights reserved.