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 intBATCH_SIZEstatic StringGET_COMMENTS_FOLDERS_QUERYstatic StringUNMIGRATED_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 StringbuildInClause(List<String> parentIds)protected List<String>getCommentFolders(CoreSession session)protected List<String>getUnsecuredCommentIds(CoreSession session)protected booleanhasUnsecuredComments(CoreSession session)protected voidmigrateCommentsFromPropertyToSecured(CoreSession session, TreeCommentManager treeCommentManager, IdRef commentIdRef)protected voidmigrateCommentsFromRelationToProperty(CoreSession session, RelationManager relationManager, CommentServiceConfig config, Statement statement)protected voidmigrateSession(String step, MigrationService.MigrationContext migrationContext, CoreSession session)protected voidmigrateSessionPropertyToSecured(CoreSession session, MigrationService.MigrationContext migrationContext)protected voidmigrateSessionRelationToProperty(CoreSession session, MigrationService.MigrationContext migrationContext)voidnotifyStatusChange()Allows notification of status change for a running step or new state.protected StringprobeSession(CoreSession session)StringprobeState()Probes the current state of a migration by analyzing persistent data.voidrun(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:
probeSessionin classAbstractRepositoryMigrator
-
run
public void run(String step, MigrationService.MigrationContext migrationContext)
Description copied from interface:MigrationService.MigratorRuns 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:
migrateSessionin 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.MigratorProbes 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
nullif it cannot be determined
-
notifyStatusChange
public void notifyStatusChange()
Description copied from interface:MigrationService.MigratorAllows notification of status change for a running step or new state.
-
-