Class TenantCdcClient

java.lang.Object
com.dtsx.astra.sdk.AbstractApiClient
com.dtsx.astra.sdk.streaming.TenantCdcClient

public class TenantCdcClient extends AbstractApiClient
Operations to work with Cdc in a tenant.
  • Constructor Details

    • TenantCdcClient

      public TenantCdcClient(String token, String tenantId)
      As immutable object use builder to initiate the object.
      Parameters:
      token - authenticated token
    • TenantCdcClient

      public TenantCdcClient(String token, ApiLocator.AstraEnvironment env, String tenantId)
      As immutable object use builder to initiate the object.
      Parameters:
      env - define target environment to be used
      token - authenticated token
      tenantId - tenantId
  • Method Details

    • create

      public void create(String databaseId, String keyspace, String table, int topicPartition)
      Create a Cdc.
      Parameters:
      databaseId - database identifier
      keyspace - keyspace identifier
      table - table identifier
      topicPartition - partition in token
    • delete

      public void delete(String databaseId, String keyspace, String table)
      Delete a cdc.
      Parameters:
      databaseId - database identifier
      keyspace - keyspace name
      table - table name
    • list

      public Stream<CdcDefinition> list()
      Access CDC of a tenant.
      Returns:
      list of cdc.
    • findCdcById

      public Optional<CdcDefinition> findCdcById(String cdcId)
      Find a cdc by its id.
      Parameters:
      cdcId - identifier
      Returns:
      cdc definition if exist
    • findCdcByDefinition

      public Optional<CdcDefinition> findCdcByDefinition(String keyspace, String table, String databaseIdentifier)
      Find the cdc based on its components.
      Parameters:
      keyspace - keyspace name
      table - table name
      databaseIdentifier - database identifier
      Returns:
      definition if present
    • getEndpointTenantCdc

      public String getEndpointTenantCdc()
      Access Cdc endpoint.
      Returns:
      cdc endpoint