content: /**
   * DBSyncer Copyright 2020-2023 All Rights Reserved.
   */
  package org.dbsyncer.connector.postgresql.decoder;
  
  import org.dbsyncer.sdk.config.DatabaseConfig;
  import org.dbsyncer.sdk.connector.database.DatabaseConnectorInstance;
  import org.dbsyncer.sdk.listener.event.RowChangedEvent;
  import org.dbsyncer.sdk.spi.ConnectorService;
  import org.postgresql.replication.LogSequenceNumber;
  import org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder;
  
  import java.nio.ByteBuffer;
  
  /**
   * @Author AE86
   * @Version 1.0.0
   * @Date 2022-04-10 22:36
   */
  public interface MessageDecoder {
  
      default void postProcessBeforeInitialization(ConnectorService connectorService, DatabaseConnectorInstance connectorInstance) {
      }
  
      boolean skipMessage(ByteBuffer buffer, LogSequenceNumber startLsn, LogSequenceNumber lastReceiveLsn);
  
      RowChangedEvent processMessage(ByteBuffer buffer);
  
      String getSlotName();
  
      String getOutputPlugin();
  
      void withSlotOption(ChainedLogicalStreamBuilder builder);
  
      void setMetaId(String metaId);
  
      void setConfig(DatabaseConfig config);
  
  }