public abstract class SandboxLoggingSupport
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SandboxLoggingSupport.PersistableLogType
The type of a persistable log.
|
static class |
SandboxLoggingSupport.PersistableRecordType
The type of
SandboxLogRecord that can be persisted. |
Constructor and Description |
---|
SandboxLoggingSupport() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addSandboxLogRecord(java.lang.Long sandboxLogId,
SandboxLogRecord record)
Adds a record to a sandbox log.
|
abstract void |
addSandboxLogRecords(java.lang.Long sandboxLogId,
java.util.List<? extends SandboxLogRecord> records)
Adds a list of records to a sandbox log as one atomic transaction.
|
abstract java.lang.Long |
createSandboxLog(SandboxLog<? extends SandboxLogRecord> log)
Creates a sandbox log.
|
abstract java.lang.Long |
createSandboxLog(java.lang.String summary)
Creates a sandbox log with no records.
|
abstract boolean |
deleteSandboxLog(java.lang.Long sandboxLogId)
Deletes a sandbox log.
|
static SandboxLoggingSupport |
getInstance()
Returns an instance of this class.
|
protected SandboxLoggingSupport.PersistableRecordType |
getPersistableRecordType(SandboxLogRecord record)
Determines the persistable type of a record.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getPersistableValues(SandboxLogRecord record)
Returns the persistable field values in a log record as a map.
|
abstract SandboxLog<? extends SandboxLogRecord> |
getSandboxLog(java.lang.Long sandboxLogId)
Returns the sandbox log specified by its persistence ID.
|
protected SandboxLogRecord |
newSandboxLogRecord(SandboxLoggingSupport.PersistableRecordType type,
java.util.Map<java.lang.String,java.lang.Object> values)
Returns a new instance of a
SandboxLogRecord based on a
persistable type. |
public static SandboxLoggingSupport getInstance()
public abstract java.lang.Long createSandboxLog(java.lang.String summary)
summary
- the summary of the logprotected SandboxLoggingSupport.PersistableRecordType getPersistableRecordType(SandboxLogRecord record)
record
- the record to be checkedprotected java.util.Map<java.lang.String,java.lang.Object> getPersistableValues(SandboxLogRecord record)
record
- the log recordjava.lang.NullPointerException
- if the given record is nullprotected SandboxLogRecord newSandboxLogRecord(SandboxLoggingSupport.PersistableRecordType type, java.util.Map<java.lang.String,java.lang.Object> values)
SandboxLogRecord
based on a
persistable type.type
- the persistable type; null
if the type cannot be
determined. In case of null
, an instance of the
most generic type is returned.values
- the values to be loaded into the new instancepublic abstract java.lang.Long createSandboxLog(SandboxLog<? extends SandboxLogRecord> log)
log
- the log to be createdpublic abstract SandboxLog<? extends SandboxLogRecord> getSandboxLog(java.lang.Long sandboxLogId)
sandboxLogId
- the persistence ID of the sandbox lognull
if no
sandbox with the ID existspublic abstract void addSandboxLogRecord(java.lang.Long sandboxLogId, SandboxLogRecord record)
sandboxLogId
- the persistence ID of the sandbox logrecord
- the record to be addedjava.lang.IllegalStateException
- if the sandbox log with the specified ID
does not existjava.lang.IllegalArgumentException
- if the log ID or record is nullpublic abstract void addSandboxLogRecords(java.lang.Long sandboxLogId, java.util.List<? extends SandboxLogRecord> records)
sandboxLogId
- the ID of the sandbox logrecords
- the list of record to be addedjava.lang.IllegalStateException
- if the sandbox log with the specified ID
does not existjava.lang.IllegalArgumentException
- if the log ID or list is nullpublic abstract boolean deleteSandboxLog(java.lang.Long sandboxLogId)
sandboxLogId
- the persistence ID of the sandbox logtrue
if the sandbox log with the ID exists and is
deleted successfully; false
otherwise