org.axonframework.saga.repository.jpa
Class SagaEntry

java.lang.Object
  extended by org.axonframework.saga.repository.jpa.SagaEntry

@Entity
public class SagaEntry
extends Object

Java Persistence Entity allowing sagas to be stored in a relational database.

Since:
0.7
Author:
Allard Buijze

Constructor Summary
protected SagaEntry()
          Constructor required by JPA.
  SagaEntry(Saga saga, Serializer serializer)
          Constructs a new SagaEntry for the given saga.
 
Method Summary
 String getRevision()
          Returns the revision of the serialized saga
 Saga getSaga(Serializer serializer)
          Returns the Saga instance stored in this entry.
 String getSagaId()
          Returns the identifier of the saga contained in this entry
 String getSagaType()
          Returns the type identifier of the serialized saga
 byte[] getSerializedSaga()
          Returns the serialized form of the Saga.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SagaEntry

public SagaEntry(Saga saga,
                 Serializer serializer)
Constructs a new SagaEntry for the given saga. The given saga must be serializable. The provided saga is not modified by this operation.

Parameters:
saga - The saga to store
serializer - The serialization mechanism to convert the Saga to a byte stream

SagaEntry

protected SagaEntry()
Constructor required by JPA. Do not use.

See Also:
SagaEntry(org.axonframework.saga.Saga, org.axonframework.serializer.Serializer)
Method Detail

getSaga

public Saga getSaga(Serializer serializer)
Returns the Saga instance stored in this entry.

Parameters:
serializer - The serializer to decode the Saga
Returns:
the Saga instance stored in this entry

getSerializedSaga

public byte[] getSerializedSaga()
Returns the serialized form of the Saga.

Returns:
the serialized form of the Saga

getSagaId

public String getSagaId()
Returns the identifier of the saga contained in this entry

Returns:
the identifier of the saga contained in this entry

getRevision

public String getRevision()
Returns the revision of the serialized saga

Returns:
the revision of the serialized saga

getSagaType

public String getSagaType()
Returns the type identifier of the serialized saga

Returns:
the type identifier of the serialized saga


Copyright © 2010-2016. All Rights Reserved.