cgl.narada.service.client
Interface EventProducer

All Known Implementing Classes:
EventProducerImpl

public interface EventProducer

The Event producer provides an interface for the generation of events


Method Summary
 void close()
          Close the Event Producer
 ProducerConstraints createProducerConstraints(TemplateInfo templateInfo)
          Create producer constraints associated with a certain template
 NBEvent generateEvent(byte[] payload)
          Generate NBEvent based on the specified information
 NBEvent generateEvent(int contentSynopsisType, Object contentSynopsis, byte[] payload)
          Generate NBEvent based on the specified information
 NBEvent generateEvent(int contentSynopsisType, Object contentSynopsis, EventID correlationId, byte[] payload)
          Generate NBEvent based on the specified information
 NBEvent generateEvent(int contentSynopsisType, Object contentSynopsis, int templateId, byte[] payload)
          Generate NBEvent based on the specified information
 void generateEventIdentifier(boolean generateId)
          Enable the generation of event identifiers for published events
 Properties getCompressionParameters()
          Get the compression parameters
 Object getContentSynopsis()
          Get the content synopsis
 int getContentSynopsisType()
          Get the content synopsis type
 boolean getDisableTimestamp()
          Determine if generation of timestamps is disabled on the event
 int getEntityId()
          Get the entity identifier
 Properties getFragmentationParameters()
          Get the fragmentation parameters
 Properties getIntegrityParameters()
          Set the integrity parameters
 boolean getNTPTimestamp()
          Determine if the generation of NTP timestamps has been enabled.
 int getNumberOfEventsToBePublished()
          Check number of events to be published
 int getPriority()
          gets the priority of the generated events
 Properties getSecurityParameters()
          Get the security parameters
 boolean getSuppressRedistributionToSource()
          Checks if redistribution of an event back to its source is specified
 int getTemplateId()
          Get the template identifier
 int getTimeToLive()
          Get the time to live
 boolean hasEventsToBePublished()
          CHeck if there are pending events to be published
 boolean isPersistent()
          Checks if producer generate persistent events
 boolean isTransient()
          Checks if producer generate transient events
 void publishEvent(NBEvent nbEvent)
          Publish an event
 void publishEvent(NBEvent nbEvent, ProducerConstraints producerConstraints)
          Publish an event based on the specified Qos constraints
 long recover(int templateId, NBRecoveryListener recoveryListener)
          This is called by an entity to recover from failures or prolonged disconnects
 void setCompressionParameters(Properties props)
          Set the compression parameters
 void setContentSynopsisInfo(int contentSynopsisType, Object contentSynopsis)
          Set the content synopsis information
 void setDisableTimestamp(boolean disableTimestamp)
          Disables the generation of timestamps on the event
 void setFragmentationParameters(Properties props)
          Set the fragmentation parameters
 void setHighResolutionTimestamp(boolean useHRtimestamp)
          Enable or disable the use of high-resolution timers for timestamps.
 void setIntegrityParameters(Properties props)
          Set the integrity parameters
 void setNBNotificationListener(NBNotificationListener nbNotificationListener)
          Sets the notification listener for this producer
 void setNTPTimestamp(boolean useNtpTimestamp)
          Enable or disable the generation of NTP timestamps for messages.
 void setPersistent(boolean isPersistent)
          Sets the producer to generate persistent events
 void setPriority(int priority)
          Sets the priority of the event
 void setSecurityParameters(Properties props)
          Set the security parameters
 void setSuppressRedistributionToSource(boolean routeToSource)
          Prevents the redistribution of an event back to its source
 void setTemplateId(int templateId)
          Set the template identifier
 void setTimeToLive(int timeToLive)
          Set the time to live
 void setTransient(boolean isTransient)
          Sets the producer to generate transient events
 

Method Detail

setTemplateId

void setTemplateId(int templateId)
Set the template identifier


setDisableTimestamp

void setDisableTimestamp(boolean disableTimestamp)
Disables the generation of timestamps on the event


setNTPTimestamp

void setNTPTimestamp(boolean useNtpTimestamp)
Enable or disable the generation of NTP timestamps for messages. The default is false. Note that this feature may not work depending on the location of your firewall or the availability of NTP servers in your country/continent.


setHighResolutionTimestamp

void setHighResolutionTimestamp(boolean useHRtimestamp)
Enable or disable the use of high-resolution timers for timestamps. This is especially true on systems such as NT, XP where the Java system call returns a time that can be off by several milliseconds. Any client that uses this needs to ensure that the ServiceConfiguration.txt is appropriately specified with right setting for the NB_HOME variable


