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 Detail

      • 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)
      • 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()
      • newProtobufSchema

        <T extends com.google.protobuf.GeneratedMessageV3> Schema<T> newProtobufSchema​(SchemaDefinition schemaDefinition)
      • newProtobufNativeSchema

        <T extends com.google.protobuf.GeneratedMessageV3> Schema<T> newProtobufNativeSchema​(SchemaDefinition schemaDefinition)
      • newAutoProduceSchema

        Schema<byte[]> newAutoProduceSchema()
      • newAutoProduceSchema

        Schema<byte[]> newAutoProduceSchema​(Schema<?> schema)
      • newAutoProduceValidatedAvroSchema

        Schema<byte[]> newAutoProduceValidatedAvroSchema​(java.lang.Object schema)
      • newKeyValueBytesSchema

        Schema<KeyValue<byte[],​byte[]>> newKeyValueBytesSchema()
      • newKeyValueSchema

        <K,​V> Schema<KeyValue<K,​V>> newKeyValueSchema​(java.lang.Class<K> key,
                                                                  java.lang.Class<V> value,
                                                                  SchemaType type)
      • 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 schema
        valueSchema - the value schema
        keyValueEncodingType - 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 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

        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
      • newKeyBasedBatcherBuilder

        BatcherBuilder newKeyBasedBatcherBuilder()
      • 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)