Class SessionServiceFactory
java.lang.Object
org.apache.beam.sdk.io.solace.broker.SessionServiceFactory
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BasicAuthJcsmpSessionServiceFactory
,GCPSecretSessionServiceFactory
This abstract class serves as a blueprint for creating `SessionServiceFactory` objects. It
introduces a queue property and mandates the implementation of a create() method in concrete
subclasses.
For basic authentication, use BasicAuthJcsmpSessionServiceFactory
.
For other situations, you need to extend this class. Classes extending from this abstract class must implement the `equals` method so two instances can be compared by value, and not by reference. We recommend using AutoValue for that.
{@literal @}AutoValue
public abstract class MyFactory implements SessionServiceClientFactory {
abstract String value1();
abstract String value2();
public static MyFactory create(String value1, String value2) {
return new AutoValue_MyFactory.Builder(value1, value2);
}
...
{@literal @}Override
public SessionService create() {
...
}
}
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract SessionService
create()
This is the core method that subclasses must implement.abstract boolean
You need to override this method to be able to compare these objects by value.getQueue()
Getter for the queue.abstract int
hashCode()
You need to override this method to be able to compare these objects by value.final void
This method is called in theSolaceIO.Read.expand(org.apache.beam.sdk.values.PBegin)
method to set the Queue reference based onSolaceIO.Read.from(Solace.Queue)
orSolaceIO.Read.from(Solace.Topic)
.void
setSubmissionMode
(SolaceIO.SubmissionMode submissionMode) Called by the write connector to set the submission mode used to create the message producers.
-
Constructor Details
-
SessionServiceFactory
public SessionServiceFactory()
-
-
Method Details
-
create
This is the core method that subclasses must implement. It defines how to construct and return a SessionService object. -
setQueue
This method is called in theSolaceIO.Read.expand(org.apache.beam.sdk.values.PBegin)
method to set the Queue reference based onSolaceIO.Read.from(Solace.Queue)
orSolaceIO.Read.from(Solace.Topic)
. The queue can be retrieved in the classes that inheritSessionServiceFactory
with the getter methodgetQueue()
-
getQueue
Getter for the queue. This is nullable, because at the construction time this reference is null. Once the pipeline is compiled and theSolaceIO.Read.expand(org.apache.beam.sdk.values.PBegin)
method is called, this reference is valid.- Returns:
- a reference to the queue which is set with the
SolaceIO.Read.from(Solace.Queue)
orSolaceIO.Read.from(Solace.Topic)
-
equals
You need to override this method to be able to compare these objects by value. We recommend using AutoValue for that. -
hashCode
public abstract int hashCode()You need to override this method to be able to compare these objects by value. We recommend using AutoValue for that. -
setSubmissionMode
Called by the write connector to set the submission mode used to create the message producers. -
getSubmissionMode
-