public class StreamingService extends Object
Modifier and Type | Method and Description |
---|---|
cgl.narada.service.client.EventConsumer |
createConsumer(cgl.narada.service.client.NBEventListener listener)
Create an event consumer
|
cgl.narada.service.client.EventProducer |
createProducer()
Create a stream producer
|
cgl.narada.matching.Profile |
createProfile(String streamSynopsis,
int synopsisType)
Create a profile based on the synopsisTypeString and the synopsis
|
static StreamingService |
getInstance()
Get an instance of the StreamingService
|
void |
initialize(String configurationFile,
int entityId,
Properties props,
String commType)
Initialize the streaming service based on the specified parameters
|
boolean |
isInitialized()
Checks to see if the streaming service has been initialized.
|
static void |
main(String[] args) |
void |
writeToStream(String streamSynopsis,
byte[] payload)
Writes a byte[] payload onto the specified stream
|
void |
writeToStream(String streamSynopsis,
int synopsisType,
byte[] payload)
Writes a byte[] payload onto the specified stream
|
public static StreamingService getInstance()
public void initialize(String configurationFile, int entityId, Properties props, String commType) throws CommunicationsException
configurationFile
- Used to specify configuration of various servicesentityId
- The identifier associated with this entity/resourceprops
- Properties for initializing communications with the brokercommType
- The communication type to be usedCommunicationsException
- If there are communication problems when performing the
operation.public boolean isInitialized()
true
if it is, and true
otherwise.public cgl.narada.service.client.EventProducer createProducer() throws CommunicationsException
CommunicationsException
- If there are communication problems when performing the
operation.public cgl.narada.service.client.EventConsumer createConsumer(cgl.narada.service.client.NBEventListener listener) throws CommunicationsException
listener
- The listener who would be notified when streams are availableCommunicationsException
- If there are communication problems when performing the
operation.public cgl.narada.matching.Profile createProfile(String streamSynopsis, int synopsisType) throws CommunicationsException
streamSynopsis
- The synopsis of the StreamsynopsisType
- The synopsis type of the stream in questionCommunicationsException
- If there are communication problems when performing the
operation.public void writeToStream(String streamSynopsis, byte[] payload) throws CommunicationsException
streamSynopsis
- The synopsis of the Streampayload
- The payload for the stream fragmentCommunicationsException
- If there are communication problems when performing the
operation.public void writeToStream(String streamSynopsis, int synopsisType, byte[] payload) throws CommunicationsException
streamSynopsis
- The synopsis of the StreamsynopsisType
- The synopsis type of the stream in questionpayload
- The payload for the stream fragmentCommunicationsException
- If there are communication problems when performing the
operation.public static void main(String[] args)
args
- Copyright © 2015. All rights reserved.