/**
 * @file Distributor.idl

 * @author Shanshan Jiang <shanshan.jiang@vanderbilt.edu>
 * @author William R. Otte <wotte@dre.vanderbilt.edu>
 * @author Douglas C. Schmidt <schmidt@dre.vanderbilt.edu>
 *
 * Contains IDL definitions for the Distributor in the Publish/Subscribe Real-time CORBA
 * Stock Quoter Service.
 */

#ifndef QUOTER_DISTRIBUTOR_IDL
#define QUOTER_DISTRIBUTOR_IDL

#include "Common.idl"
#include "tao/RTCORBA/RTCORBA_include.pidl"

module Stock
{
  exception Invalid_Subscription
  {
  };

  /**
   * @class StockDistributor
   * @brief Provides interfaces for stock distributor server.
   */
  interface StockDistributor : Trigger
  {
    /// Event source operation to establish connectivity.
    /// @param c An object reference to the consumer the distributor should notify
    /// @returns A cookie used to identify the subscription.
    Cookie subscribe_notifier (in Stock::StockNameConsumer c,
                               in RTCORBA::Priority priority);

    /// Opteration to discontinue connectivity.
    /// @param ck The cookie that identifies the connection to be terminated.
    Stock::StockNameConsumer unsubscribe_notifier (in Cookie ck)
      raises (Invalid_Subscription);

    /// Factory operation to return StockQuoter object reference.
    /// @param The cookie returned from the call to subscribe notifier.
    /// This is used to control the priority that the Quoter runs at.
    StockQuoter provide_quoter_info (in Cookie ck)
      raises (Invalid_Subscription);

    /// Controls rate of updates.
    attribute long notification_rate;

    /// Shutdown the object and terminate the application
    oneway void shutdown ();
  };

  /**
   * @class StockDistributorHome
   * @brief Interface that aids in managing StockDistributor lifecycles.
   */
  interface StockDistributorHome
  {
    /// Create a StockDistributor object.
    StockDistributor create ();
  };
};

#endif
