public class EventStream extends Object
Modifier and Type | Field and Description |
---|---|
protected EventSchemaLoader |
eventSchemaLoader
EventSchemaLoader instance used when getting a schema for this stream.
|
protected EventStreamConfig |
eventStreamConfig
EventStreamConfig instance used to lookup stream config settings for this stream.
|
protected String |
streamName |
Constructor and Description |
---|
EventStream(String streamName,
EventSchemaLoader eventSchemaLoader,
EventStreamConfig eventStreamConfig)
Consider using EventStreamFactory.createEventStream instead.
|
Modifier and Type | Method and Description |
---|---|
String |
eventServiceName()
Gets this EventStream's destination_event_service name.
|
URI |
eventServiceUri()
Returns the (discovery) URL to which events belonging to this EventStream should be POSTed.
|
URI |
eventServiceUri(String datacenter)
Returns the datacenter specific event service URL to which events belonging to
this EventStream should be POSTed.
|
com.fasterxml.jackson.databind.node.ObjectNode |
exampleEvent()
Gets the schema for stream and returns the first element in its JSONSchema examples.
|
com.fasterxml.jackson.databind.node.ObjectNode |
exampleEvent(String schemaVersion)
Gets the schema for stream and returns the first element in its JSONSchema examples.
|
com.fasterxml.jackson.databind.JsonNode |
getSetting(String settingName)
Gets a setting from stream config for this stream.
|
String |
latestSchemaId()
Gets the $id from the latest schema.
|
String |
latestSchemaVersion()
Infers the latest schema version number from the schema's $id field.
|
protected com.fasterxml.jackson.databind.JsonNode |
loadSchema(URI schemaUri)
Loads the schema at the relative schemaUri using our eventSchemaLoader.
|
com.fasterxml.jackson.databind.JsonNode |
messageKeyFields()
Get the Kafka message key fields.
|
com.fasterxml.jackson.databind.JsonNode |
schema()
Infers the latest relative schemaUri for the stream from its schema_title
stream config setting and fetches and returns the schema at that URI using eventSchemaLoader.
|
com.fasterxml.jackson.databind.JsonNode |
schema(String version)
Get the version relative schemaUri for the stream from its schema_title
stream config setting and fetches and returns the schema at that URI using eventSchemaLoader.
|
String |
schemaTitle()
Gets the JSONSchema title configured for this EventStream.
|
URI |
schemaUri()
Builds a latest relative schema URI for stream based on WMF conventions.
|
URI |
schemaUri(String version)
Builds schema URI for stream based on WMF conventions.
|
String |
streamName()
Gets the stream name of this EventStream instance.
|
List<String> |
topics()
Gets the list of Kafka topics that compose this stream.
|
String |
toString() |
protected String streamName
protected EventSchemaLoader eventSchemaLoader
protected EventStreamConfig eventStreamConfig
public EventStream(String streamName, EventSchemaLoader eventSchemaLoader, EventStreamConfig eventStreamConfig)
public String streamName()
public com.fasterxml.jackson.databind.JsonNode getSetting(String settingName)
public String eventServiceName()
public URI eventServiceUri()
public URI eventServiceUri(String datacenter)
public com.fasterxml.jackson.databind.JsonNode messageKeyFields()
public String schemaTitle()
public URI schemaUri(String version)
version
- version of the schema to loadpublic URI schemaUri()
public com.fasterxml.jackson.databind.JsonNode schema()
public com.fasterxml.jackson.databind.JsonNode schema(String version)
version
- version of the schema to loadpublic String latestSchemaId()
public String latestSchemaVersion()
protected com.fasterxml.jackson.databind.JsonNode loadSchema(URI schemaUri)
public com.fasterxml.jackson.databind.node.ObjectNode exampleEvent()
public com.fasterxml.jackson.databind.node.ObjectNode exampleEvent(String schemaVersion)
schemaVersion
- the schemaVersionCopyright © 2025. All rights reserved.