public class StreamDatasetImpl extends java.lang.Object implements StreamDataset
StreamingAccess interface which outlines
methods to access the data streams that are available.Dataset.DatasetType| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MODULE |
| Constructor and Description |
|---|
StreamDatasetImpl(FormatReader mFormat) |
StreamDatasetImpl(java.lang.String datasetIdentifier,
java.lang.String datasetDescription)
Share the instance of the client service, so that multiple connections
are not created to the same broker.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addInputStream(Topic topic)
Add an input stream to this dataset.
|
int |
addInputStreams(java.util.Collection<Topic> topics)
Adds a set of input streams to this dataset.
|
int |
addOutputStream(Topic topic)
Add an output stream to this dataset.
|
int |
addOutputStreams(java.util.Collection<Topic> topics)
Adds a set of output streams to this dataset.
|
boolean |
close()
Close access to this dataset.
|
DataAvailabilityNotifier |
getDataAvailabilityNotifier()
Retrieve the data availability notifier for this dataset.
|
Dataset.DatasetType |
getDatasetType()
Retrieve the type of the data set
|
java.lang.String |
getDescription()
Retrieve a description of the dataset
|
java.lang.String |
getIdentifier()
Retrieve the identifier for this dataset.
|
java.util.Collection<Topic> |
getInputStreams()
Retrieve a collection of the constituent input streams.
|
long |
getLastModificationTime()
Retrieve the last update to this dataset
|
int |
getNumberOfInputStreams()
Retrieve the number of input streams in this dataset
|
int |
getNumberOfOutputStreams()
Retrieve the number of output streams in this dataset.
|
java.util.Collection<Topic> |
getOutputStreams()
Retrieve a collection of the constituent output streams.
|
TopicDataEvent |
getStreamingData()
Retrieves a portion of the streaming dataset when data is available.
|
boolean |
hasInputStream(Topic topic)
Check to see if this dataset has a specified input stream.
|
boolean |
hasInputStreams()
Check to see if this dataset has any registered input streams.
|
boolean |
hasOutputStream(Topic topic)
Check to see if this dataset has a specified output stream.
|
boolean |
hasOutputStreams()
Check to see if this dataset has any registered output streams.
|
boolean |
initializeDataset()
Invokes the initialization of the dataset.
|
boolean |
isAvailable()
A check to see if the dataset is available
|
boolean |
isDataAvailable()
This polls the dataset to see if data is available for consumption.
|
boolean |
isInitialized()
Check to see if the dataset has been initialized
|
void |
marshall(FormatWriter mFormat) |
int |
removeInputStream(Topic topic)
Removes an input stream from this dataset.
|
int |
removeInputStreams(java.util.Collection<Topic> topics)
Removes a set of input streams from this dataset.
|
int |
removeOutputStream(Topic topic)
Removes an output stream from this dataset.
|
int |
removeOutputStreams(java.util.Collection<Topic> topics)
Removes a set of output streams from this dataset.
|
boolean |
supportsDataAvailabilityNotifications()
Indicates whether this dataset supports dynamic data availability
notifications
|
void |
writeStreamingData(Topic topic,
byte[] payload)
This method writes data to the output dataset.
|
void |
writeStreamingData(TopicDataEvent mtdEvent)
This method writes data to the output dataset.
|
public static final java.lang.String MODULE
public StreamDatasetImpl(java.lang.String datasetIdentifier,
java.lang.String datasetDescription)
datasetIdentifier - The identifier of the datasetdatasetDescription - The descriptor for this dataset.public StreamDatasetImpl(FormatReader mFormat) throws FormatException
FormatExceptionpublic Dataset.DatasetType getDatasetType()
DatasetgetDatasetType in interface Datasetpublic java.lang.String getDescription()
DatasetgetDescription in interface Datasetpublic java.lang.String getIdentifier()
DatasetgetIdentifier in interface Datasetpublic boolean isInitialized()
DatasetisInitialized in interface Datasettrue if the dataset is initialized;
false otherwise.public boolean initializeDataset()
throws DatasetException
DatasetinitializeDataset in interface Datasettrue if the dataset has been initialized;
false otherwise.DatasetExceptionpublic boolean isAvailable()
DatasetisAvailable in interface Datasettrue if the dataset is available;
false otherwise.public boolean isDataAvailable()
DatasetisDataAvailable in interface Datasettrue if data is available on this dataset;
false otherwise.public long getLastModificationTime()
DatasetgetLastModificationTime in interface Datasetpublic boolean supportsDataAvailabilityNotifications()
DatasetsupportsDataAvailabilityNotifications in interface Datasettrue if this dataset supports data availability
notifications;false otherwise.public DataAvailabilityNotifier getDataAvailabilityNotifier()
DatasetgetDataAvailabilityNotifier in interface Datasetpublic TopicDataEvent getStreamingData() throws DatasetException
StreamDatasetgetStreamingData in interface StreamDatasetDatasetException - If there are problems performing the operationpublic void writeStreamingData(TopicDataEvent mtdEvent) throws DatasetException
StreamDatasetwriteStreamingData in interface StreamDatasetmtdEvent - The stream fragment that needs to be writtenDatasetException - If there are problems performing the operationpublic void writeStreamingData(Topic topic, byte[] payload) throws DatasetException
StreamDatasetwriteStreamingData in interface StreamDatasettopic - The stream being written topayload - The payload for the individual stream fragmentsDatasetException - If there are problems performing the operationpublic int addInputStream(Topic topic) throws DatasetException
StreamDatasetaddInputStream in interface StreamDatasettopic - The topic of the stream to be addedDatasetException - If there are problems adding this stream to the set of
managed streamspublic int removeInputStream(Topic topic) throws DatasetException
StreamDatasetremoveInputStream in interface StreamDatasettopic - The topic of the stream to be removedDatasetException - If there are problems removing this stream from the set of
managed streamspublic int addInputStreams(java.util.Collection<Topic> topics) throws DatasetException
StreamDatasetaddInputStreams in interface StreamDatasettopics - A collection of streams to be addedDatasetException - If there are problems adding these streams to the set of
managed streamspublic int removeInputStreams(java.util.Collection<Topic> topics) throws DatasetException
StreamDatasetremoveInputStreams in interface StreamDatasettopics - A collection of streams to be removedDatasetException - If there are problems removing these streams to the set of
managed streamspublic boolean hasInputStreams()
StreamDatasethasInputStreams in interface StreamDatasettrue if this dataset has any registered input
streams;false otherwise.public boolean hasInputStream(Topic topic)
StreamDatasethasInputStream in interface StreamDatasettrue if this dataset has the specified input
stream;false otherwise.public int getNumberOfInputStreams()
StreamDatasetgetNumberOfInputStreams in interface StreamDatasetpublic java.util.Collection<Topic> getInputStreams()
StreamDatasetgetInputStreams in interface StreamDatasetpublic int addOutputStream(Topic topic) throws DatasetException
StreamDatasetaddOutputStream in interface StreamDatasettopic - The topic of the stream to be addedDatasetException - If there are problems adding this stream to the set of
managed streamspublic int removeOutputStream(Topic topic) throws DatasetException
StreamDatasetremoveOutputStream in interface StreamDatasettopic - The topic of the stream to be removedDatasetException - If there are problems removing this stream from the set of
managed streamspublic int addOutputStreams(java.util.Collection<Topic> topics) throws DatasetException
StreamDatasetaddOutputStreams in interface StreamDatasettopics - A collection of streams to be addedDatasetException - If there are problems adding these streams to the set of
managed streamspublic int removeOutputStreams(java.util.Collection<Topic> topics) throws DatasetException
StreamDatasetremoveOutputStreams in interface StreamDatasettopics - A collection of streams to be removedDatasetException - If there are problems removing these streams from the set of
managed streamspublic boolean hasOutputStreams()
StreamDatasethasOutputStreams in interface StreamDatasettrue if this dataset has any registered output
streams;false otherwise.public boolean hasOutputStream(Topic topic)
StreamDatasethasOutputStream in interface StreamDatasettrue if this dataset has the specified output
stream;false otherwise.public int getNumberOfOutputStreams()
StreamDatasetgetNumberOfOutputStreams in interface StreamDatasetpublic java.util.Collection<Topic> getOutputStreams()
StreamDatasetgetOutputStreams in interface StreamDatasetpublic void marshall(FormatWriter mFormat) throws FormatException
marshall in interface FormatMarshallermFormat - - The format writer to write toFormatException - If there was a problem while writingpublic boolean close()
throws DatasetException
Datasetclose in interface Datasettrue if a graceful closure of this dataset was
performed;false otherwise.DatasetException