summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/FT_NamingReplication.idl
blob: 949ac9f39bee8dd0f68187bb0bf8dfb7940b30a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/* -*- IDL -*- */
//=============================================================================
/**
 *  @file    FT_NamingReplication.idl
 *
 *
 *  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
  {
  };

  exception InvalidPeer
  {
    string reason;
  };

  /*
   * 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
  {
    boolean combined;
    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;
  };

  enum EntityKind {
    ctx_name,
    obj_grp
  };

  union UpdateInfo switch (EntityKind) {
  case ctx_name : NamingContextUpdate ctx;
  case obj_grp  : ObjectGroupUpdate grp;
  };

  typedef sequence<UpdateInfo> UpdateInfoSeq;

  interface UpdatePushNotifier
  {
    oneway void register_peer (in UpdatePushNotifier peer,
                               in ReplicaInfo info,
                               in unsigned long long initial_seq_num);

    void notify_update (in unsigned long long seq_num,
                        inout UpdateInfoSeq info);
  };

  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_