org.axonframework.eventsourcing
Class AggregateSnapshot<T extends EventSourcedAggregateRoot>

java.lang.Object
  extended by org.axonframework.domain.EventBase
      extended by org.axonframework.domain.DomainEvent
          extended by org.axonframework.eventsourcing.AggregateSnapshot<T>
Type Parameters:
T - The type of aggregate this snapshot captures
All Implemented Interfaces:
Serializable, Event

public class AggregateSnapshot<T extends EventSourcedAggregateRoot>
extends DomainEvent

Snapshot event that captures the entire aggregate. The motivation is that the aggregate contains all relevant state.

Since:
0.6
Author:
Allard Buijze
See Also:
Serialized Form

Constructor Summary
AggregateSnapshot(T aggregate)
          Initialize a new AggregateSnapshot for the given aggregate.
 
Method Summary
 T getAggregate()
          Return the aggregate that was captured in this snapshot.
 
Methods inherited from class org.axonframework.domain.DomainEvent
equals, getAggregateIdentifier, getAggregateVersion, getSequenceNumber, hashCode
 
Methods inherited from class org.axonframework.domain.EventBase
addMetaData, getEventIdentifier, getEventRevision, getMetaData, getMetaDataValue, getTimestamp, setEventRevision
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateSnapshot

public AggregateSnapshot(T aggregate)
Initialize a new AggregateSnapshot for the given aggregate. Note that the aggregate may not contain uncommitted modifications.

Parameters:
aggregate - The aggregate containing the state to capture in the snapshot
Throws:
IllegalArgumentException - if the aggregate contains uncommitted modifications
Method Detail

getAggregate

public T getAggregate()
Return the aggregate that was captured in this snapshot.

Returns:
the aggregate that was captured in this snapshot.


Copyright © 2011. All Rights Reserved.