/* -*- IDL -*- */
//=============================================================================
/**
 *  @file    FT_NamingReplication.idl
 *
 *  $Id: FT_NamingReplication.idl 96760 2013-02-05 21:11:03Z stanleyk $
 *
 *  This file is part of Fault Tolerant Naming Service in support of
 *  replication between redundant servers.
 *
 *  @author Kevin Stanley <stanleyk@ociweb.com>
 */
//=============================================================================

#ifndef _FT_NAMING_REPLICATION_IDL_
#define _FT_NAMING_REPLICATION_IDL_

#include <orbsvcs/CosNaming.idl>
#include <orbsvcs/FT_NamingManager.idl>
#include <orbsvcs/FT_CORBA_ORB.idl>

module FT_Naming
{

  enum ChangeType { NEW, UPDATED, DELETED };

  exception NotAvailable
  {
  };

  /*
   * A structure that describes the updated element in a Naming Service
   */
  struct NamingContextUpdate
  {
    /// The name of context being updated
    string context_name;
    /// The type of change that is being reported
    ChangeType change_type;
  };

  struct ReplicaInfo
  {
    CosNaming::NamingContext root_context;
    FT_Naming::NamingManager naming_manager;
  };

  /*
   * A structure that describes the updated element within
   * an Object Group Manager
   */
  struct ObjectGroupUpdate
  {
    /// This is used to identify object group references.
    PortableGroup::ObjectGroupId id;
    /// The type of change that is being reported
    ChangeType change_type;
  };

  interface ReplicationManager
  {
   /*
    * Register with a peer replica providing an object reference for
    * notification of updates.  Each replica will maintain their state
    * in a shared repository and the update notification indicates the
    * element that was changed.
    */
    ReplicaInfo register_replica (in ReplicationManager replica,
                                  in ReplicaInfo replica_info)
      raises (NotAvailable);

    oneway void notify_updated_object_group(in ObjectGroupUpdate group_info);

    oneway void notify_updated_context(in NamingContextUpdate context_info);
  };
};


#endif // _FT_NAMING_REPLICATION_IDL_
