@Component(value="cuba_EntitySnapshotManager") public class EntitySnapshotManager extends java.lang.Object implements EntitySnapshotAPI
NAME
Constructor and Description |
---|
EntitySnapshotManager() |
Modifier and Type | Method and Description |
---|---|
EntitySnapshot |
createSnapshot(Entity entity,
View view)
Create snapshot for Entity and store it to database
|
EntitySnapshot |
createSnapshot(Entity entity,
View view,
java.util.Date snapshotDate)
Create snapshot for Entity with specific date and store it to database
|
EntitySnapshot |
createSnapshot(Entity entity,
View view,
java.util.Date snapshotDate,
User author)
Create snapshot for Entity with specific date and author and store it to database
|
Entity |
extractEntity(EntitySnapshot snapshot)
Restore entity by snapshot
|
View |
extractView(EntitySnapshot snapshot)
Restore view from snapshot
|
EntityDiff |
getDifference(EntitySnapshot first,
EntitySnapshot second)
Diff two versions of entity
|
java.util.List<EntitySnapshot> |
getSnapshots(MetaClass metaClass,
java.lang.Object id)
Load snapshots for entity
|
void |
migrateSnapshots(MetaClass metaClass,
java.lang.Object id,
java.util.Map<java.lang.Class,java.lang.Class> classMapping)
Translate snapshots for archival classes
|
public java.util.List<EntitySnapshot> getSnapshots(MetaClass metaClass, java.lang.Object id)
EntitySnapshotAPI
getSnapshots
in interface EntitySnapshotAPI
metaClass
- Entity metaclassid
- Entity Idpublic void migrateSnapshots(MetaClass metaClass, java.lang.Object id, java.util.Map<java.lang.Class,java.lang.Class> classMapping)
EntitySnapshotAPI
migrateSnapshots
in interface EntitySnapshotAPI
metaClass
- Metaclassid
- Entity IdclassMapping
- Map of [OldClass -> NewClass] for migrationpublic EntitySnapshot createSnapshot(Entity entity, View view)
EntitySnapshotAPI
createSnapshot
in interface EntitySnapshotAPI
entity
- Entityview
- Viewpublic EntitySnapshot createSnapshot(Entity entity, View view, java.util.Date snapshotDate)
EntitySnapshotAPI
createSnapshot
in interface EntitySnapshotAPI
entity
- Entityview
- ViewsnapshotDate
- Datepublic EntitySnapshot createSnapshot(Entity entity, View view, java.util.Date snapshotDate, User author)
EntitySnapshotAPI
createSnapshot
in interface EntitySnapshotAPI
entity
- Entityview
- ViewsnapshotDate
- Dateauthor
- Authorpublic Entity extractEntity(EntitySnapshot snapshot)
EntitySnapshotAPI
extractEntity
in interface EntitySnapshotAPI
snapshot
- Snapshotpublic View extractView(EntitySnapshot snapshot)
EntitySnapshotAPI
extractView
in interface EntitySnapshotAPI
snapshot
- Snapshotpublic EntityDiff getDifference(@Nullable EntitySnapshot first, EntitySnapshot second)
EntitySnapshotAPI
getDifference
in interface EntitySnapshotAPI
first
- First versionsecond
- Second version