org.axonframework.eventstore.jpa
Class AbstractEventEntry

java.lang.Object
  extended by org.axonframework.eventstore.jpa.AbstractEventEntry
All Implemented Interfaces:
SerializedDomainEventData
Direct Known Subclasses:
DomainEventEntry, SnapshotEventEntry

@MappedSuperclass
public abstract class AbstractEventEntry
extends Object
implements SerializedDomainEventData

Data needed by different types of event logs.

Since:
0.5
Author:
Allard Buijze

Nested Class Summary
static class AbstractEventEntry.PK
          Primary key definition of the AbstractEventEntry class.
 
Constructor Summary
protected AbstractEventEntry()
          Default constructor, as required by JPA specification.
protected AbstractEventEntry(String type, DomainEventMessage event, SerializedObject<byte[]> payload, SerializedObject<byte[]> metaData)
          Initialize an Event entry for the given event.
 
Method Summary
 Object getAggregateIdentifier()
          Returns the Aggregate Identifier of the associated event.
 String getEventIdentifier()
          Returns the identifier of the serialized event.
 SerializedObject<byte[]> getMetaData()
          Returns the serialized data of the MetaData of the serialized Event.
 SerializedObject<byte[]> getPayload()
          Returns the serialized data of the Event Message's payload.
 long getSequenceNumber()
          Returns the sequence number of the associated event.
 org.joda.time.DateTime getTimestamp()
          Returns the time stamp of the associated event.
 String getType()
          Returns the type identifier of the aggregate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEventEntry

protected AbstractEventEntry(String type,
                             DomainEventMessage event,
                             SerializedObject<byte[]> payload,
                             SerializedObject<byte[]> metaData)
Initialize an Event entry for the given event.

Parameters:
type - The type identifier of the aggregate root the event belongs to
event - The event to store in the EventStore
payload - The serialized payload of the Event
metaData - The serialized metaData of the Event

AbstractEventEntry

protected AbstractEventEntry()
Default constructor, as required by JPA specification. Do not use directly!

Method Detail

getAggregateIdentifier

public Object getAggregateIdentifier()
Returns the Aggregate Identifier of the associated event.

Specified by:
getAggregateIdentifier in interface SerializedDomainEventData
Returns:
the Aggregate Identifier of the associated event.

getType

public String getType()
Returns the type identifier of the aggregate.

Returns:
the type identifier of the aggregate.

getSequenceNumber

public long getSequenceNumber()
Returns the sequence number of the associated event.

Specified by:
getSequenceNumber in interface SerializedDomainEventData
Returns:
the sequence number of the associated event.

getTimestamp

public org.joda.time.DateTime getTimestamp()
Returns the time stamp of the associated event.

Specified by:
getTimestamp in interface SerializedDomainEventData
Returns:
the time stamp of the associated event.

getEventIdentifier

public String getEventIdentifier()
Description copied from interface: SerializedDomainEventData
Returns the identifier of the serialized event.

Specified by:
getEventIdentifier in interface SerializedDomainEventData
Returns:
the identifier of the serialized event

getPayload

public SerializedObject<byte[]> getPayload()
Description copied from interface: SerializedDomainEventData
Returns the serialized data of the Event Message's payload.

Specified by:
getPayload in interface SerializedDomainEventData
Returns:
the serialized data of the Event Message's payload

getMetaData

public SerializedObject<byte[]> getMetaData()
Description copied from interface: SerializedDomainEventData
Returns the serialized data of the MetaData of the serialized Event.

Specified by:
getMetaData in interface SerializedDomainEventData
Returns:
the serialized data of the MetaData of the serialized Event


Copyright © 2010-2012. All Rights Reserved.