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 from
DefaultImplementation
.-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
convertKeyValueDataStringToSchemaInfoSchema
(byte[] keyValueSchemaInfoDataJsonBytes) Convert the key/value schema info data json bytes to key/value schema info data bytes.convertKeyValueSchemaInfoDataToString
(KeyValue<SchemaInfo, SchemaInfo> kvSchemaInfo) Convert the key/value schema data.createAuthentication
(String authPluginClassName, String authParamsString) createAuthentication
(String authPluginClassName, Map<String, String> authParams) decodeKeyValueEncodingType
(SchemaInfo schemaInfo) Decode the kv encoding type from the schema info.decodeKeyValueSchemaInfo
(SchemaInfo schemaInfo) Decode the key/value schema info to get key schema info and value schema info.<K,
V> SchemaInfo encodeKeyValueSchemaInfo
(String schemaName, Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) Encode key & value into schema into a KeyValue schema.<K,
V> SchemaInfo encodeKeyValueSchemaInfo
(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) Encode key & value into schema into a KeyValue schema.static byte[]
getBytes
(ByteBuffer byteBuffer) Retrieves ByteBuffer data into byte[].getGenericSchema
(SchemaInfo schemaInfo) Schema<?>
getSchema
(SchemaInfo schemaInfo) jsonifyKeyValueSchemaInfo
(KeyValue<SchemaInfo, SchemaInfo> kvSchemaInfo) Jsonify the key/value schema info.jsonifySchemaInfo
(SchemaInfo schemaInfo) Jsonify the schema info.jsonifySchemaInfoWithVersion
(SchemaInfoWithVersion schemaInfoWithVersion) Jsonify the schema info with version.newAuthenticationTLS
(String certFilePath, String keyFilePath) newAuthenticationToken
(String token) newAuthenticationToken
(Supplier<String> supplier) Schema<byte[]>
Schema<byte[]>
newAutoProduceSchema
(Schema<?> schema) Schema<byte[]>
<T> Schema<T>
newAvroSchema
(SchemaDefinition schemaDefinition) Schema<byte[]>
<T> Schema<T>
newJSONSchema
(SchemaDefinition schemaDefinition) newKeyValueSchema
(Class<K> key, Class<V> value, SchemaType type) newKeyValueSchema
(Schema<K> keySchema, Schema<V> valueSchema) newKeyValueSchema
(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) newMessageId
(long ledgerId, long entryId, int partitionIndex) newMessageIdFromByteArray
(byte[] data) newMessageIdFromByteArrayWithTopic
(byte[] data, String topicName) <T extends com.google.protobuf.GeneratedMessageV3>
Schema<T>newProtobufNativeSchema
(SchemaDefinition schemaDefinition) <T extends com.google.protobuf.GeneratedMessageV3>
Schema<T>newProtobufSchema
(SchemaDefinition schemaDefinition) newRecordSchemaBuilder
(String name) <T> SchemaDefinitionBuilder<T>
newSchemaInfoImpl
(String name, byte[] schema, SchemaType type, long timestamp, Map<String, String> propertiesValue) newStringSchema
(Charset charset)
-
Method Details
-
newSchemaDefinitionBuilder
-
newClientBuilder
ClientBuilder newClientBuilder() -
newMessageId
-
newMessageIdFromByteArray
- Throws:
IOException
-
newMessageIdFromByteArrayWithTopic
- Throws:
IOException
-
newAuthenticationToken
-
newAuthenticationToken
-
newAuthenticationTLS
-
createAuthentication
Authentication createAuthentication(String authPluginClassName, String authParamsString) throws PulsarClientException.UnsupportedAuthenticationException -
createAuthentication
Authentication createAuthentication(String authPluginClassName, Map<String, String> authParams) throws PulsarClientException.UnsupportedAuthenticationException -
newBytesSchema
Schema<byte[]> newBytesSchema() -
newStringSchema
-
newStringSchema
-
newByteSchema
-
newShortSchema
-
newIntSchema
-
newLongSchema
-
newBooleanSchema
-
newByteBufferSchema
Schema<ByteBuffer> newByteBufferSchema() -
newFloatSchema
-
newDoubleSchema
-
newDateSchema
-
newTimeSchema
-
newTimestampSchema
-
newInstantSchema
-
newLocalDateSchema
-
newLocalTimeSchema
-
newLocalDateTimeSchema
Schema<LocalDateTime> newLocalDateTimeSchema() -
newAvroSchema
-
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
-
newAutoConsumeSchema
Schema<GenericRecord> newAutoConsumeSchema() -
newAutoProduceSchema
Schema<byte[]> newAutoProduceSchema() -
newAutoProduceSchema
-
newAutoProduceValidatedAvroSchema
-
newKeyValueBytesSchema
-
newKeyValueSchema
-
newKeyValueSchema
<K,V> Schema<KeyValue<K,V>> newKeyValueSchema(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) -
newKeyValueSchema
-
getSchema
-
getGenericSchema
-
newRecordSchemaBuilder
-
decodeKeyValueEncodingType
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(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
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
Jsonify the schema info.- Parameters:
schemaInfo
- the schema info- Returns:
- the jsonified schema info
-
jsonifySchemaInfoWithVersion
Jsonify the schema info with version.- Parameters:
schemaInfoWithVersion
- the schema info with version- Returns:
- the jsonified schema info with version
-
jsonifyKeyValueSchemaInfo
Jsonify the key/value schema info.- Parameters:
kvSchemaInfo
- the key/value schema info- Returns:
- the jsonified schema info
-
convertKeyValueSchemaInfoDataToString
String convertKeyValueSchemaInfoDataToString(KeyValue<SchemaInfo, SchemaInfo> kvSchemaInfo) throws IOExceptionConvert the key/value schema data.- Parameters:
kvSchemaInfo
- the key/value schema info- Returns:
- the convert key/value schema data string
- Throws:
IOException
-
convertKeyValueDataStringToSchemaInfoSchema
byte[] convertKeyValueDataStringToSchemaInfoSchema(byte[] keyValueSchemaInfoDataJsonBytes) throws 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:
IOException
-
newDefaultBatcherBuilder
BatcherBuilder newDefaultBatcherBuilder() -
newKeyBasedBatcherBuilder
BatcherBuilder newKeyBasedBatcherBuilder() -
newDefaultMessagePayloadFactory
MessagePayloadFactory newDefaultMessagePayloadFactory() -
getBytes
Retrieves ByteBuffer data into byte[].- Parameters:
byteBuffer
-- Returns:
-
newSchemaInfoImpl
SchemaInfo newSchemaInfoImpl(String name, byte[] schema, SchemaType type, long timestamp, Map<String, String> propertiesValue)
-