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 Details

    • PulsarClientImplementationBindingImpl

      public PulsarClientImplementationBindingImpl()
  • Method Details

    • newSchemaDefinitionBuilder

      public <T> org.apache.pulsar.client.api.schema.SchemaDefinitionBuilder<T> newSchemaDefinitionBuilder()
      Specified by:
      newSchemaDefinitionBuilder in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newClientBuilder

      public org.apache.pulsar.client.api.ClientBuilder newClientBuilder()
      Specified by:
      newClientBuilder in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newMessageId

      public org.apache.pulsar.client.api.MessageId newMessageId(long ledgerId, long entryId, int partitionIndex)
      Specified by:
      newMessageId in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newMessageIdFromByteArray

      public org.apache.pulsar.client.api.MessageId newMessageIdFromByteArray(byte[] data) throws IOException
      Specified by:
      newMessageIdFromByteArray in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
      Throws:
      IOException
    • newMessageIdFromByteArrayWithTopic

      public org.apache.pulsar.client.api.MessageId newMessageIdFromByteArrayWithTopic(byte[] data, String topicName) throws IOException
      Specified by:
      newMessageIdFromByteArrayWithTopic in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
      Throws:
      IOException
    • newAuthenticationToken

      public org.apache.pulsar.client.api.Authentication newAuthenticationToken(String token)
      Specified by:
      newAuthenticationToken in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newAuthenticationToken

      public org.apache.pulsar.client.api.Authentication newAuthenticationToken(Supplier<String> supplier)
      Specified by:
      newAuthenticationToken in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newAuthenticationTLS

      public org.apache.pulsar.client.api.Authentication newAuthenticationTLS(String certFilePath, String keyFilePath)
      Specified by:
      newAuthenticationTLS in interface org.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:
      createAuthentication in interface org.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:
      createAuthentication in interface org.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:
      newBytesSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newStringSchema

      public org.apache.pulsar.client.api.Schema<String> newStringSchema()
      Specified by:
      newStringSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newStringSchema

      public org.apache.pulsar.client.api.Schema<String> newStringSchema(Charset charset)
      Specified by:
      newStringSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newByteSchema

      public org.apache.pulsar.client.api.Schema<Byte> newByteSchema()
      Specified by:
      newByteSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newShortSchema

      public org.apache.pulsar.client.api.Schema<Short> newShortSchema()
      Specified by:
      newShortSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newIntSchema

      public org.apache.pulsar.client.api.Schema<Integer> newIntSchema()
      Specified by:
      newIntSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newLongSchema

      public org.apache.pulsar.client.api.Schema<Long> newLongSchema()
      Specified by:
      newLongSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newBooleanSchema

      public org.apache.pulsar.client.api.Schema<Boolean> newBooleanSchema()
      Specified by:
      newBooleanSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newByteBufferSchema

      public org.apache.pulsar.client.api.Schema<ByteBuffer> newByteBufferSchema()
      Specified by:
      newByteBufferSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newFloatSchema

      public org.apache.pulsar.client.api.Schema<Float> newFloatSchema()
      Specified by:
      newFloatSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newDoubleSchema

      public org.apache.pulsar.client.api.Schema<Double> newDoubleSchema()
      Specified by:
      newDoubleSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newDateSchema

      public org.apache.pulsar.client.api.Schema<Date> newDateSchema()
      Specified by:
      newDateSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newTimeSchema

      public org.apache.pulsar.client.api.Schema<Time> newTimeSchema()
      Specified by:
      newTimeSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newTimestampSchema

      public org.apache.pulsar.client.api.Schema<Timestamp> newTimestampSchema()
      Specified by:
      newTimestampSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newInstantSchema

      public org.apache.pulsar.client.api.Schema<Instant> newInstantSchema()
      Specified by:
      newInstantSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newLocalDateSchema

      public org.apache.pulsar.client.api.Schema<LocalDate> newLocalDateSchema()
      Specified by:
      newLocalDateSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newLocalTimeSchema

      public org.apache.pulsar.client.api.Schema<LocalTime> newLocalTimeSchema()
      Specified by:
      newLocalTimeSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newLocalDateTimeSchema

      public org.apache.pulsar.client.api.Schema<LocalDateTime> newLocalDateTimeSchema()
      Specified by:
      newLocalDateTimeSchema in interface org.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:
      newAvroSchema in interface org.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:
      newProtobufSchema in interface org.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:
      newProtobufNativeSchema in interface org.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:
      newJSONSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newAutoConsumeSchema

      public org.apache.pulsar.client.api.Schema<org.apache.pulsar.client.api.schema.GenericRecord> newAutoConsumeSchema()
      Specified by:
      newAutoConsumeSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newAutoProduceSchema

      public org.apache.pulsar.client.api.Schema<byte[]> newAutoProduceSchema()
      Specified by:
      newAutoProduceSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newAutoProduceSchema

      public org.apache.pulsar.client.api.Schema<byte[]> newAutoProduceSchema(org.apache.pulsar.client.api.Schema<?> schema)
      Specified by:
      newAutoProduceSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newAutoProduceValidatedAvroSchema

      public org.apache.pulsar.client.api.Schema<byte[]> newAutoProduceValidatedAvroSchema(Object schema)
      Specified by:
      newAutoProduceValidatedAvroSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newKeyValueBytesSchema

      public org.apache.pulsar.client.api.Schema<org.apache.pulsar.common.schema.KeyValue<byte[],byte[]>> newKeyValueBytesSchema()
      Specified by:
      newKeyValueBytesSchema in interface org.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:
      newKeyValueSchema in interface org.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:
      newKeyValueSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • getSchema

      public org.apache.pulsar.client.api.Schema<?> getSchema(org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
      Specified by:
      getSchema in interface org.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:
      getGenericSchema in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newRecordSchemaBuilder

      public org.apache.pulsar.client.api.schema.RecordSchemaBuilder newRecordSchemaBuilder(String name)
      Specified by:
      newRecordSchemaBuilder in interface org.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:
      decodeKeyValueEncodingType in interface org.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:
      encodeKeyValueSchemaInfo in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
      Parameters:
      keySchema - the key schema
      valueSchema - the value schema
      keyValueEncodingType - 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:
      encodeKeyValueSchemaInfo in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
      Parameters:
      schemaName - the final schema name
      keySchema - the key schema
      valueSchema - the value schema
      keyValueEncodingType - 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:
      decodeKeyValueSchemaInfo in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
      Parameters:
      schemaInfo - key/value schema info.
      Returns:
      the pair of key schema info and value schema info
    • jsonifySchemaInfo

      public String jsonifySchemaInfo(org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
      Jsonify the schema info.
      Specified by:
      jsonifySchemaInfo in interface org.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:
      jsonifySchemaInfoWithVersion in interface org.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:
      jsonifyKeyValueSchemaInfo in interface org.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 IOException
      Convert the key/value schema data.
      Specified by:
      convertKeyValueSchemaInfoDataToString in interface org.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:
      convertKeyValueDataStringToSchemaInfoSchema in interface org.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:
      newDefaultBatcherBuilder in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newKeyBasedBatcherBuilder

      public org.apache.pulsar.client.api.BatcherBuilder newKeyBasedBatcherBuilder()
      Specified by:
      newKeyBasedBatcherBuilder in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding
    • newDefaultMessagePayloadFactory

      public org.apache.pulsar.client.api.MessagePayloadFactory newDefaultMessagePayloadFactory()
      Specified by:
      newDefaultMessagePayloadFactory in interface org.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:
      newSchemaInfoImpl in interface org.apache.pulsar.client.internal.PulsarClientImplementationBinding