Package org.postgresql.replication.fluent

# Class ReplicationCreateSlotBuilder

java.lang.Object
org.postgresql.replication.fluent.ReplicationCreateSlotBuilder

All Implemented Interfaces:
  `ChainedCreateReplicationSlotBuilder`

public class ReplicationCreateSlotBuilder extends Object implements ChainedCreateReplicationSlotBuilder

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReplicationCreateSlotBuilder(BaseConnection baseConnection)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ChainedLogicalCreateSlotBuilder`
  `logical()`
  Get the logical slot builder.
  `ChainedPhysicalCreateSlotBuilder`
  `physical()`
  Create physical replication stream for process wal logs in binary form.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ReplicationCreateSlotBuilder

    public ReplicationCreateSlotBuilder(BaseConnection baseConnection)

- ## Method Details

  - ### logical

    public ChainedLogicalCreateSlotBuilder logical()
    Description copied from interface: `ChainedCreateReplicationSlotBuilder`
    Get the logical slot builder. Example usage:

            pgConnection
                .getReplicationAPI()
                .createReplicationSlot()
                .logical()
                .withSlotName("mySlot")
                .withOutputPlugin("test_decoding")
                .make();

            PGReplicationStream stream =
                pgConnection
                    .getReplicationAPI()
                    .replicationStream()
                    .logical()
                    .withSlotName("mySlot")
                    .withSlotOption("include-xids", false)
                    .withSlotOption("skip-empty-xacts", true)
                    .start();

            while (true) {
              ByteBuffer buffer = stream.read();
              //process logical changes
            }

    Specified by:
      `logical` in interface `ChainedCreateReplicationSlotBuilder`
    Returns:
      not null fluent api

  - ### physical

    public ChainedPhysicalCreateSlotBuilder physical()
    Description copied from interface: `ChainedCreateReplicationSlotBuilder`
    Create physical replication stream for process wal logs in binary form.

    Example usage:

            pgConnection
                .getReplicationAPI()
                .createReplicationSlot()
                .physical()
                .withSlotName("mySlot")
                .make();

            PGReplicationStream stream =
                pgConnection
                    .getReplicationAPI()
                    .replicationStream()
                    .physical()
                    .withSlotName("mySlot")
                    .start();

            while (true) {
              ByteBuffer buffer = stream.read();
              //process binary WAL logs
            }

    Specified by:
      `physical` in interface `ChainedCreateReplicationSlotBuilder`
    Returns:
      not null fluent api