Package com.cognite.client.stream
Class AbstractPublisher
java.lang.Object
com.cognite.client.stream.AbstractPublisher
- Direct Known Subclasses:
Publisher,RawPublisher
Abstract superclass for streaming publishers. It holds key constants and variables.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AtomicBooleanprotected static final Durationprotected static final Durationprotected final org.slf4j.Loggerprotected static final Instantprotected static final Durationprotected static final Durationprotected static final Durationprotected static final Durationprotected static final Instantprotected com.cognite.client.stream.AbstractPublisher.State -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
MIN_POLLING_INTERVAL
-
DEFAULT_POLLING_INTERVAL
-
MAX_POLLING_INTERVAL
-
MIN_POLLING_OFFSET
-
DEFAULT_POLLING_OFFSET
-
MAX_POLLING_OFFSET
-
MIN_START_TIME
-
MAX_END_TIME
-
LOG
protected final org.slf4j.Logger LOG -
abortStream
-
state
protected com.cognite.client.stream.AbstractPublisher.State state
-
-
Constructor Details
-
AbstractPublisher
public AbstractPublisher()
-
-
Method Details
-
getPollingInterval
-
getPollingOffset
-
getStartTime
-
getEndTime
-
start
Starts the streaming job. The job is executed on a separate thread and this method will immediately return to the caller. It returns aFuturethat you can use to block the execution of your own code if you want to explicitly wait for completion of the streaming job.- Returns:
- A Future hosting the end state of the streaming job. The future returns
truewhen the polling loop completes (at its specified end time).falseif the job is aborted before the specified end time.
-
abort
public void abort()Aborts the current stream operation. It may take a few seconds for this operation to complete.
-