Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Bug_3154_Regression / test.idl
blob184d66052bb6c55b62e46e6f89b224643c291313
1 // The next include is TAO specific.
2 #include "orbsvcs/FT_CORBA_ORB.idl"
4 #include "orbsvcs/CosNotification.idl"
5 #include "orbsvcs/PortableGroup.idl"
7 #pragma prefix "omg.org"
9 /**
10 * This module describes interfaces and data types of the CORBA
11 * Fault Tolerance service.
14 module FT
16 /// Specification for the Common Types and Exceptions for
17 /// ReplicationManager
19 /// Forward declarations
20 interface GenericFactory;
21 interface FaultNotifier;
23 /// Useful typedefs.
24 typedef CORBA::RepositoryId _TypeId;
25 typedef Object ObjectGroup;
27 typedef any Value;
29 /**
30 * @struct Property
32 * @brief A property name and a value association.
34 struct Property {
35 Value val;
38 /// Some mor euseful typedefs.
39 typedef sequence<Property> Properties;
40 typedef Properties Criteria;
42 /**
43 * @struct FactoryInfo
45 * @brief <@todo>
48 struct FactoryInfo {
49 GenericFactory the_factory;
50 Criteria the_criteria;
53 typedef sequence<FactoryInfo> FactoryInfos;
55 typedef long ReplicationStyleValue;
56 const ReplicationStyleValue STATELESS = 0;
57 const ReplicationStyleValue COLD_PASSIVE = 1;
58 const ReplicationStyleValue WARM_PASSIVE = 2;
59 const ReplicationStyleValue ACTIVE = 3;
60 const ReplicationStyleValue ACTIVE_WITH_VOTING = 4;
61 typedef long MembershipStyleValue;
62 const MembershipStyleValue MEMB_APP_CTRL = 0;
63 const MembershipStyleValue MEMB_INF_CTRL = 1;
64 typedef long ConsistencyStyleValue;
65 const ConsistencyStyleValue CONS_APP_CTRL = 0;
66 const ConsistencyStyleValue CONS_INF_CTRL = 1;
67 typedef long FaultMonitoringStyleValue;
68 const FaultMonitoringStyleValue PULL = 0;
69 const FaultMonitoringStyleValue PUSH = 1;
70 const FaultMonitoringStyleValue NOT_MONITORED = 2;
71 typedef long FaultMonitoringGranularityValue;
72 const FaultMonitoringGranularityValue MEMB = 0;
73 const FaultMonitoringGranularityValue LOC = 1;
74 const FaultMonitoringGranularityValue LOC_AND_TYPE = 2;
75 typedef FactoryInfos FactoriesValue;
76 typedef unsigned short InitialNumberReplicasValue;
77 typedef unsigned short MinimumNumberReplicasValue;
79 typedef TimeBase::TimeT CheckpointIntervalValue;
80 exception InterfaceNotFound {};
81 exception ObjectGroupNotFound {};
82 exception MemberNotFound {};
83 exception MemberAlreadyPresent {};
84 exception BadReplicationStyle {};
85 exception ObjectNotCreated {};
86 exception ObjectNotAdded {};
87 exception PrimaryNotSet {};
88 exception UnsupportedProperty {
89 Value val;
92 exception InvalidProperty {
93 Value val; };
95 exception NoFactory {
96 _TypeId type_id; };
98 exception InvalidCriteria {
99 Criteria invalid_criteria; };
101 exception CannotMeetCriteria {
102 Criteria unmet_criteria; };
104 // Specification of PropertyManager Interface
105 // which ReplicationManager Inherits
107 interface PropertyManager {
109 void set_default_properties(in Properties props)
110 raises (InvalidProperty, UnsupportedProperty);
111 Properties get_default_properties();
113 void remove_default_properties(in Properties props)
114 raises (InvalidProperty, UnsupportedProperty);
116 void set_type_properties(in _TypeId type_id,
117 in Properties overrides)
118 raises (InvalidProperty, UnsupportedProperty);
120 Properties get_type_properties(in _TypeId type_id);
122 void remove_type_properties(in _TypeId type_id,
123 in Properties props)
124 raises (InvalidProperty, UnsupportedProperty);
126 void set_properties_dynamically(in ObjectGroup object_group,
127 in Properties overrides)
128 raises(ObjectGroupNotFound, InvalidProperty, UnsupportedProperty);
130 Properties get_properties(in ObjectGroup object_group)
131 raises(ObjectGroupNotFound); };
133 // Specification of ObjectGroupManager Interface
134 // which ReplicationManager Inherits
136 * This interface provides operations that allow an application to add, remove
137 * and locate members of an object group and to obtain the current reference and
138 * identifier for an object group.
142 interface ObjectGroupManager {
144 * This operation allows the application to exercise explicit control over the
145 * creation of a member of an object group, and to determine where the member
146 * is created.
148 * @param object_group Reference for the object group to which the member is
149 * to be added.
150 * @param the_location The physical location.
151 * @param type_id The repository identifier for the type of the object.
152 * @param the_criteria Parameters to be passed to the factory, which the factory
153 * evaluates before creating the object.
155 * @return The object group reference of the object group with the member added.
157 ObjectGroup create_member(in ObjectGroup object_group,
158 in _TypeId type_id,
159 in Criteria the_criteria)
160 raises(ObjectGroupNotFound,
161 MemberAlreadyPresent,
162 NoFactory,
163 ObjectNotCreated,
164 InvalidCriteria,
165 CannotMeetCriteria);
168 * This operation allows an application to add an existing object to an object
169 * group at a particular location.
171 * @param object_group Reference for the object group to which the existing object
172 * is to be added.
173 * @param the_location The physical location of the object to be added.
174 * @param member The reference of the object to be added.
176 * @return The object group reference of the object group with the object added.
178 ObjectGroup add_member(in ObjectGroup object_group,
179 in Object member)
180 raises(ObjectGroupNotFound,
181 MemberAlreadyPresent,
182 ObjectNotAdded);
185 * This operation allows an application to remove a member from an object
186 * group at a particular location.
188 * @param object_group Reference for the object group to which the member
189 * is to be removed.
190 * @param the_location The physical location of the member to be removed.
192 * @return The object group reference of the member removed.
194 ObjectGroup remove_member(in ObjectGroup object_group)
195 raises(ObjectGroupNotFound,
196 MemberNotFound);
199 * This operation allows the application to select the member of the object group
200 * that is to be the primary.
202 * @param object_group Reference for the object group whose primary is to be
203 * determined.
204 * @param the_location The physical location of the member that is to become
205 * the primary.
207 * @return The object group reference with the primary member at the given
208 * location.
210 ObjectGroup set_primary_member(in ObjectGroup object_group)
211 raises(ObjectGroupNotFound,
212 MemberNotFound,
213 PrimaryNotSet,
214 BadReplicationStyle);
216 ObjectGroupId get_object_group_id(in ObjectGroup object_group)
217 raises(ObjectGroupNotFound);
219 ObjectGroup get_object_group_ref(in ObjectGroup object_group)
220 raises(ObjectGroupNotFound);
222 Object get_member_ref(in ObjectGroup object_group)
223 raises(ObjectGroupNotFound, MemberNotFound); };
226 // Specification of GenericFactory Interface
227 // which ReplicationManager Inherits and Application Objects Implement
229 * This interface allows the creation/deletion of replicated objects (object groups),
230 * replicas (members of object groups), and unreplicated objects.
232 interface GenericFactory {
233 typedef any FactoryCreationId;
236 * This operation creates an object or an object group, using the type_id
237 * parameter to determine which type of object to create and the_criteria
238 * parameter to determine restrictions on how and where to create the object.
240 * @param type_id The repository identifier of the object to be created by
241 * the factory.
243 * @param the_criteria Information passed to the factory, which the factory
244 * evaluates before creating the object. Examples of criteria are initialization
245 * values, constraints on the object, preferred location of the object, fault
246 * tolerance properties for an object group, etc.
248 * @param factory_creation_id An identifier that allows the factory to delete
249 * the object subsequently.
251 * @return The reference to the object created by the GenericFactory. When the
252 * GenericFactory interface is implemented by the application’s local factory
253 * object, the create_object() operation returns an object reference as a result.
254 * When the GenericFactory interface is inherited by the Replication Manager, the
255 * create_object() operation returns an object group reference as a result.
257 * @exception NoFactory Raised if the factory cannot create an individual object
258 * of the type_id at the location.
259 * @exception ObjectNotCreated Raised if the factory cannot create the object.
260 * @exception InvalidCriteria Raised if the factory does not understand the criteria.
261 * @exception InvalidProperty Raised if a property passed in as criteria is invalid.
262 * @exception CannotMeetCriteria Raised if the factory understands the criteria but
263 * cannot satisfy it.
265 Object create_object(in _TypeId type_id,
266 in Criteria the_criteria,
267 out FactoryCreationId factory_creation_id)
268 raises (NoFactory,
269 ObjectNotCreated,
270 InvalidCriteria,
271 InvalidProperty,
272 CannotMeetCriteria); };
274 // Specification of ReplicationManager Interface
275 interface ReplicationManager : PropertyManager,
276 ObjectGroupManager,
277 GenericFactory {
278 void register_fault_notifier(in FaultNotifier fault_notifier);
279 FaultNotifier get_fault_notifier()
280 raises (InterfaceNotFound); };
282 // Specification of FaultNotifier Interface
283 interface FaultNotifier {
284 typedef unsigned long long ConsumerId;
286 void push_structured_fault(
287 in CosNotification::StructuredEvent event);
289 void push_sequence_fault(
290 in CosNotification::EventBatch events);
294 // Specifications for Logging and Recovery
295 typedef sequence<octet> State;
297 exception NoStateAvailable {};
298 exception InvalidState {};
300 exception NoUpdateAvailable {};
301 exception InvalidUpdate {};
303 // Specification of Checkpointable Interface
304 // which Updateable and Application Objects Inherit
305 interface Checkpointable { State get_state()
306 raises(NoStateAvailable);
307 void set_state(in State s) raises(InvalidState); };
309 // Specification of Updateable Interface
310 // which Application Objects Inherit
311 interface Updateable : Checkpointable { State get_update()
312 raises(NoUpdateAvailable);
313 void set_update(in State s) raises(InvalidUpdate);