Package ai.superstream
Class Superstream
- java.lang.Object
-
- ai.superstream.Superstream
-
public class Superstream extends Object
-
-
Field Summary
Fields Modifier and Type Field Description StringaccountNameio.nats.client.ConnectionbrokerConnectionSuperstreamCountersclientCountersintclientIDMap<String,?>configStringConsumerSchemaIDcom.google.protobuf.Descriptors.Descriptordescriptorbyte[]descriptorAsBytesio.nats.client.JetStreamjetstreamintlearningFactorintlearningFactorCounterbooleanlearningRequestSentStringnatsConnectionIDStringProducerSchemaIDMap<String,com.google.protobuf.Descriptors.Descriptor>SchemaIDMapStringsuperstreamJwtStringsuperstreamNkey
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidhandleError(String msg)static Map<String,Object>initSuperstreamConfig(Map<String,Object> configs)static PropertiesinitSuperstreamProps(Properties properties)byte[]jsonToProto(byte[] msgBytes)static Map<String,Object>normalizeClientConfig(Map<String,?> javaConfig)byte[]protoToJson(byte[] msgBytes, com.google.protobuf.Descriptors.Descriptor desc)voidregisterClient(Map<String,?> configs)voidreportClientsUpdate()voidsendClientTypeUpdateReq(String clientType)voidsendGetSchemaRequest(String schemaID)voidsendLearningMessage(byte[] msg)voidsendRegisterSchemaReq()voidsubscribeToUpdates()
-
-
-
Field Detail
-
brokerConnection
public io.nats.client.Connection brokerConnection
-
jetstream
public io.nats.client.JetStream jetstream
-
superstreamJwt
public String superstreamJwt
-
superstreamNkey
public String superstreamNkey
-
descriptorAsBytes
public byte[] descriptorAsBytes
-
descriptor
public com.google.protobuf.Descriptors.Descriptor descriptor
-
natsConnectionID
public String natsConnectionID
-
clientID
public int clientID
-
accountName
public String accountName
-
learningFactor
public int learningFactor
-
learningFactorCounter
public int learningFactorCounter
-
learningRequestSent
public boolean learningRequestSent
-
ProducerSchemaID
public String ProducerSchemaID
-
ConsumerSchemaID
public String ConsumerSchemaID
-
clientCounters
public SuperstreamCounters clientCounters
-
-
Method Detail
-
close
public void close()
-
sendClientTypeUpdateReq
public void sendClientTypeUpdateReq(String clientType)
-
subscribeToUpdates
public void subscribeToUpdates()
-
reportClientsUpdate
public void reportClientsUpdate()
-
sendLearningMessage
public void sendLearningMessage(byte[] msg)
-
sendRegisterSchemaReq
public void sendRegisterSchemaReq()
-
jsonToProto
public byte[] jsonToProto(byte[] msgBytes) throws IOException- Throws:
IOException
-
protoToJson
public byte[] protoToJson(byte[] msgBytes, com.google.protobuf.Descriptors.Descriptor desc) throws IOException- Throws:
IOException
-
sendGetSchemaRequest
public void sendGetSchemaRequest(String schemaID)
-
handleError
public void handleError(String msg)
-
normalizeClientConfig
public static Map<String,Object> normalizeClientConfig(Map<String,?> javaConfig)
-
initSuperstreamConfig
public static Map<String,Object> initSuperstreamConfig(Map<String,Object> configs)
-
initSuperstreamProps
public static Properties initSuperstreamProps(Properties properties)
-
-