class Sienaclass Notifiableclass Requestclass AttributeValueclass Eventclass AttributeConstraintclass Filterclass Patternclass Siena::Siena

Siena C++ API documentation.

## class Sienaclass Notifiableclass Requestclass AttributeValueclass Eventclass AttributeConstraintclass Filterclass Patternclass Siena

> Interface of the event service.

## Inheritance:

### Public Fields

static const char* Version
  Version identifier for the Siena interface

### Public Methods

virtual void publish(const Event &e)
  publish an event
virtual void subscribe(const Filter &f, Notifiable *n)
  subscribes for a given filter.
virtual void subscribe(const Pattern &p, Notifiable *n)
  subscribes for a given pattern.
virtual void unsubscribe(const Filter &f, Notifiable *n)
  cancels previous subcriptions.
virtual void unsubscribe(const Pattern &p, Notifiable *n)
  cancels previous subcriptions.
virtual void advertise(const Filter &f)
  announces the intention to notify a class of events
virtual void unadvertise(const Filter &)
  cancels previous advertisements
virtual void disconnect(Notifiable *)
  cancels all previous subcriptions from a given subscriber.
virtual void suspend(Notifiable *n)
  temporarily suspend the delivery of notifications to a given subscriber.
virtual void resume(Notifiable *)
  resume the delivery of notifications to a previously suspended subscriber.

## Documentation

> A `Siena` object represents the access point to the Siena event service. Clients can publish and subscribe by calling the corresponding methods on a `Siena` object.

> Example:

>         Siena * S = new SimpleSiena();

>         Event e;

>         e["price"] = 500;
>         e["airline"] = "UA";
>         e["dest"] = "MXP";

>         S->publish(e);

`virtual void publish(const Event &e)`
  injects event `e` into the event service. A copy of `e` will be delivered to all those interested parties that subscribed for matching filters.

  Example:

      	Siena * S;
      	        Event e;

      	e["price"] = 500;
      	e["airline"] = "UA";
      	e["dest"] = "MXP";

      	S->publish(e);

  Throws:
    SienaException
  Parameters:
    e - event to be published

`virtual void subscribe(const Filter &f, Notifiable *n)`
  subscribes for a given filter. interested party `n` will receive notifications matching filter `f`.

  Example:

      	Siena * S;
      	Notifiable * n;
      		Filter f;
      	f.add_constraint("price", Siena_lt, 700);
      	f.add_constraint("dest", Siena_eq, "MXP");

      	S->subscribe(f,n);

  Throws:
    SienaException
  Parameters:
    f - filter that matches events of interest
    n - subscriber
  See Also:
    unsubscribe

`virtual void subscribe(const Pattern &p, Notifiable *n)`
  subscribes for a given pattern.
  Parameters:
    p - pattern of sequences of events of interest
    n - subscriber
  See Also:
    unsubscribe

`virtual void unsubscribe(const Filter &f, Notifiable *n)`
  cancel all previous subscriptions from interested party `n` with a filter g that is covered by filter `f`.

  Example:

      	Siena * S;
      	Notifiable * n;
      		Filter f;

      	f.add_constraint("dest", Siena_xx, 0);

      	S->unsubscribe(f,n);

  Note that a filter [dest any] covers the filter of the previous example [price < 700, dest == "MXP"]
  Parameters:
    f - expresses filters to be cancelled
    n - subscriber
  See Also:
    subscribe

`virtual void unsubscribe(const Pattern &p, Notifiable *n)`
  cancel all previous subscriptions from interested party `n` with a pattern q that is covered by pattern `p`.
  Parameters:
    p - expresses patterns to be cancelled
    n - subscriber

`virtual void disconnect(Notifiable *)`
  cancel all previous subscriptions from interested party `n`.
  Parameters:
    n - subscriber

`virtual void suspend(Notifiable *n)`
  not yet implemented!
  Parameters:
    n - subscriber

`virtual void resume(Notifiable *)`
  not yet implemented!
  Parameters:
    n - subscriber

Direct child classes:
  SimpleSiena

Author:
  Antonio Carzaniga
Version:
  3.1415
See Also:
  SimpleSiena

Alphabetic index HTML hierarchy of classes or Java

This document is part of Siena. Please, direct any comment or suggestion to Antonio Carzaniga