Package io.camunda.zeebe.protocol.record
Interface Record<T extends RecordValue>
- All Superinterfaces:
JsonSerializable
- All Known Implementing Classes:
ImmutableRecord
Represents a record published to the log stream.
-
Method Summary
Modifier and TypeMethodDescriptioncopyOf()Creates a deep copy of the current record.Provides the authorization data of the user the triggered the creation of this record.longgetKey()Retrieves the key of the record.longThe operationReference is an id passed from clients to correlate operations with resulted recordsintlongRetrieves the position of the record.intA record version is an integer starting from 1.longReturns the position of the source record.longgetValue()Returns the raw value of the record, which should implement one of the interfaces in theio.camunda.zeebe.protocol.record.valuepackage.Methods inherited from interface io.camunda.zeebe.protocol.record.JsonSerializable
toJson
-
Method Details
-
getPosition
long getPosition()Retrieves the position of the record. Positions are locally unique to the partition, and monotonically increasing. Records are then ordered on the partition by their positions, i.e. lower position means the record was published earlier.- Returns:
- position the record
-
getSourceRecordPosition
long getSourceRecordPosition()Returns the position of the source record. The source record denotes the record which caused the current record. It can be unset (meaning there is no source record), at which point the position returned here will be -1. Anything >= 0 implies a source record.- Returns:
- position of the source record
-
getKey
long getKey()Retrieves the key of the record.Multiple records can have the same key if they belongs to the same logical entity. Keys are unique for the combination of partition and record type.
- Returns:
- the key of the record
-
getTimestamp
long getTimestamp()- Returns:
- the unix timestamp at which the record was published on the partition.
-
getIntent
Intent getIntent()- Returns:
- the intent of the record
-
getPartitionId
int getPartitionId()- Returns:
- the partition ID on which the record was published
-
getRecordType
RecordType getRecordType()- Returns:
- the type of the record (event, command or command rejection)
-
getRejectionType
RejectionType getRejectionType()- Returns:
- the type of rejection if
getRecordType()returnsRecordType.COMMAND_REJECTIONor elsenull.
-
getRejectionReason
String getRejectionReason()- Returns:
- the reason why a command was rejected if
getRecordType()returnsRecordType.COMMAND_REJECTIONor elsenull.
-
getBrokerVersion
String getBrokerVersion()- Returns:
- the version of the broker that wrote this record
-
getAuthorizations
Provides the authorization data of the user the triggered the creation of this record. The following entries may be available:- Key:
authorized_tenants; Value: a List of Strings defining the user's authorized tenants.
- Returns:
- a Map of authorization data for this record or an empty Map if not set.
- Key:
-
getRecordVersion
int getRecordVersion()A record version is an integer starting from 1. The version of a record is defined when it is written. It allows different versions of the same record to be processed or applied differently.For example, it allows us to apply an older event in the same way as when it was originally written, while allowing newer events to be applied differently.
- Returns:
- the version of the record when written
-
getValueType
ValueType getValueType()- Returns:
- the type of the record (e.g. job, process, process instance, etc.)
-
getValue
T getValue()Returns the raw value of the record, which should implement one of the interfaces in theio.camunda.zeebe.protocol.record.valuepackage.The record value is essentially the record specific data, e.g. for a process instance creation event, it would contain information relevant to the process instance being created.
- Returns:
- record value
-
getOperationReference
long getOperationReference()The operationReference is an id passed from clients to correlate operations with resulted records- Returns:
- the reference for the operation that produced this record
-
copyOf
Creates a deep copy of the current record. Can be used to collect records.- Returns:
- a deep copy of this record
-