Class OlrNetworkClient
java.lang.Object
io.debezium.connector.oracle.olr.client.OlrNetworkClient
An OpenLogReplicator network client that communicates using JSON streaming payloads.
- Author:
- Chris Cranford
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SocketChannelprivate final Stringprivate static final org.slf4j.Loggerprivate final com.fasterxml.jackson.databind.ObjectMapperprivate final intprivate longprivate booleanprivate final Stringprivate Scn -
Constructor Summary
ConstructorsConstructorDescriptionOlrNetworkClient(OracleConnectorConfig connectorConfig) Create the OpenLogReplicator network client. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidvoidbooleanConnect to the OpenLogReplicator process.createRequest(OpenLogReplicatorProtocol.RequestCode requestCode) voidDisconnect from the OpenLogReplicator network service.private voidfillBuffer(ByteBuffer buffer) booleanReturns whether the network client is connected to the OpenLogReplicator process.private ByteBufferread()A blocking call that reads the next streaming event from the OpenLogReplicator process.private StreamingEventprivate StreamingEventprivate intprivate boolean
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
mapper
private final com.fasterxml.jackson.databind.ObjectMapper mapper -
hostName
-
port
private final int port -
sourceName
-
channel
-
skipToStartScn
private boolean skipToStartScn -
startScn
-
prevScn
private long prevScn
-
-
Constructor Details
-
OlrNetworkClient
Create the OpenLogReplicator network client.- Parameters:
connectorConfig- connector configuration
-
-
Method Details
-
connect
Connect to the OpenLogReplicator process.- Parameters:
scn- the checkpoint commit to begin streaming fromindex- the checkpoint commit sequence index to begin streaming from- Returns:
- true if the connection was established, false if the connection failed
-
disconnect
public void disconnect()Disconnect from the OpenLogReplicator network service. -
isConnected
public boolean isConnected()Returns whether the network client is connected to the OpenLogReplicator process.- Returns:
- true if the client is connected, false otherwise.
-
readEvent
A blocking call that reads the next streaming event from the OpenLogReplicator process.- Returns:
- the streaming event
- Throws:
OlrNetworkClientException
-
confirm
-
readNextEventWithStartScnSkip
-
readNextEvent
-
confirm
-
startFrom
-
createRequest
private OpenLogReplicatorProtocol.RedoRequest.Builder createRequest(OpenLogReplicatorProtocol.RequestCode requestCode) -
readResponse
-
read
-
send
-
fillBuffer
-