public enum NoSnapshotTriggerDefinition extends Enum<NoSnapshotTriggerDefinition> implements SnapshotTriggerDefinition
SnapshotTriggerDefinition
that doesn't trigger snapshots at all.Enum Constant and Description |
---|
INSTANCE
The singleton instance of a
NoSnapshotTriggerDefinition . |
Modifier and Type | Field and Description |
---|---|
static SnapshotTrigger |
TRIGGER
A singleton instance of a
SnapshotTrigger that does nothing. |
Modifier and Type | Method and Description |
---|---|
SnapshotTrigger |
prepareTrigger(Class<?> aggregateType)
Prepares a new trigger for an aggregate with the given
aggregateIdentifier and aggregateType . |
static NoSnapshotTriggerDefinition |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NoSnapshotTriggerDefinition[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
reconfigure
public static final NoSnapshotTriggerDefinition INSTANCE
NoSnapshotTriggerDefinition
.public static final SnapshotTrigger TRIGGER
SnapshotTrigger
that does nothing.public static NoSnapshotTriggerDefinition[] values()
for (NoSnapshotTriggerDefinition c : NoSnapshotTriggerDefinition.values()) System.out.println(c);
public static NoSnapshotTriggerDefinition valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic SnapshotTrigger prepareTrigger(Class<?> aggregateType)
SnapshotTriggerDefinition
aggregateIdentifier
and aggregateType
.
The trigger will be notified of each event applied on the aggregate, as well as the moment at which the aggregate
state is fully initialized based on its historic events.
It is highly recommended that the instances returned by this method are Serializable
. Any
resources that the trigger needs that are not serializable, can be reattached by implementing the
SnapshotTriggerDefinition.reconfigure(Class, SnapshotTrigger)
method. This method is invoked when a SnapshotTrigger has been
deserialized.
prepareTrigger
in interface SnapshotTriggerDefinition
aggregateType
- The type of aggregate for which to create a triggerCopyright © 2010–2018. All rights reserved.