Package org.apache.pulsar.client.impl
Class PulsarClientImplementationBindingImpl
java.lang.Object
org.apache.pulsar.client.impl.PulsarClientImplementationBindingImpl
- All Implemented Interfaces:
org.apache.pulsar.client.internal.PulsarClientImplementationBinding
public final class PulsarClientImplementationBindingImpl
extends Object
implements org.apache.pulsar.client.internal.PulsarClientImplementationBinding
Helper class for class instantiations and it also contains methods to work with schemas.
-
Constructor Summary
Constructors -
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(org.apache.pulsar.common.schema.KeyValue<org.apache.pulsar.common.schema.SchemaInfo, org.apache.pulsar.common.schema.SchemaInfo> kvSchemaInfo) Convert the key/value schema data.org.apache.pulsar.client.api.AuthenticationcreateAuthentication(String authPluginClassName, String authParamsString) org.apache.pulsar.client.api.AuthenticationcreateAuthentication(String authPluginClassName, Map<String, String> authParams) org.apache.pulsar.common.schema.KeyValueEncodingTypedecodeKeyValueEncodingType(org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Decode the kv encoding type from the schema info.org.apache.pulsar.common.schema.KeyValue<org.apache.pulsar.common.schema.SchemaInfo,org.apache.pulsar.common.schema.SchemaInfo> decodeKeyValueSchemaInfo(org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Decode the key/value schema info to get key schema info and value schema info.<K,V> org.apache.pulsar.common.schema.SchemaInfo encodeKeyValueSchemaInfo(String schemaName, org.apache.pulsar.client.api.Schema<K> keySchema, org.apache.pulsar.client.api.Schema<V> valueSchema, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType) Encode key & value into schema into a KeyValue schema.<K,V> org.apache.pulsar.common.schema.SchemaInfo encodeKeyValueSchemaInfo(org.apache.pulsar.client.api.Schema<K> keySchema, org.apache.pulsar.client.api.Schema<V> valueSchema, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType) Encode key & value into schema into a KeyValue schema.org.apache.pulsar.client.api.schema.GenericSchema<org.apache.pulsar.client.api.schema.GenericRecord>getGenericSchema(org.apache.pulsar.common.schema.SchemaInfo schemaInfo) org.apache.pulsar.client.api.Schema<?>getSchema(org.apache.pulsar.common.schema.SchemaInfo schemaInfo) jsonifyKeyValueSchemaInfo(org.apache.pulsar.common.schema.KeyValue<org.apache.pulsar.common.schema.SchemaInfo, org.apache.pulsar.common.schema.SchemaInfo> kvSchemaInfo) Jsonify the key/value schema info.jsonifySchemaInfo(org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Jsonify the schema info.jsonifySchemaInfoWithVersion(org.apache.pulsar.common.schema.SchemaInfoWithVersion schemaInfoWithVersion) Jsonify the schema info with version.org.apache.pulsar.client.api.AuthenticationnewAuthenticationTLS(String certFilePath, String keyFilePath) org.apache.pulsar.client.api.AuthenticationnewAuthenticationToken(String token) org.apache.pulsar.client.api.AuthenticationnewAuthenticationToken(Supplier<String> supplier) org.apache.pulsar.client.api.Schema<org.apache.pulsar.client.api.schema.GenericRecord>org.apache.pulsar.client.api.Schema<byte[]>org.apache.pulsar.client.api.Schema<byte[]>newAutoProduceSchema(org.apache.pulsar.client.api.Schema<?> schema) org.apache.pulsar.client.api.Schema<byte[]><T> org.apache.pulsar.client.api.Schema<T>newAvroSchema(org.apache.pulsar.client.api.schema.SchemaDefinition schemaDefinition) org.apache.pulsar.client.api.Schema<Boolean>org.apache.pulsar.client.api.Schema<ByteBuffer>org.apache.pulsar.client.api.Schema<Byte>org.apache.pulsar.client.api.Schema<byte[]>org.apache.pulsar.client.api.ClientBuilderorg.apache.pulsar.client.api.Schema<Date>org.apache.pulsar.client.api.BatcherBuilderorg.apache.pulsar.client.api.MessagePayloadFactoryorg.apache.pulsar.client.api.Schema<Double>org.apache.pulsar.client.api.Schema<Float>org.apache.pulsar.client.api.Schema<Instant>org.apache.pulsar.client.api.Schema<Integer><T> org.apache.pulsar.client.api.Schema<T>newJSONSchema(org.apache.pulsar.client.api.schema.SchemaDefinition schemaDefinition) org.apache.pulsar.client.api.BatcherBuilderorg.apache.pulsar.client.api.Schema<org.apache.pulsar.common.schema.KeyValue<byte[],byte[]>> <K,V> org.apache.pulsar.client.api.Schema<org.apache.pulsar.common.schema.KeyValue<K, V>> newKeyValueSchema(Class<K> key, Class<V> value, org.apache.pulsar.common.schema.SchemaType type) <K,V> org.apache.pulsar.client.api.Schema<org.apache.pulsar.common.schema.KeyValue<K, V>> newKeyValueSchema(org.apache.pulsar.client.api.Schema<K> keySchema, org.apache.pulsar.client.api.Schema<V> valueSchema, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType) org.apache.pulsar.client.api.Schema<LocalDate>org.apache.pulsar.client.api.Schema<LocalDateTime>org.apache.pulsar.client.api.Schema<LocalTime>org.apache.pulsar.client.api.Schema<Long>org.apache.pulsar.client.api.MessageIdnewMessageId(long ledgerId, long entryId, int partitionIndex) org.apache.pulsar.client.api.MessageIdnewMessageIdFromByteArray(byte[] data) org.apache.pulsar.client.api.MessageIdnewMessageIdFromByteArrayWithTopic(byte[] data, String topicName) <T extends com.google.protobuf.GeneratedMessageV3>
org.apache.pulsar.client.api.Schema<T>newProtobufNativeSchema(org.apache.pulsar.client.api.schema.SchemaDefinition schemaDefinition) <T extends com.google.protobuf.GeneratedMessageV3>
org.apache.pulsar.client.api.Schema<T>newProtobufSchema(org.apache.pulsar.client.api.schema.SchemaDefinition schemaDefinition) org.apache.pulsar.client.api.schema.RecordSchemaBuildernewRecordSchemaBuilder(String name) <T> org.apache.pulsar.client.api.schema.SchemaDefinitionBuilder<T>org.apache.pulsar.common.schema.SchemaInfonewSchemaInfoImpl(String name, byte[] schema, org.apache.pulsar.common.schema.SchemaType type, long timestamp, Map<String, String> propertiesValue) org.apache.pulsar.client.api.Schema<Short>org.apache.pulsar.client.api.Schema<String>org.apache.pulsar.client.api.Schema<String>newStringSchema(Charset charset) org.apache.pulsar.client.api.Schema<Time>org.apache.pulsar.client.api.Schema<Timestamp>
-
Constructor Details
-
PulsarClientImplementationBindingImpl
public PulsarClientImplementationBindingImpl()
-
-
Method Details
-
newSchemaDefinitionBuilder
public <T> org.apache.pulsar.client.api.schema.SchemaDefinitionBuilder<T> newSchemaDefinitionBuilder()- Specified by:
newSchemaDefinitionBuilderin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newClientBuilder
public org.apache.pulsar.client.api.ClientBuilder newClientBuilder()- Specified by:
newClientBuilderin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newMessageId
public org.apache.pulsar.client.api.MessageId newMessageId(long ledgerId, long entryId, int partitionIndex) - Specified by:
newMessageIdin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newMessageIdFromByteArray
public org.apache.pulsar.client.api.MessageId newMessageIdFromByteArray(byte[] data) throws IOException - Specified by:
newMessageIdFromByteArrayin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- Throws:
IOException
-
newMessageIdFromByteArrayWithTopic
public org.apache.pulsar.client.api.MessageId newMessageIdFromByteArrayWithTopic(byte[] data, String topicName) throws IOException - Specified by:
newMessageIdFromByteArrayWithTopicin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- Throws:
IOException
-
newAuthenticationToken
- Specified by:
newAuthenticationTokenin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newAuthenticationToken
public org.apache.pulsar.client.api.Authentication newAuthenticationToken(Supplier<String> supplier) - Specified by:
newAuthenticationTokenin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newAuthenticationTLS
public org.apache.pulsar.client.api.Authentication newAuthenticationTLS(String certFilePath, String keyFilePath) - Specified by:
newAuthenticationTLSin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
createAuthentication
public org.apache.pulsar.client.api.Authentication createAuthentication(String authPluginClassName, String authParamsString) throws org.apache.pulsar.client.api.PulsarClientException.UnsupportedAuthenticationException - Specified by:
createAuthenticationin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- Throws:
org.apache.pulsar.client.api.PulsarClientException.UnsupportedAuthenticationException
-
createAuthentication
public org.apache.pulsar.client.api.Authentication createAuthentication(String authPluginClassName, Map<String, String> authParams) throws org.apache.pulsar.client.api.PulsarClientException.UnsupportedAuthenticationException- Specified by:
createAuthenticationin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- Throws:
org.apache.pulsar.client.api.PulsarClientException.UnsupportedAuthenticationException
-
newBytesSchema
public org.apache.pulsar.client.api.Schema<byte[]> newBytesSchema()- Specified by:
newBytesSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newStringSchema
- Specified by:
newStringSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newStringSchema
- Specified by:
newStringSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newByteSchema
- Specified by:
newByteSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newShortSchema
- Specified by:
newShortSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newIntSchema
- Specified by:
newIntSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newLongSchema
- Specified by:
newLongSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newBooleanSchema
- Specified by:
newBooleanSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newByteBufferSchema
- Specified by:
newByteBufferSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newFloatSchema
- Specified by:
newFloatSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newDoubleSchema
- Specified by:
newDoubleSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newDateSchema
- Specified by:
newDateSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newTimeSchema
- Specified by:
newTimeSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newTimestampSchema
- Specified by:
newTimestampSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newInstantSchema
- Specified by:
newInstantSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newLocalDateSchema
- Specified by:
newLocalDateSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newLocalTimeSchema
- Specified by:
newLocalTimeSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newLocalDateTimeSchema
- Specified by:
newLocalDateTimeSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newAvroSchema
public <T> org.apache.pulsar.client.api.Schema<T> newAvroSchema(org.apache.pulsar.client.api.schema.SchemaDefinition schemaDefinition) - Specified by:
newAvroSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newProtobufSchema
public <T extends com.google.protobuf.GeneratedMessageV3> org.apache.pulsar.client.api.Schema<T> newProtobufSchema(org.apache.pulsar.client.api.schema.SchemaDefinition schemaDefinition) - Specified by:
newProtobufSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newProtobufNativeSchema
public <T extends com.google.protobuf.GeneratedMessageV3> org.apache.pulsar.client.api.Schema<T> newProtobufNativeSchema(org.apache.pulsar.client.api.schema.SchemaDefinition schemaDefinition) - Specified by:
newProtobufNativeSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newJSONSchema
public <T> org.apache.pulsar.client.api.Schema<T> newJSONSchema(org.apache.pulsar.client.api.schema.SchemaDefinition schemaDefinition) - Specified by:
newJSONSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newAutoConsumeSchema
public org.apache.pulsar.client.api.Schema<org.apache.pulsar.client.api.schema.GenericRecord> newAutoConsumeSchema()- Specified by:
newAutoConsumeSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newAutoProduceSchema
public org.apache.pulsar.client.api.Schema<byte[]> newAutoProduceSchema()- Specified by:
newAutoProduceSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newAutoProduceSchema
public org.apache.pulsar.client.api.Schema<byte[]> newAutoProduceSchema(org.apache.pulsar.client.api.Schema<?> schema) - Specified by:
newAutoProduceSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newAutoProduceValidatedAvroSchema
- Specified by:
newAutoProduceValidatedAvroSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newKeyValueBytesSchema
public org.apache.pulsar.client.api.Schema<org.apache.pulsar.common.schema.KeyValue<byte[],byte[]>> newKeyValueBytesSchema()- Specified by:
newKeyValueBytesSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newKeyValueSchema
public <K,V> org.apache.pulsar.client.api.Schema<org.apache.pulsar.common.schema.KeyValue<K,V>> newKeyValueSchema(org.apache.pulsar.client.api.Schema<K> keySchema, org.apache.pulsar.client.api.Schema<V> valueSchema, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType) - Specified by:
newKeyValueSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newKeyValueSchema
public <K,V> org.apache.pulsar.client.api.Schema<org.apache.pulsar.common.schema.KeyValue<K,V>> newKeyValueSchema(Class<K> key, Class<V> value, org.apache.pulsar.common.schema.SchemaType type) - Specified by:
newKeyValueSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
getSchema
public org.apache.pulsar.client.api.Schema<?> getSchema(org.apache.pulsar.common.schema.SchemaInfo schemaInfo) - Specified by:
getSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
getGenericSchema
public org.apache.pulsar.client.api.schema.GenericSchema<org.apache.pulsar.client.api.schema.GenericRecord> getGenericSchema(org.apache.pulsar.common.schema.SchemaInfo schemaInfo) - Specified by:
getGenericSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newRecordSchemaBuilder
- Specified by:
newRecordSchemaBuilderin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
decodeKeyValueEncodingType
public org.apache.pulsar.common.schema.KeyValueEncodingType decodeKeyValueEncodingType(org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Decode the kv encoding type from the schema info.- Specified by:
decodeKeyValueEncodingTypein interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- Parameters:
schemaInfo- the schema info- Returns:
- the kv encoding type
-
encodeKeyValueSchemaInfo
public <K,V> org.apache.pulsar.common.schema.SchemaInfo encodeKeyValueSchemaInfo(org.apache.pulsar.client.api.Schema<K> keySchema, org.apache.pulsar.client.api.Schema<V> valueSchema, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType) Encode key & value into schema into a KeyValue schema.- Specified by:
encodeKeyValueSchemaInfoin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- Parameters:
keySchema- the key schemavalueSchema- the value schemakeyValueEncodingType- the encoding type to encode and decode key value pair- Returns:
- the final schema info
-
encodeKeyValueSchemaInfo
public <K,V> org.apache.pulsar.common.schema.SchemaInfo encodeKeyValueSchemaInfo(String schemaName, org.apache.pulsar.client.api.Schema<K> keySchema, org.apache.pulsar.client.api.Schema<V> valueSchema, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType) Encode key & value into schema into a KeyValue schema.- Specified by:
encodeKeyValueSchemaInfoin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- 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
public org.apache.pulsar.common.schema.KeyValue<org.apache.pulsar.common.schema.SchemaInfo,org.apache.pulsar.common.schema.SchemaInfo> decodeKeyValueSchemaInfo(org.apache.pulsar.common.schema.SchemaInfo schemaInfo) Decode the key/value schema info to get key schema info and value schema info.- Specified by:
decodeKeyValueSchemaInfoin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- Parameters:
schemaInfo- key/value schema info.- Returns:
- the pair of key schema info and value schema info
-
jsonifySchemaInfo
Jsonify the schema info.- Specified by:
jsonifySchemaInfoin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- Parameters:
schemaInfo- the schema info- Returns:
- the jsonified schema info
-
jsonifySchemaInfoWithVersion
public String jsonifySchemaInfoWithVersion(org.apache.pulsar.common.schema.SchemaInfoWithVersion schemaInfoWithVersion) Jsonify the schema info with version.- Specified by:
jsonifySchemaInfoWithVersionin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- Parameters:
schemaInfoWithVersion- the schema info with version- Returns:
- the jsonified schema info with version
-
jsonifyKeyValueSchemaInfo
public String jsonifyKeyValueSchemaInfo(org.apache.pulsar.common.schema.KeyValue<org.apache.pulsar.common.schema.SchemaInfo, org.apache.pulsar.common.schema.SchemaInfo> kvSchemaInfo) Jsonify the key/value schema info.- Specified by:
jsonifyKeyValueSchemaInfoin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- Parameters:
kvSchemaInfo- the key/value schema info- Returns:
- the jsonified schema info
-
convertKeyValueSchemaInfoDataToString
public String convertKeyValueSchemaInfoDataToString(org.apache.pulsar.common.schema.KeyValue<org.apache.pulsar.common.schema.SchemaInfo, org.apache.pulsar.common.schema.SchemaInfo> kvSchemaInfo) throws IOExceptionConvert the key/value schema data.- Specified by:
convertKeyValueSchemaInfoDataToStringin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- Parameters:
kvSchemaInfo- the key/value schema info- Returns:
- the convert key/value schema data string
- Throws:
IOException
-
convertKeyValueDataStringToSchemaInfoSchema
public byte[] convertKeyValueDataStringToSchemaInfoSchema(byte[] keyValueSchemaInfoDataJsonBytes) throws IOException Convert the key/value schema info data json bytes to key/value schema info data bytes.- Specified by:
convertKeyValueDataStringToSchemaInfoSchemain interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding- Parameters:
keyValueSchemaInfoDataJsonBytes- the key/value schema info data json bytes- Returns:
- the key/value schema info data bytes
- Throws:
IOException
-
newDefaultBatcherBuilder
public org.apache.pulsar.client.api.BatcherBuilder newDefaultBatcherBuilder()- Specified by:
newDefaultBatcherBuilderin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newKeyBasedBatcherBuilder
public org.apache.pulsar.client.api.BatcherBuilder newKeyBasedBatcherBuilder()- Specified by:
newKeyBasedBatcherBuilderin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newDefaultMessagePayloadFactory
public org.apache.pulsar.client.api.MessagePayloadFactory newDefaultMessagePayloadFactory()- Specified by:
newDefaultMessagePayloadFactoryin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-
newSchemaInfoImpl
public org.apache.pulsar.common.schema.SchemaInfo newSchemaInfoImpl(String name, byte[] schema, org.apache.pulsar.common.schema.SchemaType type, long timestamp, Map<String, String> propertiesValue) - Specified by:
newSchemaInfoImplin interfaceorg.apache.pulsar.client.internal.PulsarClientImplementationBinding
-