public interface EntitySnapshotAPI
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
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
|
static final java.lang.String NAME
java.util.List<EntitySnapshot> getSnapshots(MetaClass metaClass, java.lang.Object id)
metaClass
- Entity metaclassid
- Entity Idvoid migrateSnapshots(MetaClass metaClass, java.lang.Object id, java.util.Map<java.lang.Class,java.lang.Class> classMapping)
metaClass
- Metaclassid
- Entity IdclassMapping
- Map of [OldClass -> NewClass] for migrationEntitySnapshot createSnapshot(Entity entity, View view)
entity
- Entityview
- ViewEntitySnapshot createSnapshot(Entity entity, View view, java.util.Date snapshotDate)
entity
- Entityview
- ViewsnapshotDate
- DateEntitySnapshot createSnapshot(Entity entity, View view, java.util.Date snapshotDate, User author)
entity
- Entityview
- ViewsnapshotDate
- Dateauthor
- AuthorEntity extractEntity(EntitySnapshot snapshot)
snapshot
- SnapshotView extractView(EntitySnapshot snapshot)
snapshot
- SnapshotEntityDiff getDifference(@Nullable EntitySnapshot first, EntitySnapshot second)
first
- First versionsecond
- Second version