Top Fields Constructors Methods
org.postgresql.replication.fluent.logical

public Class LogicalStreamBuilder

extends AbstractStreamBuilder<ChainedLogicalStreamBuilder>
implements ChainedLogicalStreamBuilder, LogicalReplicationOptions
Class Inheritance
All Implemented Interfaces
org.postgresql.replication.fluent.logical.LogicalReplicationOptions, org.postgresql.replication.fluent.CommonOptions, org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder, org.postgresql.replication.fluent.ChainedCommonStreamBuilder
Static Imports
org.postgresql.util.internal.Nullness.castNonNull

Field Summary

Modifier and TypeField and Description
private final Properties
private final StartLogicalReplicationCallback
Inherited from org.postgresql.replication.fluent.AbstractStreamBuilder:
slotNamestartPositionstatusIntervalMs

Constructor Summary

AccessConstructor and Description
public
LogicalStreamBuilder(StartLogicalReplicationCallback
not null callback that should be execute after build parameters for start replication
startCallback
)

Method Summary

Modifier and TypeMethod and Description
public @Nullable String
public Properties
public LogSequenceNumber
public int
getStatusInterval()

Implements org.postgresql.replication.fluent.CommonOptions.getStatusInterval.

Specifies the number of millisecond between status packets sent back to the server.

protected ChainedLogicalStreamBuilder
public PGReplicationStream
public ChainedLogicalStreamBuilder
withSlotOption(String
name of option
optionName
,
boolean
boolean value
optionValue
)

Implements org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

public ChainedLogicalStreamBuilder
withSlotOption(String
name of option
optionName
,
int
integer value
optionValue
)

Implements org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

public ChainedLogicalStreamBuilder
public ChainedLogicalStreamBuilder
public ChainedLogicalStreamBuilder
withStartPosition(LogSequenceNumber
not null position from which need start replicate changes
lsn
)

Overrides org.postgresql.replication.fluent.AbstractStreamBuilder.withStartPosition.

Implements org.postgresql.replication.fluent.ChainedCommonStreamBuilder.withStartPosition.

Specify start position from which backend will start stream changes.

Inherited from org.postgresql.replication.fluent.AbstractStreamBuilder:
withSlotNamewithStatusInterval

Field Detail

slotOptionsback to summary
private final Properties slotOptions
startCallbackback to summary
private final StartLogicalReplicationCallback startCallback

Constructor Detail

LogicalStreamBuilderback to summary
public LogicalStreamBuilder(StartLogicalReplicationCallback startCallback)
Parameters
startCallback:StartLogicalReplicationCallback

not null callback that should be execute after build parameters for start replication

Method Detail

getSlotNameback to summary
public @Nullable String getSlotName()

Implements org.postgresql.replication.fluent.logical.LogicalReplicationOptions.getSlotName.

Doc from org.postgresql.replication.fluent.logical.LogicalReplicationOptions.getSlotName.

Required parameter for logical replication.

Returns:@Nullable String

not null logical replication slot name that already exists on server and free.

Annotations
@Override
getSlotOptionsback to summary
public Properties getSlotOptions()

Implements org.postgresql.replication.fluent.logical.LogicalReplicationOptions.getSlotOptions.

Doc from org.postgresql.replication.fluent.logical.LogicalReplicationOptions.getSlotOptions.

Parameters for output plugin. Parameters will be set to output plugin that register for specified replication slot name.

Returns:Properties

list options that will be pass to output_plugin for that was create replication slot

Annotations
@Override
getStartLSNPositionback to summary
public LogSequenceNumber getStartLSNPosition()

Implements org.postgresql.replication.fluent.CommonOptions.getStartLSNPosition.

Returns:LogSequenceNumber

Doc from org.postgresql.replication.fluent.CommonOptions.getStartLSNPosition.

the position to start replication. This cannot be null.

Annotations
@Override
getStatusIntervalback to summary
public int getStatusInterval()

Implements org.postgresql.replication.fluent.CommonOptions.getStatusInterval.

Doc from org.postgresql.replication.fluent.CommonOptions.getStatusInterval.

Specifies the number of millisecond between status packets sent back to the server. This allows for easier monitoring of the progress from server. A value of zero disables the periodic status updates completely, although an update will still be sent when requested by the server, to avoid timeout disconnect. The default value is 10 seconds.

Returns:int

the current status interval

Annotations
@Override
selfback to summary
protected ChainedLogicalStreamBuilder self()

Implements abstract org.postgresql.replication.fluent.AbstractStreamBuilder.self.

Annotations
@Override
startback to summary
public PGReplicationStream start() throws SQLException

Implements org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.start.

Doc from org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.start.

Open logical replication stream.

Returns:PGReplicationStream

not null PGReplicationStream available for fetch data in logical form

Annotations
@Override
Exceptions
SQLException:
if there are errors
withSlotOptionback to summary
public ChainedLogicalStreamBuilder withSlotOption(String optionName, boolean optionValue)

Implements org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

Parameters
optionName:String

Doc from org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

name of option

optionValue:boolean

Doc from org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

boolean value

Returns:ChainedLogicalStreamBuilder

Doc from org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

ChainedLogicalStreamBuilder

Annotations
@Override
withSlotOptionback to summary
public ChainedLogicalStreamBuilder withSlotOption(String optionName, int optionValue)

Implements org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

Parameters
optionName:String

Doc from org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

name of option

optionValue:int

Doc from org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

integer value

Returns:ChainedLogicalStreamBuilder

Doc from org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

ChainedLogicalStreamBuilder

Annotations
@Override
withSlotOptionback to summary
public ChainedLogicalStreamBuilder withSlotOption(String optionName, String optionValue)

Implements org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

Parameters
optionName:String

Doc from org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

name of option

optionValue:String

Doc from org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

String value

Returns:ChainedLogicalStreamBuilder

Doc from org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOption.

ChainedLogicalStreamBuilder

Annotations
@Override
withSlotOptionsback to summary
public ChainedLogicalStreamBuilder withSlotOptions(Properties options)

Implements org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOptions.

Parameters
options:Properties

Doc from org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOptions.

properties

Returns:ChainedLogicalStreamBuilder

Doc from org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder.withSlotOptions.

ChainedLogicalStreamBuilder

Annotations
@Override
withStartPositionback to summary
public ChainedLogicalStreamBuilder withStartPosition(LogSequenceNumber lsn)

Overrides org.postgresql.replication.fluent.AbstractStreamBuilder.withStartPosition.

Implements org.postgresql.replication.fluent.ChainedCommonStreamBuilder.withStartPosition.

Doc from org.postgresql.replication.fluent.ChainedCommonStreamBuilder.withStartPosition.

Specify start position from which backend will start stream changes. If parameter will not specify, streaming starts from restart_lsn. For more details see pg_replication_slots description.

Parameters
lsn:LogSequenceNumber

not null position from which need start replicate changes

Returns:ChainedLogicalStreamBuilder

not null fluent

Annotations
@Override