Class CommentsMigrator
- java.lang.Object
-
- org.nuxeo.ecm.core.migrator.AbstractRepositoryMigrator
-
- org.nuxeo.ecm.platform.comment.impl.CommentsMigrator
-
- All Implemented Interfaces:
MigrationService.Migrator
public class CommentsMigrator extends AbstractRepositoryMigrator
Migrator of comments.- Since:
- 10.3
-
-
Nested Class Summary
-
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
static String
GET_COMMENTS_FOLDERS_QUERY
static String
UNMIGRATED_COMMENTS_FOLDER_NAME
-
Fields inherited from class org.nuxeo.ecm.core.migrator.AbstractRepositoryMigrator
migrationContext
-
-
Constructor Summary
Constructors Constructor Description CommentsMigrator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
buildInClause(List<String> parentIds)
protected List<String>
getCommentFolders(CoreSession session)
protected List<String>
getUnsecuredCommentIds(CoreSession session)
protected boolean
hasUnsecuredComments(CoreSession session)
protected void
migrateCommentsFromPropertyToSecured(CoreSession session, TreeCommentManager treeCommentManager, IdRef commentIdRef)
protected void
migrateCommentsFromRelationToProperty(CoreSession session, RelationManager relationManager, CommentServiceConfig config, Statement statement)
protected void
migrateSession(String step, MigrationService.MigrationContext migrationContext, CoreSession session)
protected void
migrateSessionPropertyToSecured(CoreSession session, MigrationService.MigrationContext migrationContext)
protected void
migrateSessionRelationToProperty(CoreSession session, MigrationService.MigrationContext migrationContext)
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.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
-
BATCH_SIZE
protected static final int BATCH_SIZE
- See Also:
- Constant Field Values
-
UNMIGRATED_COMMENTS_FOLDER_NAME
public static final String UNMIGRATED_COMMENTS_FOLDER_NAME
- See Also:
- Constant Field Values
-
GET_COMMENTS_FOLDERS_QUERY
public static final String GET_COMMENTS_FOLDERS_QUERY
- Since:
- 11.1.
-
-
Method Detail
-
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
-
migrateSessionRelationToProperty
protected void migrateSessionRelationToProperty(CoreSession session, MigrationService.MigrationContext migrationContext)
- Since:
- 11.1
-
migrateCommentsFromRelationToProperty
protected void migrateCommentsFromRelationToProperty(CoreSession session, RelationManager relationManager, CommentServiceConfig config, Statement statement)
- Since:
- 11.1
-
migrateSessionPropertyToSecured
protected void migrateSessionPropertyToSecured(CoreSession session, MigrationService.MigrationContext migrationContext)
- Since:
- 11.1
-
migrateCommentsFromPropertyToSecured
protected void migrateCommentsFromPropertyToSecured(CoreSession session, TreeCommentManager treeCommentManager, IdRef commentIdRef)
- Since:
- 11.1
-
hasUnsecuredComments
protected boolean hasUnsecuredComments(CoreSession session)
- Since:
- 11.1
-
getUnsecuredCommentIds
protected List<String> getUnsecuredCommentIds(CoreSession session)
- Since:
- 11.1
-
getCommentFolders
protected List<String> getCommentFolders(CoreSession session)
- Since:
- 11.1
-
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
-
notifyStatusChange
public void notifyStatusChange()
Description copied from interface:MigrationService.Migrator
Allows notification of status change for a running step or new state.
-
-