// CosCompoundLifeCycle Module, p 6-30 CORBAservices,
// Life Cycle Service V1.0, 3/94

#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 {
                        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 CosGraphs::Node::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);
        };

};
