Class ImmutableJobRecordValue
java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableJobRecordValue
- All Implemented Interfaces:
JsonSerializable,RecordValue,RecordValueWithVariables,JobRecordValue,ProcessInstanceRelated,TenantOwned
Immutable implementation of
JobRecordValue.
Use the builder to create immutable instances:
ImmutableJobRecordValue.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableJobRecordValue. -
Field Summary
Fields inherited from interface io.camunda.zeebe.protocol.record.value.TenantOwned
DEFAULT_TENANT_IDENTIFIER -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableJobRecordValue.static ImmutableJobRecordValuecopyOf(JobRecordValue instance) Creates an immutable copy of aJobRecordValuevalue.booleanThis instance is equal to all instances ofImmutableJobRecordValuethat have equal attribute values.longlonglongintlonglongintlongReturns the identifier of the tenant that owns this entity.longgetType()inthashCode()Returns a lazily computed hash code from attributes:variables,processInstanceKey,tenantId,type,customHeaders,worker,retries,retryBackoff,recurringTime,deadline,timeout,errorMessage,errorCode,elementId,elementInstanceKey,bpmnProcessId,processDefinitionVersion,processDefinitionKey,jobKind,jobListenerEventType,changedAttributes.toString()Prints the immutable valueJobRecordValuewith attribute values.final ImmutableJobRecordValuewithBpmnProcessId(String value) Copy the current immutable object by setting a value for thebpmnProcessIdattribute.final ImmutableJobRecordValuewithChangedAttributes(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofchangedAttributes.final ImmutableJobRecordValuewithChangedAttributes(String... elements) Copy the current immutable object with elements that replace the content ofchangedAttributes.final ImmutableJobRecordValuewithCustomHeaders(Map<String, ? extends String> entries) Copy the current immutable object by replacing thecustomHeadersmap with the specified map.final ImmutableJobRecordValuewithDeadline(long value) Copy the current immutable object by setting a value for thedeadlineattribute.final ImmutableJobRecordValuewithElementId(String value) Copy the current immutable object by setting a value for theelementIdattribute.final ImmutableJobRecordValuewithElementInstanceKey(long value) Copy the current immutable object by setting a value for theelementInstanceKeyattribute.final ImmutableJobRecordValuewithErrorCode(String value) Copy the current immutable object by setting a value for theerrorCodeattribute.final ImmutableJobRecordValuewithErrorMessage(String value) Copy the current immutable object by setting a value for theerrorMessageattribute.final ImmutableJobRecordValuewithJobKind(JobKind value) Copy the current immutable object by setting a value for thejobKindattribute.final ImmutableJobRecordValueCopy the current immutable object by setting a value for thejobListenerEventTypeattribute.final ImmutableJobRecordValuewithProcessDefinitionKey(long value) Copy the current immutable object by setting a value for theprocessDefinitionKeyattribute.final ImmutableJobRecordValuewithProcessDefinitionVersion(int value) Copy the current immutable object by setting a value for theprocessDefinitionVersionattribute.final ImmutableJobRecordValuewithProcessInstanceKey(long value) Copy the current immutable object by setting a value for theprocessInstanceKeyattribute.final ImmutableJobRecordValuewithRecurringTime(long value) Copy the current immutable object by setting a value for therecurringTimeattribute.final ImmutableJobRecordValuewithRetries(int value) Copy the current immutable object by setting a value for theretriesattribute.final ImmutableJobRecordValuewithRetryBackoff(long value) Copy the current immutable object by setting a value for theretryBackoffattribute.final ImmutableJobRecordValuewithTenantId(String value) Copy the current immutable object by setting a value for thetenantIdattribute.final ImmutableJobRecordValuewithTimeout(long value) Copy the current immutable object by setting a value for thetimeoutattribute.final ImmutableJobRecordValueCopy the current immutable object by setting a value for thetypeattribute.final ImmutableJobRecordValuewithVariables(Map<String, ? extends Object> entries) Copy the current immutable object by replacing thevariablesmap with the specified map.final ImmutableJobRecordValuewithWorker(String value) Copy the current immutable object by setting a value for theworkerattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.camunda.zeebe.protocol.record.JsonSerializable
toJson
-
Method Details
-
getVariables
- Specified by:
getVariablesin interfaceRecordValueWithVariables- Returns:
- the variables of this record. Can be empty.
-
getProcessInstanceKey
public long getProcessInstanceKey()- Specified by:
getProcessInstanceKeyin interfaceProcessInstanceRelated- Returns:
- the key of the corresponding process instance
-
getTenantId
Returns the identifier of the tenant that owns this entity.- Specified by:
getTenantIdin interfaceTenantOwned
-
getType
- Specified by:
getTypein interfaceJobRecordValue- Returns:
- the type of the job
-
getCustomHeaders
- Specified by:
getCustomHeadersin interfaceJobRecordValue- Returns:
- user-defined headers associated with this job
-
getWorker
- Specified by:
getWorkerin interfaceJobRecordValue- Returns:
- the assigned worker to complete the job
-
getRetries
public int getRetries()- Specified by:
getRetriesin interfaceJobRecordValue- Returns:
- remaining retries
-
getRetryBackoff
public long getRetryBackoff()- Specified by:
getRetryBackoffin interfaceJobRecordValue- Returns:
- the time of backoff in milliseconds. If backoff is disabled this method returns 0 (default value).
-
getRecurringTime
public long getRecurringTime()- Specified by:
getRecurringTimein interfaceJobRecordValue- Returns:
- the timestamp when this job record should be recurred. This method is used by backoff to determine the date when the job is needed to be recurred after backoff.
-
getDeadline
public long getDeadline()- Specified by:
getDeadlinein interfaceJobRecordValue- Returns:
- the unix timestamp until when the job is exclusively assigned to this worker (time unit is milliseconds since unix epoch). If the deadline is exceeded, it can happen that the job is handed to another worker and the work is performed twice. If this property is not set it will return '-1'.
-
getTimeout
public long getTimeout()- Specified by:
getTimeoutin interfaceJobRecordValue- Returns:
- the duration used to update the deadline. If this property is not set it will return '-1'.
-
getErrorMessage
- Specified by:
getErrorMessagein interfaceJobRecordValue- Returns:
- the message that contains additional context of the failure/error. It is set by the job worker then the processing fails because of a technical failure or a non-technical error.
-
getErrorCode
- Specified by:
getErrorCodein interfaceJobRecordValue- Returns:
- the error code to identify the business error. It is set by the job worker then the processing fails because of a non-technical error that should be handled by the process.
-
getElementId
- Specified by:
getElementIdin interfaceJobRecordValue- Returns:
- the element id of the corresponding service task
-
getElementInstanceKey
public long getElementInstanceKey()- Specified by:
getElementInstanceKeyin interfaceJobRecordValue- Returns:
- the element instance key of the corresponding service task
-
getBpmnProcessId
- Specified by:
getBpmnProcessIdin interfaceJobRecordValue- Returns:
- the bpmn process id of the corresponding process definition
-
getProcessDefinitionVersion
public int getProcessDefinitionVersion()- Specified by:
getProcessDefinitionVersionin interfaceJobRecordValue- Returns:
- the version of the corresponding process definition
-
getProcessDefinitionKey
public long getProcessDefinitionKey()- Specified by:
getProcessDefinitionKeyin interfaceJobRecordValue- Returns:
- the process key of the corresponding process definition
-
getJobKind
- Specified by:
getJobKindin interfaceJobRecordValue- Returns:
- the job kind indicating the specific category of the job
-
getJobListenerEventType
- Specified by:
getJobListenerEventTypein interfaceJobRecordValue- Returns:
- the listener event type associated with this job. This type is applicable mainly for
jobs of kind
JobKind.EXECUTION_LISTENERorJobKind.TASK_LISTENER
-
getChangedAttributes
- Specified by:
getChangedAttributesin interfaceJobRecordValue- Returns:
- The value of the
changedAttributesattribute
-
withVariables
Copy the current immutable object by replacing thevariablesmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the variables map- Returns:
- A modified copy of
thisobject
-
withProcessInstanceKey
Copy the current immutable object by setting a value for theprocessInstanceKeyattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for processInstanceKey- Returns:
- A modified copy of the
thisobject
-
withTenantId
Copy the current immutable object by setting a value for thetenantIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for tenantId (can benull)- Returns:
- A modified copy of the
thisobject
-
withType
Copy the current immutable object by setting a value for thetypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type (can benull)- Returns:
- A modified copy of the
thisobject
-
withCustomHeaders
Copy the current immutable object by replacing thecustomHeadersmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the customHeaders map- Returns:
- A modified copy of
thisobject
-
withWorker
Copy the current immutable object by setting a value for theworkerattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for worker (can benull)- Returns:
- A modified copy of the
thisobject
-
withRetries
Copy the current immutable object by setting a value for theretriesattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for retries- Returns:
- A modified copy of the
thisobject
-
withRetryBackoff
Copy the current immutable object by setting a value for theretryBackoffattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for retryBackoff- Returns:
- A modified copy of the
thisobject
-
withRecurringTime
Copy the current immutable object by setting a value for therecurringTimeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for recurringTime- Returns:
- A modified copy of the
thisobject
-
withDeadline
Copy the current immutable object by setting a value for thedeadlineattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for deadline- Returns:
- A modified copy of the
thisobject
-
withTimeout
Copy the current immutable object by setting a value for thetimeoutattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for timeout- Returns:
- A modified copy of the
thisobject
-
withErrorMessage
Copy the current immutable object by setting a value for theerrorMessageattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for errorMessage (can benull)- Returns:
- A modified copy of the
thisobject
-
withErrorCode
Copy the current immutable object by setting a value for theerrorCodeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for errorCode (can benull)- Returns:
- A modified copy of the
thisobject
-
withElementId
Copy the current immutable object by setting a value for theelementIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for elementId (can benull)- Returns:
- A modified copy of the
thisobject
-
withElementInstanceKey
Copy the current immutable object by setting a value for theelementInstanceKeyattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for elementInstanceKey- Returns:
- A modified copy of the
thisobject
-
withBpmnProcessId
Copy the current immutable object by setting a value for thebpmnProcessIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bpmnProcessId (can benull)- Returns:
- A modified copy of the
thisobject
-
withProcessDefinitionVersion
Copy the current immutable object by setting a value for theprocessDefinitionVersionattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for processDefinitionVersion- Returns:
- A modified copy of the
thisobject
-
withProcessDefinitionKey
Copy the current immutable object by setting a value for theprocessDefinitionKeyattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for processDefinitionKey- Returns:
- A modified copy of the
thisobject
-
withJobKind
Copy the current immutable object by setting a value for thejobKindattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for jobKind (can benull)- Returns:
- A modified copy of the
thisobject
-
withJobListenerEventType
Copy the current immutable object by setting a value for thejobListenerEventTypeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for jobListenerEventType (can benull)- Returns:
- A modified copy of the
thisobject
-
withChangedAttributes
Copy the current immutable object with elements that replace the content ofchangedAttributes.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withChangedAttributes
Copy the current immutable object with elements that replace the content ofchangedAttributes. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of changedAttributes elements to set- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableJobRecordValuethat have equal attribute values. -
hashCode
public int hashCode()Returns a lazily computed hash code from attributes:variables,processInstanceKey,tenantId,type,customHeaders,worker,retries,retryBackoff,recurringTime,deadline,timeout,errorMessage,errorCode,elementId,elementInstanceKey,bpmnProcessId,processDefinitionVersion,processDefinitionKey,jobKind,jobListenerEventType,changedAttributes. -
toString
Prints the immutable valueJobRecordValuewith attribute values. -
copyOf
Creates an immutable copy of aJobRecordValuevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable JobRecordValue instance
-
builder
Creates a builder forImmutableJobRecordValue.ImmutableJobRecordValue.builder() .putVariable|putAllVariables(String => Object) //variablesmappings .withProcessInstanceKey(long) // optionalprocessInstanceKey.withTenantId(String | null) // nullabletenantId.withType(String | null) // nullabletype.putCustomHeader|putAllCustomHeaders(String => String) //customHeadersmappings .withWorker(String | null) // nullableworker.withRetries(int) // optionalretries.withRetryBackoff(long) // optionalretryBackoff.withRecurringTime(long) // optionalrecurringTime.withDeadline(long) // optionaldeadline.withTimeout(long) // optionaltimeout.withErrorMessage(String | null) // nullableerrorMessage.withErrorCode(String | null) // nullableerrorCode.withElementId(String | null) // nullableelementId.withElementInstanceKey(long) // optionalelementInstanceKey.withBpmnProcessId(String | null) // nullablebpmnProcessId.withProcessDefinitionVersion(int) // optionalprocessDefinitionVersion.withProcessDefinitionKey(long) // optionalprocessDefinitionKey.withJobKind(io.camunda.zeebe.protocol.record.value.JobKind | null) // nullablejobKind.withJobListenerEventType(io.camunda.zeebe.protocol.record.value.JobListenerEventType | null) // nullablejobListenerEventType.addChangedAttribute|addAllChangedAttributes(String) //changedAttributeselements .build();- Returns:
- A new ImmutableJobRecordValue builder
-