// -*- c++ -*-

#ifndef __POLICY_IDL__
#define __POLICY_IDL__

#include "config.idl"

#include <mico/ir.idl>

#pragma prefix "omg.org"

module CORBA {

  typedef unsigned long PolicyType;

  interface Policy {
    readonly attribute PolicyType policy_type;
    Policy copy ();
    void destroy ();
  };

  typedef sequence<Policy> PolicyList;

  enum SetOverrideType {
      SET_OVERRIDE,
      ADD_OVERIDE
  };
  
  interface DomainManager {
    Policy get_domain_policy (in PolicyType policy_type);
    void set_domain_policy (in Policy policy);
    DomainManager copy ();
  };

  const PolicyType SecConstruction = 11;

  interface ConstructionPolicy : Policy {
    void make_domain_manager (in CORBA::InterfaceDef object_type,
			      in boolean constr_policy);
    boolean constr_policy (in Object _object);
  };

  typedef sequence<DomainManager> DomainManagerList;

#ifdef USE_CSL2
  // for ODM
  typedef sequence<PolicyType> PolicyTypeSeq;
#endif /* USE_CSL2  */

  typedef short PolicyErrorCode;
  const PolicyErrorCode BAD_POLICY = 0;
  const PolicyErrorCode UNSUPPORTED_POLICY = 1;
  const PolicyErrorCode BAD_POLICY_TYPE = 2;
  const PolicyErrorCode BAD_POLICY_VALUE = 3;
  const PolicyErrorCode UNSUPPORTED_POLICY_VALUE = 4;

  exception PolicyError {
      PolicyErrorCode reason;
  };
};

#endif // __POLICY_IDL__
