//File: CosCompoundLifeCycle.idl
//Part of the LifeCycle Service

#ifndef _COS_COMPOUND_LIFE_CYCLE_IDL_
#define _COS_COMPOUND_LIFE_CYCLE_IDL_

// omniORB specific pragmas to insert extra includes into the stub header.
#pragma hh #include "COS_sysdep.h"

#include <CosLifeCycle.idl>
#include <CosRelationships.idl>
#include <CosGraphs.idl>

#pragma prefix "omg.org"

module CosCompoundLifeCycle {
	interface OperationsFactory; 
	interface Operations;
	interface Node;
	interface Role;
	interface Relationship;
	interface PropagationCriteriaFactory;
	
	enum Operation {copy, move, remove};

	struct RelationshipHandle {
		CosRelationships::Relationship the_relationship;
		CosObjectIdentity::ObjectIdentifier constant_random_id;
	};

	interface OperationsFactory {
		Operations create_compound_operations();
	};

	interface Operations {
		Node copy (
			in Node starting_node,
			in CosLifeCycle::FactoryFinder there,
			in CosLifeCycle::Criteria the_criteria)
			raises (CosLifeCycle::NoFactory,
					CosLifeCycle::NotCopyable,
					CosLifeCycle::InvalidCriteria,
					CosLifeCycle::CannotMeetCriteria);
		void move (
			in Node starting_node,
			in CosLifeCycle::FactoryFinder there,
			in CosLifeCycle::Criteria the_criteria)
			raises (CosLifeCycle::NoFactory,
					CosLifeCycle::NotMovable,
					CosLifeCycle::InvalidCriteria,
					CosLifeCycle::CannotMeetCriteria);
		void remove (in Node starting_node)
			raises (CosLifeCycle::NotRemovable);
		void destroy();
		};

	interface Node : CosGraphs::Node {
		exception NotLifeCycleObject {};
		void copy_node ( 
			in CosLifeCycle::FactoryFinder there,
			in CosLifeCycle::Criteria the_criteria,
			out Node new_node,
			out Roles roles_of_new_node)
			raises (CosLifeCycle::NoFactory,
					CosLifeCycle::NotCopyable,
					CosLifeCycle::InvalidCriteria,
					CosLifeCycle::CannotMeetCriteria);
		void move_node (
			in CosLifeCycle::FactoryFinder there, 
			in CosLifeCycle::Criteria the_criteria)
			raises (CosLifeCycle::NoFactory,
				CosLifeCycle::NotMovable,
				CosLifeCycle::InvalidCriteria,
				CosLifeCycle::CannotMeetCriteria);
		void remove_node ()
			raises (CosLifeCycle::NotRemovable);
		CosLifeCycle::LifeCycleObject get_life_cycle_object()
			raises (NotLifeCycleObject);
		};

	interface Role : CosGraphs::Role {
		Role copy_role (
			in CosLifeCycle::FactoryFinder there, 
			in CosLifeCycle::Criteria the_criteria)
			raises (CosLifeCycle::NoFactory,
					CosLifeCycle::NotCopyable,
					CosLifeCycle::InvalidCriteria,
					CosLifeCycle::CannotMeetCriteria);
		void move_role (
			in CosLifeCycle::FactoryFinder there, 
			in CosLifeCycle::Criteria the_criteria)
			raises (CosLifeCycle::NoFactory,
					CosLifeCycle::NotMovable,
					CosLifeCycle::InvalidCriteria,
					CosLifeCycle::CannotMeetCriteria);
		CosGraphs::PropagationValue life_cycle_propagation (
			in Operation op,
			in RelationshipHandle rel,
			in CosRelationships::RoleName to_role_name,
			out boolean same_for_all);
		};

	interface Relationship : CosRelationships::Relationship {
		
		Relationship copy_relationship (
			in CosLifeCycle::FactoryFinder there,
			in CosLifeCycle::Criteria the_criteria,
			in CosGraphs::NamedRoles new_roles)
			raises (CosLifeCycle::NoFactory,
					CosLifeCycle::NotCopyable,
					CosLifeCycle::InvalidCriteria,
					CosLifeCycle::CannotMeetCriteria);
		void move_relationship (
			in CosLifeCycle::FactoryFinder there,
			in CosLifeCycle::Criteria the_criteria)
			raises (CosLifeCycle::NoFactory,
					CosLifeCycle::NotMovable,
					CosLifeCycle::InvalidCriteria,
					CosLifeCycle::CannotMeetCriteria);
		CosGraphs::PropagationValue life_cycle_propagation (
			in Operation op,
			in CosRelationships::RoleName from_role_name,
			in CosRelationships::RoleName to_role_name,
			out boolean same_for_all);
	};

	interface PropagationCriteriaFactory {
		CosGraphs::TraversalCriteria create(in Operation op);
	};

};

#endif /* ifndef _COS_COMPOUND_LIFE_CYCLE_IDL_ */

