public class GetSnapshotDeltaTask extends SessionedTask<SnapshotDelta<CanonicalResource,CanonicalDelta>>
Snapshot
<Digest
>) computes the delta with respect to the current snapshot of digests, and returns the delta in terms of a SnapshotDelta
object. This result contains add, delete and update operations that can be applied to bring another ConfigContext in sync with the snapshot of this session. Two kinds of snapshot deltas can be obtained:
SnapshotDelta
<CanonicalResource
, CanonicalDelta
> ) : Canonical delta is useful if the delta will be used immediately without serializing it, in the same jvm.SnapshotDelta
<PortableResource
, PortableDelta
> ) : Portable delta is the serialized representation of the canonical data. This form must be used if the delta is going to be serialized for persistence or for sending it to another config framework instanceSnapshots
Constructor and Description |
---|
GetSnapshotDeltaTask(Snapshot<Digest> source)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected SnapshotDelta<CanonicalResource,CanonicalDelta> |
_execute()
Subclasses implement this method
|
static SnapshotDelta<CanonicalResource,CanonicalDelta> |
getCanonicalDelta(ConfigService configService, java.lang.String session, Snapshot<Digest> source)
Returns the canonical snapshot delta with respect to the given source version
|
static SnapshotDelta<PortableResource,PortableDelta> |
getPortableDelta(ConfigService configService, java.lang.String session, Snapshot<Digest> source)
Returns the portable snapshot delta with respect to the given source version
|
assertExists, assertLocation, assertNONResource, assertNotExists, assertNotLocationData, assertNotNull, assertNotNullElement, assertResource, assertSimple, call, doExecute, doExecute, doExecute, doExecute, expand, getConfigContext, getConfigMBean, getConfigService, getDescription, getSession, isLocation, isReadOnlyTransaction, requiresSystemTransaction
public GetSnapshotDeltaTask(Snapshot<Digest> source)
source
- the version information for some other config context, possibly on a different system/JVM. a null value indicates no information is known about the source version, and all resources are returnedprotected SnapshotDelta<CanonicalResource,CanonicalDelta> _execute() throws java.lang.Exception
SessionedTask
_execute
in class SessionedTask<SnapshotDelta<CanonicalResource,CanonicalDelta>>
java.lang.Exception
public static SnapshotDelta<CanonicalResource,CanonicalDelta> getCanonicalDelta(ConfigService configService, java.lang.String session, Snapshot<Digest> source) throws java.lang.Exception
configService
- the config service to operate onsession
- the session to take the snapshot delta relative tosource
- the version information for some other config context, possibly on a different system/JVM. a null value indicates no information is known about the source version, and all resources are returnedjava.lang.Exception
public static SnapshotDelta<PortableResource,PortableDelta> getPortableDelta(ConfigService configService, java.lang.String session, Snapshot<Digest> source) throws java.lang.Exception
configService
- the config service to operate onsession
- the session to take the snapshot delta relative tosource
- the version information for some other config context, possibly on a different system/JVM. a null value indicates no information is known about the source version, and all resources are returnedjava.lang.Exception