generateEventIdentifier

void generateEventIdentifier(boolean generateId)
Enable the generation of event identifiers for published events


setSuppressRedistributionToSource

void setSuppressRedistributionToSource(boolean routeToSource)
Prevents the redistribution of an event back to its source


setTimeToLive

void setTimeToLive(int timeToLive)
Set the time to live


setPersistent

void setPersistent(boolean isPersistent)
Sets the producer to generate persistent events


setTransient

void setTransient(boolean isTransient)
Sets the producer to generate transient events


setPriority

void setPriority(int priority)
Sets the priority of the event


setFragmentationParameters

void setFragmentationParameters(Properties props)
Set the fragmentation parameters


setSecurityParameters

void setSecurityParameters(Properties props)
Set the security parameters


setCompressionParameters

void setCompressionParameters(Properties props)
Set the compression parameters


setIntegrityParameters

void setIntegrityParameters(Properties props)
Set the integrity parameters


setContentSynopsisInfo

void setContentSynopsisInfo(int contentSynopsisType,
                            Object contentSynopsis)
Set the content synopsis information


generateEvent

NBEvent generateEvent(byte[] payload)
                      throws ServiceException
Generate NBEvent based on the specified information

Throws:
ServiceException

generateEvent

NBEvent generateEvent(int contentSynopsisType,
                      Object contentSynopsis,
                      byte[] payload)
                      throws ServiceException
Generate NBEvent based on the specified information

Throws:
ServiceException

generateEvent

NBEvent generateEvent(int contentSynopsisType,
                      Object contentSynopsis,
                      EventID correlationId,
                      byte[] payload)
                      throws ServiceException
Generate NBEvent based on the specified information

Throws:
ServiceException

generateEvent

NBEvent generateEvent(int contentSynopsisType,
                      Object contentSynopsis,
                      int templateId,
                      byte[] payload)
                      throws ServiceException
Generate NBEvent based on the specified information

Throws:
ServiceException

getTemplateId

int getTemplateId()
Get the template identifier


getEntityId

int getEntityId()
Get the entity identifier


getDisableTimestamp

boolean getDisableTimestamp()
Determine if generation of timestamps is disabled on the event


getNTPTimestamp

boolean getNTPTimestamp()
Determine if the generation of NTP timestamps has been enabled.


getSuppressRedistributionToSource

boolean getSuppressRedistributionToSource()
Checks if redistribution of an event back to its source is specified


getTimeToLive

int getTimeToLive()
Get the time to live


isPersistent

boolean isPersistent()
Checks if producer generate persistent events


isTransient

boolean isTransient()
Checks if producer generate transient events


getPriority

int getPriority()
gets the priority of the generated events


getFragmentationParameters

Properties getFragmentationParameters()
Get the fragmentation parameters


getSecurityParameters

Properties getSecurityParameters()
Get the security parameters


getCompressionParameters

Properties getCompressionParameters()
Get the compression parameters


getIntegrityParameters

Properties getIntegrityParameters()
Set the integrity parameters


getContentSynopsisType

int getContentSynopsisType()
Get the content synopsis type


getContentSynopsis

Object getContentSynopsis()
Get the content synopsis


close

void close()
Close the Event Producer


setNBNotificationListener

void setNBNotificationListener(NBNotificationListener nbNotificationListener)
Sets the notification listener for this producer


createProducerConstraints

ProducerConstraints createProducerConstraints(TemplateInfo templateInfo)
                                              throws ServiceException
Create producer constraints associated with a certain template

Throws:
ServiceException

publishEvent

void publishEvent(NBEvent nbEvent)
                  throws ServiceException
Publish an event

Throws:
ServiceException

publishEvent

void publishEvent(NBEvent nbEvent,
                  ProducerConstraints producerConstraints)
                  throws ServiceException
Publish an event based on the specified Qos constraints

Throws:
ServiceException

hasEventsToBePublished

boolean hasEventsToBePublished()
CHeck if there are pending events to be published


getNumberOfEventsToBePublished

int getNumberOfEventsToBePublished()
Check number of events to be published


recover

long recover(int templateId,
             NBRecoveryListener recoveryListener)
             throws ServiceException
This is called by an entity to recover from failures or prolonged disconnects

Throws:
ServiceException


For comments and suggestions please send e-mail to The NaradaBrokering Project