Interface PulsarClientImplementationBinding
-
public interface PulsarClientImplementationBinding
Helper class for class instantiations and it also contains methods to work with schemas. This interface allows you to not depend on the Implementation classes directly. The actual implementation of this class is loaded fromDefaultImplementation
.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
convertKeyValueDataStringToSchemaInfoSchema(byte[] keyValueSchemaInfoDataJsonBytes)
Convert the key/value schema info data json bytes to key/value schema info data bytes.java.lang.String
convertKeyValueSchemaInfoDataToString(KeyValue<SchemaInfo,SchemaInfo> kvSchemaInfo)
Convert the key/value schema data.Authentication
createAuthentication(java.lang.String authPluginClassName, java.lang.String authParamsString)
Authentication
createAuthentication(java.lang.String authPluginClassName, java.util.Map<java.lang.String,java.lang.String> authParams)
KeyValueEncodingType
decodeKeyValueEncodingType(SchemaInfo schemaInfo)
Decode the kv encoding type from the schema info.KeyValue<SchemaInfo,SchemaInfo>
decodeKeyValueSchemaInfo(SchemaInfo schemaInfo)
Decode the key/value schema info to get key schema info and value schema info.<K,V>
SchemaInfoencodeKeyValueSchemaInfo(java.lang.String schemaName, Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.<K,V>
SchemaInfoencodeKeyValueSchemaInfo(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.static byte[]
getBytes(java.nio.ByteBuffer byteBuffer)
Retrieves ByteBuffer data into byte[].GenericSchema<GenericRecord>
getGenericSchema(SchemaInfo schemaInfo)
Schema<?>
getSchema(SchemaInfo schemaInfo)
java.lang.String
jsonifyKeyValueSchemaInfo(KeyValue<SchemaInfo,SchemaInfo> kvSchemaInfo)
Jsonify the key/value schema info.java.lang.String
jsonifySchemaInfo(SchemaInfo schemaInfo)
Jsonify the schema info.java.lang.String
jsonifySchemaInfoWithVersion(SchemaInfoWithVersion schemaInfoWithVersion)
Jsonify the schema info with version.Authentication
newAuthenticationTLS(java.lang.String certFilePath, java.lang.String keyFilePath)
Authentication
newAuthenticationToken(java.lang.String token)
Authentication
newAuthenticationToken(java.util.function.Supplier<java.lang.String> supplier)
Schema<GenericRecord>
newAutoConsumeSchema()
Schema<byte[]>
newAutoProduceSchema()
Schema<byte[]>
newAutoProduceSchema(Schema<?> schema)
Schema<byte[]>
newAutoProduceValidatedAvroSchema(java.lang.Object schema)
<T> Schema<T>
newAvroSchema(SchemaDefinition schemaDefinition)
Schema<java.lang.Boolean>
newBooleanSchema()
Schema<java.nio.ByteBuffer>
newByteBufferSchema()
Schema<java.lang.Byte>
newByteSchema()
Schema<byte[]>
newBytesSchema()
ClientBuilder
newClientBuilder()
Schema<java.util.Date>
newDateSchema()
BatcherBuilder
newDefaultBatcherBuilder()
MessagePayloadFactory
newDefaultMessagePayloadFactory()
Schema<java.lang.Double>
newDoubleSchema()
Schema<java.lang.Float>
newFloatSchema()
Schema<java.time.Instant>
newInstantSchema()
Schema<java.lang.Integer>
newIntSchema()
<T> Schema<T>
newJSONSchema(SchemaDefinition schemaDefinition)
BatcherBuilder
newKeyBasedBatcherBuilder()
Schema<KeyValue<byte[],byte[]>>
newKeyValueBytesSchema()
<K,V>
Schema<KeyValue<K,V>>newKeyValueSchema(java.lang.Class<K> key, java.lang.Class<V> value, SchemaType type)
<K,V>
Schema<KeyValue<K,V>>newKeyValueSchema(Schema<K> keySchema, Schema<V> valueSchema)
<K,V>
Schema<KeyValue<K,V>>newKeyValueSchema(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType)
Schema<java.time.LocalDate>
newLocalDateSchema()
Schema<java.time.LocalDateTime>
newLocalDateTimeSchema()
Schema<java.time.LocalTime>
newLocalTimeSchema()
Schema<java.lang.Long>
newLongSchema()
MessageId
newMessageId(long ledgerId, long entryId, int partitionIndex)
MessageId
newMessageIdFromByteArray(byte[] data)
MessageId
newMessageIdFromByteArrayWithTopic(byte[] data, java.lang.String topicName)
<T extends com.google.protobuf.GeneratedMessageV3>
Schema<T>newProtobufNativeSchema(SchemaDefinition schemaDefinition)
<T extends com.google.protobuf.GeneratedMessageV3>
Schema<T>newProtobufSchema(SchemaDefinition schemaDefinition)
RecordSchemaBuilder
newRecordSchemaBuilder(java.lang.String name)
<T> SchemaDefinitionBuilder<T>
newSchemaDefinitionBuilder()
SchemaInfo
newSchemaInfoImpl(java.lang.String name, byte[] schema, SchemaType type, java.util.Map<java.lang.String,java.lang.String> propertiesValue)
Schema<java.lang.Short>
newShortSchema()
Schema<java.lang.String>
newStringSchema()
Schema<java.lang.String>
newStringSchema(java.nio.charset.Charset charset)
Schema<java.sql.Time>
newTimeSchema()
Schema<java.sql.Timestamp>
newTimestampSchema()
-
-
-
Method Detail
-
newSchemaDefinitionBuilder
<T> SchemaDefinitionBuilder<T> newSchemaDefinitionBuilder()
-
newClientBuilder
ClientBuilder newClientBuilder()
-
newMessageId
MessageId newMessageId(long ledgerId, long entryId, int partitionIndex)
-
newMessageIdFromByteArray
MessageId newMessageIdFromByteArray(byte[] data) throws java.io.IOException
- Throws:
java.io.IOException
-
newMessageIdFromByteArrayWithTopic
MessageId newMessageIdFromByteArrayWithTopic(byte[] data, java.lang.String topicName) throws java.io.IOException
- Throws:
java.io.IOException
-
newAuthenticationToken
Authentication newAuthenticationToken(java.lang.String token)
-
newAuthenticationToken
Authentication newAuthenticationToken(java.util.function.Supplier<java.lang.String> supplier)
-
newAuthenticationTLS
Authentication newAuthenticationTLS(java.lang.String certFilePath, java.lang.String keyFilePath)
-
createAuthentication
Authentication createAuthentication(java.lang.String authPluginClassName, java.lang.String authParamsString) throws PulsarClientException.UnsupportedAuthenticationException
-
createAuthentication
Authentication createAuthentication(java.lang.String authPluginClassName, java.util.Map<java.lang.String,java.lang.String> authParams) throws PulsarClientException.UnsupportedAuthenticationException
-
newBytesSchema
Schema<byte[]> newBytesSchema()
-
newStringSchema
Schema<java.lang.String> newStringSchema()
-
newStringSchema
Schema<java.lang.String> newStringSchema(java.nio.charset.Charset charset)
-
newByteSchema
Schema<java.lang.Byte> newByteSchema()
-
newShortSchema
Schema<java.lang.Short> newShortSchema()
-
newIntSchema
Schema<java.lang.Integer> newIntSchema()
-
newLongSchema
Schema<java.lang.Long> newLongSchema()
-
newBooleanSchema
Schema<java.lang.Boolean> newBooleanSchema()
-
newByteBufferSchema
Schema<java.nio.ByteBuffer> newByteBufferSchema()
-
newFloatSchema
Schema<java.lang.Float> newFloatSchema()
-
newDoubleSchema
Schema<java.lang.Double> newDoubleSchema()
-
newDateSchema
Schema<java.util.Date> newDateSchema()
-
newTimeSchema
Schema<java.sql.Time> newTimeSchema()
-
newTimestampSchema
Schema<java.sql.Timestamp> newTimestampSchema()
-
newInstantSchema
Schema<java.time.Instant> newInstantSchema()
-
newLocalDateSchema
Schema<java.time.LocalDate> newLocalDateSchema()
-
newLocalTimeSchema
Schema<java.time.LocalTime> newLocalTimeSchema()
-
newLocalDateTimeSchema
Schema<java.time.LocalDateTime> newLocalDateTimeSchema()
-
newAvroSchema
<T> Schema<T> newAvroSchema(SchemaDefinition schemaDefinition)
-
newProtobufSchema
<T extends com.google.protobuf.GeneratedMessageV3> Schema<T> newProtobufSchema(SchemaDefinition schemaDefinition)
-
newProtobufNativeSchema
<T extends com.google.protobuf.GeneratedMessageV3> Schema<T> newProtobufNativeSchema(SchemaDefinition schemaDefinition)
-
newJSONSchema
<T> Schema<T> newJSONSchema(SchemaDefinition schemaDefinition)
-
newAutoConsumeSchema
Schema<GenericRecord> newAutoConsumeSchema()
-
newAutoProduceSchema
Schema<byte[]> newAutoProduceSchema()
-
newAutoProduceValidatedAvroSchema
Schema<byte[]> newAutoProduceValidatedAvroSchema(java.lang.Object schema)
-
newKeyValueSchema
<K,V> Schema<KeyValue<K,V>> newKeyValueSchema(Schema<K> keySchema, Schema<V> valueSchema)
-
newKeyValueSchema
<K,V> Schema<KeyValue<K,V>> newKeyValueSchema(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType)
-
newKeyValueSchema
<K,V> Schema<KeyValue<K,V>> newKeyValueSchema(java.lang.Class<K> key, java.lang.Class<V> value, SchemaType type)
-
getSchema
Schema<?> getSchema(SchemaInfo schemaInfo)
-
getGenericSchema
GenericSchema<GenericRecord> getGenericSchema(SchemaInfo schemaInfo)
-
newRecordSchemaBuilder
RecordSchemaBuilder newRecordSchemaBuilder(java.lang.String name)
-
decodeKeyValueEncodingType
KeyValueEncodingType decodeKeyValueEncodingType(SchemaInfo schemaInfo)
Decode the kv encoding type from the schema info.- Parameters:
schemaInfo
- the schema info- Returns:
- the kv encoding type
-
encodeKeyValueSchemaInfo
<K,V> SchemaInfo encodeKeyValueSchemaInfo(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.- Parameters:
keySchema
- the key schemavalueSchema
- the value schemakeyValueEncodingType
- the encoding type to encode and decode key value pair- Returns:
- the final schema info
-
encodeKeyValueSchemaInfo
<K,V> SchemaInfo encodeKeyValueSchemaInfo(java.lang.String schemaName, Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType)
Encode key & value into schema into a KeyValue schema.- Parameters:
schemaName
- the final schema namekeySchema
- the key schemavalueSchema
- the value schemakeyValueEncodingType
- the encoding type to encode and decode key value pair- Returns:
- the final schema info
-
decodeKeyValueSchemaInfo
KeyValue<SchemaInfo,SchemaInfo> decodeKeyValueSchemaInfo(SchemaInfo schemaInfo)
Decode the key/value schema info to get key schema info and value schema info.- Parameters:
schemaInfo
- key/value schema info.- Returns:
- the pair of key schema info and value schema info
-
jsonifySchemaInfo
java.lang.String jsonifySchemaInfo(SchemaInfo schemaInfo)
Jsonify the schema info.- Parameters:
schemaInfo
- the schema info- Returns:
- the jsonified schema info
-
jsonifySchemaInfoWithVersion
java.lang.String jsonifySchemaInfoWithVersion(SchemaInfoWithVersion schemaInfoWithVersion)
Jsonify the schema info with version.- Parameters:
schemaInfoWithVersion
- the schema info with version- Returns:
- the jsonified schema info with version
-
jsonifyKeyValueSchemaInfo
java.lang.String jsonifyKeyValueSchemaInfo(KeyValue<SchemaInfo,SchemaInfo> kvSchemaInfo)
Jsonify the key/value schema info.- Parameters:
kvSchemaInfo
- the key/value schema info- Returns:
- the jsonified schema info
-
convertKeyValueSchemaInfoDataToString
java.lang.String convertKeyValueSchemaInfoDataToString(KeyValue<SchemaInfo,SchemaInfo> kvSchemaInfo) throws java.io.IOException
Convert the key/value schema data.- Parameters:
kvSchemaInfo
- the key/value schema info- Returns:
- the convert key/value schema data string
- Throws:
java.io.IOException
-
convertKeyValueDataStringToSchemaInfoSchema
byte[] convertKeyValueDataStringToSchemaInfoSchema(byte[] keyValueSchemaInfoDataJsonBytes) throws java.io.IOException
Convert the key/value schema info data json bytes to key/value schema info data bytes.- Parameters:
keyValueSchemaInfoDataJsonBytes
- the key/value schema info data json bytes- Returns:
- the key/value schema info data bytes
- Throws:
java.io.IOException
-
newDefaultBatcherBuilder
BatcherBuilder newDefaultBatcherBuilder()
-
newKeyBasedBatcherBuilder
BatcherBuilder newKeyBasedBatcherBuilder()
-
newDefaultMessagePayloadFactory
MessagePayloadFactory newDefaultMessagePayloadFactory()
-
getBytes
static byte[] getBytes(java.nio.ByteBuffer byteBuffer)
Retrieves ByteBuffer data into byte[].- Parameters:
byteBuffer
-- Returns:
-
newSchemaInfoImpl
SchemaInfo newSchemaInfoImpl(java.lang.String name, byte[] schema, SchemaType type, java.util.Map<java.lang.String,java.lang.String> propertiesValue)
-
-