Class DbFormState
java.lang.Object
io.camunda.zeebe.engine.state.deployment.DbFormState
- All Implemented Interfaces:
FormState
,MutableFormState
-
Constructor Summary
ConstructorsConstructorDescriptionDbFormState
(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, EngineConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Deletes a form from FORM_BY_ID_AND_VERSION column familyvoid
Deletes a form from FORM_KEY_BY_FORM_ID_AND_DEPLOYMENT_KEY column familyvoid
Deletes a form from FORM_KEY_BY_FORM_ID_AND_VERSION_TAG column familyvoid
Deletes a form from FORMS column familyvoid
Deletes a form from FORM_VERSION column familyfindFormByIdAndDeploymentKey
(org.agrona.DirectBuffer formId, long deploymentKey, String tenantId) Query forms by the given form id and deployment key and return the form.findFormByIdAndVersionTag
(org.agrona.DirectBuffer formId, String versionTag, String tenantId) Query forms by the given form id and version tag and return the form.findFormByKey
(long formKey, String tenantId) Query forms by the given form key and return the form.findLatestFormById
(org.agrona.DirectBuffer formId, String tenantId) Query forms by the given form id and return the latest version of the form.int
getNextFormVersion
(String formId, String tenantId) Gets the next version a form of a given id will receive.void
Put the given form in FORM_BY_ID_AND_VERSION column familyvoid
Put the given form in FORMS column familyvoid
Put the given form in FORM_KEY_BY_FORM_ID_AND_DEPLOYMENT_KEY column familyvoid
Put the given form in FORM_KEY_BY_FORM_ID_AND_VERSION_TAG column familyvoid
updateLatestVersion
(FormRecord record) Update the latest version of the form if it is newer.
-
Constructor Details
-
DbFormState
public DbFormState(ZeebeDb<ZbColumnFamilies> zeebeDb, TransactionContext transactionContext, EngineConfiguration config)
-
-
Method Details
-
storeFormInFormColumnFamily
Description copied from interface:MutableFormState
Put the given form in FORMS column family- Specified by:
storeFormInFormColumnFamily
in interfaceMutableFormState
- Parameters:
record
- the record of the form
-
storeFormInFormByIdAndVersionColumnFamily
Description copied from interface:MutableFormState
Put the given form in FORM_BY_ID_AND_VERSION column family- Specified by:
storeFormInFormByIdAndVersionColumnFamily
in interfaceMutableFormState
- Parameters:
record
- the record of the form
-
storeFormInFormKeyByFormIdAndDeploymentKeyColumnFamily
Description copied from interface:MutableFormState
Put the given form in FORM_KEY_BY_FORM_ID_AND_DEPLOYMENT_KEY column family- Specified by:
storeFormInFormKeyByFormIdAndDeploymentKeyColumnFamily
in interfaceMutableFormState
- Parameters:
record
- the record of the form
-
storeFormInFormKeyByFormIdAndVersionTagColumnFamily
Description copied from interface:MutableFormState
Put the given form in FORM_KEY_BY_FORM_ID_AND_VERSION_TAG column family- Specified by:
storeFormInFormKeyByFormIdAndVersionTagColumnFamily
in interfaceMutableFormState
- Parameters:
record
- the record of the form
-
updateLatestVersion
Description copied from interface:MutableFormState
Update the latest version of the form if it is newer.- Specified by:
updateLatestVersion
in interfaceMutableFormState
- Parameters:
record
- the record of the form
-
deleteFormInFormsColumnFamily
Description copied from interface:MutableFormState
Deletes a form from FORMS column family- Specified by:
deleteFormInFormsColumnFamily
in interfaceMutableFormState
- Parameters:
record
- the record of the form that is deleted
-
deleteFormInFormByIdAndVersionColumnFamily
Description copied from interface:MutableFormState
Deletes a form from FORM_BY_ID_AND_VERSION column family- Specified by:
deleteFormInFormByIdAndVersionColumnFamily
in interfaceMutableFormState
- Parameters:
record
- the record of the form that is deleted
-
deleteFormInFormVersionColumnFamily
Description copied from interface:MutableFormState
Deletes a form from FORM_VERSION column family- Specified by:
deleteFormInFormVersionColumnFamily
in interfaceMutableFormState
- Parameters:
record
- the record of the form that is deleted
-
deleteFormInFormKeyByFormIdAndDeploymentKeyColumnFamily
Description copied from interface:MutableFormState
Deletes a form from FORM_KEY_BY_FORM_ID_AND_DEPLOYMENT_KEY column family- Specified by:
deleteFormInFormKeyByFormIdAndDeploymentKeyColumnFamily
in interfaceMutableFormState
- Parameters:
record
- the record of the form that is deleted
-
deleteFormInFormKeyByFormIdAndVersionTagColumnFamily
Description copied from interface:MutableFormState
Deletes a form from FORM_KEY_BY_FORM_ID_AND_VERSION_TAG column family- Specified by:
deleteFormInFormKeyByFormIdAndVersionTagColumnFamily
in interfaceMutableFormState
- Parameters:
record
- the record of the form that is deleted
-
findLatestFormById
Description copied from interface:FormState
Query forms by the given form id and return the latest version of the form.- Specified by:
findLatestFormById
in interfaceFormState
- Parameters:
formId
- the id of the formtenantId
- the id of the tenant- Returns:
- the latest version of the form, or
Optional.empty()
if no form is deployed with the given id
-
findFormByKey
Description copied from interface:FormState
Query forms by the given form key and return the form.- Specified by:
findFormByKey
in interfaceFormState
- Parameters:
formKey
- the key of the formtenantId
- the id of the tenant- Returns:
- the form, or
Optional.empty()
if no form is deployed with the given key
-
findFormByIdAndDeploymentKey
public Optional<PersistedForm> findFormByIdAndDeploymentKey(org.agrona.DirectBuffer formId, long deploymentKey, String tenantId) Description copied from interface:FormState
Query forms by the given form id and deployment key and return the form.- Specified by:
findFormByIdAndDeploymentKey
in interfaceFormState
- Parameters:
formId
- the id of the formdeploymentKey
- the key of the deployment the form was deployed withtenantId
- the id of the tenant- Returns:
- the form, or
Optional.empty()
if no form with the given id was deployed with the given deployment
-
findFormByIdAndVersionTag
public Optional<PersistedForm> findFormByIdAndVersionTag(org.agrona.DirectBuffer formId, String versionTag, String tenantId) Description copied from interface:FormState
Query forms by the given form id and version tag and return the form.- Specified by:
findFormByIdAndVersionTag
in interfaceFormState
- Parameters:
formId
- the id of the formversionTag
- the version tag of the formtenantId
- the id of the tenant- Returns:
- the form, or
Optional.empty()
if no form with the given id and version tag is deployed
-
getNextFormVersion
Description copied from interface:FormState
Gets the next version a form of a given id will receive. This is used, for example, when a new deployment is done. Using this method we decide the version the newly deployed form receives.- Specified by:
getNextFormVersion
in interfaceFormState
- Parameters:
formId
- the id of the form
-
clearCache
public void clearCache()- Specified by:
clearCache
in interfaceFormState
-