public interface EntitySnapshotService
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 save 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
|
EntitySnapshot |
createTempSnapshot(Entity entity,
View view)
Creates non-persistent snapshot for entity.
|
EntitySnapshot |
createTempSnapshot(Entity entity,
View view,
java.util.Date snapshotDate)
Creates non-persistent snapshot for entity with a specific date.
|
EntitySnapshot |
createTempSnapshot(Entity entity,
View view,
java.util.Date snapshotDate,
User author)
Creates non-persistent snapshot for entity with a specific date and author.
|
Entity |
extractEntity(EntitySnapshot snapshot)
Get entity from snapshot
|
EntityDiff |
getDifference(EntitySnapshot first,
EntitySnapshot second)
Get Diff for snapshots
|
EntitySnapshot |
getLastEntitySnapshot(Entity entity)
Get the last snapshot for the given entity.
|
EntitySnapshot |
getLastEntitySnapshot(MetaClass metaClass,
java.lang.Object referenceId)
Get the last snapshot for the given entity by id.
|
java.util.List<EntitySnapshot> |
getSnapshots(MetaClass metaClass,
java.lang.Object id)
Get snapshots for entity by id
|
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 meta classid
- Entity idEntitySnapshot 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
- SnapshotEntityDiff getDifference(@Nullable EntitySnapshot first, EntitySnapshot second)
first
- First snapshotsecond
- Second snapshotvoid 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 migration@Nullable EntitySnapshot getLastEntitySnapshot(Entity entity)
HasUuid
interface.entity
- entity@Nullable EntitySnapshot getLastEntitySnapshot(MetaClass metaClass, java.lang.Object referenceId)
metaClass
- entity meta classreferenceId
- reference id for which snapshot refersEntitySnapshot createTempSnapshot(Entity entity, View view)
HasUuid
interface.entity
- entityview
- viewEntitySnapshot createTempSnapshot(Entity entity, View view, java.util.Date snapshotDate)
HasUuid
interface.entity
- entityview
- entity viewsnapshotDate
- dateEntitySnapshot createTempSnapshot(Entity entity, View view, java.util.Date snapshotDate, User author)
HasUuid
interface.entity
- entityview
- entity viewsnapshotDate
- dateauthor
- author