cgl.narada.service.buffering
Interface BufferingService

All Known Implementing Classes:
BufferingServiceImpl

public interface BufferingService

This interface encapsulates all the functiones needed by the buffering service. The buffering service provides a time based ordering of events timestamped by the NB Timing Service.


Method Summary
 boolean getEnforceTimeOrderingConsistency(Object contentSynopsis)
          Indicates if the buffering service enforces time ordering conistency
 int getMaximumBufferSize()
          Returns maximum buffer size.This corresponds to the total size of all the payloads associated with events in the buffer.
 int getMaximumNumberOfEntries()
          Returns the maximum number of entries
 double getReleaseFactor()
          Returns the release factor of the buffer
 String getSortingScheme()
          Returns the current sorting scheme
 int getTotalBufferSize()
          Returns the total size of the buffer.
 int getTotalNumberOfEntries()
          Retrieves the maximum duration after which the oldest element in the buffer is released public long getBufferEntryMaximumDuration(); /** Returns the total number of entries currently present within the buffer
 int releaseAllEntries()
          Releases all the entries currently present in the buffer.
 int releaseAllEntries(long timestamp)
          Releases all entries that occured before the specified timestamp.
 int releaseAllEntries(Object contentSynopsis)
          Releases all the entries with the specified content synopsis.
 void setBufferEntryMaximumDuration(long entryAge)
          Sets the maximum duration after which the oldest element in the buffer is released
 void setEnforceTimeOrderingConsistency(Object contentSynopsis, boolean enforce)
          Ensures that events are ordered while enforcing timing consistencies.
 void setMaximumBufferSize(int maxBufferSize)
          Sets the maximum buffer size.
 void setMaximumNumberOfEntries(int maxEntries)
          Sets the maximum number of entries in the buffering service.
 void setReleaseFactor(double factor)
          Release facotr is a double number between 0 - 1.
 void setSortingScheme(String sortAlgo)
          Sets the scheme for sorting events in the buffers
 void terminateService()
           
 void timeOrderEvent(QosEvent qosEvent)
          Takes QosEvent and puts it into the buffer.
 

Method Detail

setSortingScheme

void setSortingScheme(String sortAlgo)
                      throws ServiceException
Sets the scheme for sorting events in the buffers

Throws:
ServiceException

getSortingScheme

String getSortingScheme()
Returns the current sorting scheme


setMaximumNumberOfEntries

void setMaximumNumberOfEntries(int maxEntries)
                               throws ServiceException
Sets the maximum number of entries in the buffering service. This method throws an exception if the specified value is an invalid one (0 or negative).

Throws:
ServiceException

getMaximumNumberOfEntries

int getMaximumNumberOfEntries()
Returns the maximum number of entries


setReleaseFactor

void setReleaseFactor(double factor)
Release facotr is a double number between 0 - 1. It should not be less than 0.5. the default value is 1.0. Setting this factor to another value causes BufferHandler to release (factor * number of buffer entries)


getReleaseFactor

double getReleaseFactor()
Returns the release factor of the buffer


setEnforceTimeOrderingConsistency

void setEnforceTimeOrderingConsistency(Object contentSynopsis,
                                       boolean enforce)
Ensures that events are ordered while enforcing timing consistencies. The consistencies are enforced based on the timestamp of the last event that was released. This has to be EXPLICTLY set.


getEnforceTimeOrderingConsistency

boolean getEnforceTimeOrderingConsistency(Object contentSynopsis)
Indicates if the buffering service enforces time ordering conistency


setMaximumBufferSize

void setMaximumBufferSize(int maxBufferSize)
                          throws ServiceException
Sets the maximum buffer size. This corresponds to the total size of all the payloads associated with events in the buffer. This method throws an exception if the specified value is an invalid one

Throws:
ServiceException

getMaximumBufferSize

int getMaximumBufferSize()
Returns maximum buffer size.This corresponds to the total size of all the payloads associated with events in the buffer.


setBufferEntryMaximumDuration

void setBufferEntryMaximumDuration(long entryAge)
Sets the maximum duration after which the oldest element in the buffer is released


getTotalNumberOfEntries

int getTotalNumberOfEntries()
Retrieves the maximum duration after which the oldest element in the buffer is released public long getBufferEntryMaximumDuration(); /** Returns the total number of entries currently present within the buffer


getTotalBufferSize

int getTotalBufferSize()
Returns the total size of the buffer. This corresponds to the total size of the content payloads of all the events within the buffer


releaseAllEntries

int releaseAllEntries()
Releases all the entries currently present in the buffer. Returns the total number of entries that were released.


releaseAllEntries

int releaseAllEntries(Object contentSynopsis)
Releases all the entries with the specified content synopsis. Returns the total number of entries that were released.


releaseAllEntries

int releaseAllEntries(long timestamp)
Releases all entries that occured before the specified timestamp. Returns the total number of entries that were released.


timeOrderEvent

void timeOrderEvent(QosEvent qosEvent)
Takes QosEvent and puts it into the buffer. If maximum number of entries and/or maximum buffer size is/are reached, it notifies the BufferHandler thread.


terminateService

void terminateService()
                      throws ServiceException
Throws:
ServiceException


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