org.postgresql.replication.fluent.physical.PhysicalStreamBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdbc-yugabytedb Show documentation
Show all versions of jdbc-yugabytedb Show documentation
Java JDBC 4.2 (JRE 8+) driver for YugaByte SQL database
/*
* Copyright (c) 2016, PostgreSQL Global Development Group
* See the LICENSE file in the project root for more information.
*/
package org.postgresql.replication.fluent.physical;
import org.postgresql.replication.LogSequenceNumber;
import org.postgresql.replication.PGReplicationStream;
import org.postgresql.replication.fluent.AbstractStreamBuilder;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.sql.SQLException;
public class PhysicalStreamBuilder extends AbstractStreamBuilder
implements ChainedPhysicalStreamBuilder, PhysicalReplicationOptions {
private final StartPhysicalReplicationCallback startCallback;
/**
* @param startCallback not null callback that should be execute after build parameters for start
* replication
*/
public PhysicalStreamBuilder(StartPhysicalReplicationCallback startCallback) {
this.startCallback = startCallback;
}
@Override
protected ChainedPhysicalStreamBuilder self() {
return this;
}
@Override
public PGReplicationStream start() throws SQLException {
return this.startCallback.start(this);
}
@Override
public @Nullable String getSlotName() {
return slotName;
}
@Override
public LogSequenceNumber getStartLSNPosition() {
return startPosition;
}
@Override
public int getStatusInterval() {
return statusIntervalMs;
}
}