Class LedgerPersistenceRequest
-
- All Implemented Interfaces:
-
java.io.Externalizable
,java.io.Serializable
,java.lang.Comparable
,org.apache.avro.generic.GenericContainer
,org.apache.avro.generic.GenericRecord
,org.apache.avro.generic.IndexedRecord
,org.apache.avro.specific.SpecificRecord
public class LedgerPersistenceRequest extends SpecificRecordBase implements SpecificRecord
Make a persistence request on a ledger. The action is determined by the type of the request payload. See also: EntityResponse, PersistTransaction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
LedgerPersistenceRequest.Builder
RecordBuilder for LedgerPersistenceRequest instances.
-
Field Summary
Fields Modifier and Type Field Description public final static Schema
SCHEMA$
public Instant
timestamp
public HoldingIdentity
holdingIdentity
public LedgerTypes
ledgerType
public Object
request
public ExternalEventContext
flowExternalEventContext
-
Constructor Summary
Constructors Constructor Description LedgerPersistenceRequest()
Default constructor. LedgerPersistenceRequest(Instant timestamp, HoldingIdentity holdingIdentity, LedgerTypes ledgerType, Object request, ExternalEventContext flowExternalEventContext)
All-args constructor.
-
Method Summary
Modifier and Type Method Description Instant
getTimestamp()
Gets the value of the 'timestamp' field. void
setTimestamp(Instant value)
Sets the value of the 'timestamp' field. HoldingIdentity
getHoldingIdentity()
Gets the value of the 'holdingIdentity' field. void
setHoldingIdentity(HoldingIdentity value)
Sets the value of the 'holdingIdentity' field. LedgerTypes
getLedgerType()
Gets the value of the 'ledgerType' field. void
setLedgerType(LedgerTypes value)
Sets the value of the 'ledgerType' field. Object
getRequest()
Gets the value of the 'request' field. void
setRequest(Object value)
Sets the value of the 'request' field. ExternalEventContext
getFlowExternalEventContext()
Gets the value of the 'flowExternalEventContext' field. void
setFlowExternalEventContext(ExternalEventContext value)
Sets the value of the 'flowExternalEventContext' field. static Schema
getClassSchema()
static BinaryMessageEncoder<LedgerPersistenceRequest>
getEncoder()
Return the BinaryMessageEncoder instance used by this class. static BinaryMessageDecoder<LedgerPersistenceRequest>
getDecoder()
Return the BinaryMessageDecoder instance used by this class. static BinaryMessageDecoder<LedgerPersistenceRequest>
createDecoder(SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore. ByteBuffer
toByteBuffer()
Serializes this LedgerPersistenceRequest to a ByteBuffer. static LedgerPersistenceRequest
fromByteBuffer(ByteBuffer b)
Deserializes a LedgerPersistenceRequest from a ByteBuffer. SpecificData
getSpecificData()
Schema
getSchema()
Object
get(int field$)
Conversion<out Object>
getConversion(int field)
void
put(int field$, Object value$)
static LedgerPersistenceRequest.Builder
newBuilder()
Creates a new LedgerPersistenceRequest RecordBuilder. static LedgerPersistenceRequest.Builder
newBuilder(LedgerPersistenceRequest.Builder other)
Creates a new LedgerPersistenceRequest RecordBuilder by copying an existing Builder. static LedgerPersistenceRequest.Builder
newBuilder(LedgerPersistenceRequest other)
Creates a new LedgerPersistenceRequest RecordBuilder by copying an existing LedgerPersistenceRequest instance. void
writeExternal(ObjectOutput out)
void
readExternal(ObjectInput in)
-
Methods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, customDecode, customEncode, equals, hashCode, toString
-
Methods inherited from class org.apache.avro.generic.GenericRecord
hasField
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
LedgerPersistenceRequest
LedgerPersistenceRequest()
Default constructor.
-
LedgerPersistenceRequest
LedgerPersistenceRequest(Instant timestamp, HoldingIdentity holdingIdentity, LedgerTypes ledgerType, Object request, ExternalEventContext flowExternalEventContext)
All-args constructor.- Parameters:
timestamp
- Time (java.time.Instant) in milliseconds when the record was created.holdingIdentity
- The holding identity of the user making the DB request.ledgerType
- The type of ledger the request is for.request
- The 'request' that we wish to make to the ledger persistence API.flowExternalEventContext
- The context of the external event that this request was sent from.
-
-
Method Detail
-
getTimestamp
Instant getTimestamp()
Gets the value of the 'timestamp' field.
-
setTimestamp
void setTimestamp(Instant value)
Sets the value of the 'timestamp' field. Time (java.time.Instant) in milliseconds when the record was created.
- Parameters:
value
- the value to set.
-
getHoldingIdentity
HoldingIdentity getHoldingIdentity()
Gets the value of the 'holdingIdentity' field.
-
setHoldingIdentity
void setHoldingIdentity(HoldingIdentity value)
Sets the value of the 'holdingIdentity' field. The holding identity of the user making the DB request.
- Parameters:
value
- the value to set.
-
getLedgerType
LedgerTypes getLedgerType()
Gets the value of the 'ledgerType' field.
-
setLedgerType
void setLedgerType(LedgerTypes value)
Sets the value of the 'ledgerType' field. The type of ledger the request is for.
- Parameters:
value
- the value to set.
-
getRequest
Object getRequest()
Gets the value of the 'request' field.
-
setRequest
void setRequest(Object value)
Sets the value of the 'request' field. The 'request' that we wish to make to the ledger persistence API.
- Parameters:
value
- the value to set.
-
getFlowExternalEventContext
ExternalEventContext getFlowExternalEventContext()
Gets the value of the 'flowExternalEventContext' field.
-
setFlowExternalEventContext
void setFlowExternalEventContext(ExternalEventContext value)
Sets the value of the 'flowExternalEventContext' field. The context of the external event that this request was sent from.
- Parameters:
value
- the value to set.
-
getClassSchema
static Schema getClassSchema()
-
getEncoder
static BinaryMessageEncoder<LedgerPersistenceRequest> getEncoder()
Return the BinaryMessageEncoder instance used by this class.
-
getDecoder
static BinaryMessageDecoder<LedgerPersistenceRequest> getDecoder()
Return the BinaryMessageDecoder instance used by this class.
-
createDecoder
static BinaryMessageDecoder<LedgerPersistenceRequest> createDecoder(SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore.
- Parameters:
resolver
- a SchemaStore used to find schemas by fingerprint
-
toByteBuffer
ByteBuffer toByteBuffer()
Serializes this LedgerPersistenceRequest to a ByteBuffer.
-
fromByteBuffer
static LedgerPersistenceRequest fromByteBuffer(ByteBuffer b)
Deserializes a LedgerPersistenceRequest from a ByteBuffer.
- Parameters:
b
- a byte buffer holding serialized data for an instance of this class
-
getSpecificData
SpecificData getSpecificData()
-
getSchema
Schema getSchema()
-
getConversion
Conversion<out Object> getConversion(int field)
-
newBuilder
static LedgerPersistenceRequest.Builder newBuilder()
Creates a new LedgerPersistenceRequest RecordBuilder.
-
newBuilder
static LedgerPersistenceRequest.Builder newBuilder(LedgerPersistenceRequest.Builder other)
Creates a new LedgerPersistenceRequest RecordBuilder by copying an existing Builder.
- Parameters:
other
- The existing builder to copy.
-
newBuilder
static LedgerPersistenceRequest.Builder newBuilder(LedgerPersistenceRequest other)
Creates a new LedgerPersistenceRequest RecordBuilder by copying an existing LedgerPersistenceRequest instance.
- Parameters:
other
- The existing instance to copy.
-
writeExternal
void writeExternal(ObjectOutput out)
-
readExternal
void readExternal(ObjectInput in)
-
-
-
-