public abstract class AbstractV60MigrationEntitiesTask extends Object
Modifier and Type | Field and Description |
---|---|
protected com.atlassian.activeobjects.external.ActiveObjects |
ao |
private AOContext |
aoContext |
protected static org.apache.log4j.Logger |
log |
protected IMigrationTask |
task |
Constructor and Description |
---|
AbstractV60MigrationEntitiesTask(IMigrationTask task,
com.atlassian.activeobjects.external.ActiveObjects ao) |
Modifier and Type | Method and Description |
---|---|
void |
addMigrationMessage(net.java.ao.Entity entity,
net.java.ao.Entity childRecord,
String message) |
void |
addMigrationMessage(net.java.ao.Entity entity,
String message)
When some data couldn't be migrated, add a message for this requirement
|
protected AOContext |
aoContext() |
private String |
concat(String message1,
String message2)
Concats two messages using \n
|
protected <T extends LongEntity> |
generateId(String spaceKey,
Class<T> referenceClass)
Generic method to be able to generate an id
|
private String |
getRecordId(net.java.ao.Entity childRecord) |
abstract boolean |
migrateEntities() |
protected <T extends AOMigratedEntity,U extends LongEntity> |
migrateEntity(Class<T> aoEntityToMigrate,
Class<U> dbEntityToCreate,
BiFunction<DAOCache<Long,U>,T,Boolean> migrateFunction)
Migrate all records of an AO entity.
|
protected static final org.apache.log4j.Logger log
protected final IMigrationTask task
protected final com.atlassian.activeobjects.external.ActiveObjects ao
private AOContext aoContext
public AbstractV60MigrationEntitiesTask(IMigrationTask task, com.atlassian.activeobjects.external.ActiveObjects ao)
public abstract boolean migrateEntities()
protected <T extends LongEntity> Long generateId(String spaceKey, Class<T> referenceClass)
protected <T extends AOMigratedEntity,U extends LongEntity> boolean migrateEntity(Class<T> aoEntityToMigrate, Class<U> dbEntityToCreate, BiFunction<DAOCache<Long,U>,T,Boolean> migrateFunction)
aoEntityToMigrate
- the origin classdbEntityToCreate
- the destination classmigrateFunction
- a function which takes a cache and a record,
and migrates the record (preferably using the cache),
and returns 'true' if the record was properly migrated.
Returns 'false' if the record was migrated, but if it needs to be
called again for the same record.public void addMigrationMessage(net.java.ao.Entity entity, String message)
public void addMigrationMessage(net.java.ao.Entity entity, net.java.ao.Entity childRecord, String message)
private String getRecordId(net.java.ao.Entity childRecord)
protected AOContext aoContext()
Copyright © 2022 Requirement Yogi. All rights reserved.