//Platform Independent Model (PIM) and Platform Specific Model (PSM)
//for Super Distributed Objects (SDO) Specification, v1.1 - OMG IDL Summary File
//Object Management Group, Inc.
//Copyright (c) 2003, Fraunhofer FOKUS
//Copyright (c) 2003, Hitachi, Ltd.
//The companies listed above have granted to the Object Management Group, Inc. 
//(OMG) a nonexclusive, royalty-free, paid up, worldwide license to copy and 
//distribute this document and to modify this document and distribute copies of 
//the modified version. Each of the copyright holders listed above has agreed 
//that no person shall be deemed to have infringed the copyright in the included 
//material of any such copyright holder by reason of having used the 
//specification set forth herein or having conformed any computer software to 
//the specification. 
//
//This file contains OMG IDL from the Naming Service Specification, v1.2.
//OMG regularly publishes a summary file that contains all the "code" parts of 
//an OMG formal document. Every formal document line that is IDL, PIDL, or 
//language code is included in the summary file. The reason for such a listing 
//is to give readers an electronic version of the "code" so that they can 
//extract pieces of it. Readers might want to test an example, include it in 
//their own code, or use it for documentation purposes. Having the code lines 
//available electronically means there is less likelihood of a transcription 
//error. 
//
// ver 1.0  formal/2004-11-02
// ver 1.1  (RTF report: dtc/2008-03-05)
//
//SDOPackage.idl

#ifndef    _SDO_PACKAGE_IDL_
#define    _SDO_PACKAGE_IDL_

#ifdef TAO_IDL
#include <orb.idl>
#endif
#ifdef USE_MONITORING
#include <CosNotifyComm.idl>
#endif
#ifndef ORBIT2_IDL
#define TypeCode CORBA::TypeCode
#endif
/** CORBA specific model for SDOs */

#pragma prefix "org.omg"
#define exception_body { string description; }

module SDOPackage
{
  interface SDO;
  interface SDOService;
  interface SDOSystemElement;
  interface Configuration;
  interface Monitoring;
  interface Organization;
  
  /** ------- Data Types -------*/
  typedef sequence<string>       StringList;
  typedef sequence<SDO>          SDOList;
  typedef sequence<Organization> OrganizationList;
  typedef string                 UniqueIdentifier;

  struct NameValue
  {
    string name;
    any value;
  };

  typedef sequence<NameValue>   NVList;

  enum NumericType
  {
    SHORT_TYPE,
    LONG_TYPE,
    FLOAT_TYPE,
    DOUBLE_TYPE
  };

  union Numeric switch (NumericType)
  {
  case SHORT_TYPE:  short short_value;
  case LONG_TYPE: long long_value;
  case FLOAT_TYPE: float float_value;
  case DOUBLE_TYPE: double double_value;
  };

  struct EnumerationType
  {
    StringList enumerated_values;
  };

  struct RangeType
  {
    Numeric min;
    Numeric max;
    boolean min_inclusive;
    boolean max_inclusive;
  };

  struct IntervalType
  {
    Numeric min;
    Numeric max;
    boolean min_inclusive;
    boolean max_inclusive;
    Numeric step;
  };

  enum ComplexDataType
  {
    ENUMERATION, RANGE, INTERVAL
  };

  union AllowedValues switch (ComplexDataType)
  {
  case ENUMERATION:    EnumerationType allowed_enum;
  case INTERVAL:       IntervalType allowed_interval;
  case RANGE:          RangeType   allowed_range;
  };

  struct Parameter
  {
    string         name;
    TypeCode       type;
    AllowedValues  allowed_values;
  };

  typedef sequence<Parameter> ParameterList;
  struct OrganizationProperty
  {
    NVList properties;
  };
  enum DependencyType
  {
    OWN,
    OWNED,
    NO_DEPENDENCY
  };

  struct DeviceProfile
  {
    string device_type;
    string manufacturer;
    string model;
    string version;
    NVList properties;
  };

  struct ServiceProfile
  {
    string id;
    string interface_type;
    NVList properties;
    SDOService service;
  };

  typedef sequence <ServiceProfile> ServiceProfileList;
  struct ConfigurationSet
  {
    string id;
    string description;
    NVList configuration_data;
  };

  typedef sequence<ConfigurationSet> ConfigurationSetList;


  /** ------- Exceptions -------*/
  exception NotAvailable             exception_body;
  exception InterfaceNotImplemented  exception_body;
  exception InvalidParameter         exception_body;
  exception InternalError            exception_body;
  
  /** ------- Interfaces -------*/
  interface SDOSystemElement
  {
    OrganizationList get_owned_organizations()
      raises (NotAvailable,InternalError);
  };
  interface SDO : SDOSystemElement
  {
    UniqueIdentifier get_sdo_id()
      raises (NotAvailable, InternalError);
    string get_sdo_type()
      raises (NotAvailable, InternalError);
    DeviceProfile get_device_profile ()
      raises (NotAvailable, InternalError);
    ServiceProfileList get_service_profiles ()
      raises (NotAvailable, InternalError);
    ServiceProfile get_service_profile (in UniqueIdentifier id)
      raises (InvalidParameter, NotAvailable, InternalError);
    SDOService get_sdo_service (in UniqueIdentifier id) 
      raises (InvalidParameter, NotAvailable, InternalError);
    Configuration get_configuration ()
      raises (InterfaceNotImplemented, NotAvailable, InternalError);
    Monitoring get_monitoring ()
      raises (InterfaceNotImplemented, NotAvailable, InternalError);
    OrganizationList get_organizations ()
      raises (NotAvailable, InternalError);
    NVList get_status_list ()
      raises (NotAvailable, InternalError);
    any get_status (in string nme)
      raises (InvalidParameter, NotAvailable, InternalError);
  };


  interface Configuration
  {
    boolean set_device_profile (in DeviceProfile dProfile)
      raises (InvalidParameter, NotAvailable, InternalError);
    boolean add_service_profile (in ServiceProfile sProfile)
      raises (InvalidParameter, NotAvailable, InternalError);
    boolean add_organization (in Organization organization_object)
      raises (InvalidParameter, NotAvailable, InternalError);
    boolean remove_service_profile (in UniqueIdentifier id)
      raises (InvalidParameter, NotAvailable, InternalError);
    boolean remove_organization (in UniqueIdentifier organization_id)
      raises (InvalidParameter, NotAvailable, InternalError);
    ParameterList get_configuration_parameters ()
      raises (NotAvailable, InternalError);
    NVList get_configuration_parameter_values ()
      raises (NotAvailable, InternalError);
    any get_configuration_parameter_value (in string name)
      raises (InvalidParameter, NotAvailable, InternalError);
    boolean set_configuration_parameter (in string name,
                                         in any value)
      raises (InvalidParameter, NotAvailable, InternalError);
    ConfigurationSetList get_configuration_sets ()
      raises (NotAvailable, InternalError);
    ConfigurationSet get_configuration_set (in UniqueIdentifier config_id)
      raises (NotAvailable, InternalError);
    boolean set_configuration_set_values (in ConfigurationSet configuration_set)
      raises (InvalidParameter, NotAvailable, InternalError);
    ConfigurationSet get_active_configuration_set ()
      raises (NotAvailable, InternalError);
    boolean add_configuration_set (in ConfigurationSet configuration_set)
      raises (InvalidParameter, NotAvailable, InternalError);
    boolean remove_configuration_set (in UniqueIdentifier config_id)
      raises (InvalidParameter, NotAvailable, InternalError);
    boolean activate_configuration_set (in UniqueIdentifier config_id)
      raises (InvalidParameter, NotAvailable, InternalError);
  };


#ifdef USE_MONITORING
  interface Monitoring : CosNotifyComm::StructuredPushConsumer,
    CosNotifyComm::StructuredPushSupplier
  {
    any get_monitoring_parameter_value (in string name)
      raises (InvalidParameter, NotAvailable, InternalError);
    ParameterList get_monitoring_parameters ()
      raises (NotAvailable, InternalError);
    NVList get_monitoring_parameter_values ()
      raises (NotAvailable, InternalError);
  };
#else
  interface Monitoring {};
#endif

  interface SDOService {};
  
  interface Organization
  {
    UniqueIdentifier get_organization_id ()
      raises (InvalidParameter, NotAvailable, InternalError);
    OrganizationProperty get_organization_property ()
      raises (NotAvailable, InternalError);
    any get_organization_property_value (in string name)
      raises (InvalidParameter, NotAvailable, InternalError);
    boolean add_organization_property (in OrganizationProperty organization_property)
      raises (InvalidParameter, NotAvailable, InternalError);
    boolean set_organization_property_value (in string name,
                                             in any value)
      raises (InvalidParameter, NotAvailable, InternalError);
    boolean remove_organization_property ( in string name )
      raises (InvalidParameter, NotAvailable, InternalError);
    SDOSystemElement get_owner ()
      raises (NotAvailable, InternalError);
    boolean set_owner (in SDOSystemElement sdo) 
      raises (InvalidParameter, NotAvailable, InternalError);
    SDOList get_members ()
      raises (NotAvailable, InternalError);
    boolean set_members (in SDOList sdos) 
      raises (InvalidParameter, NotAvailable, InternalError);
    boolean add_members ( in SDOList sdo_list)
      raises (InvalidParameter, NotAvailable, InternalError);
    boolean remove_member (in UniqueIdentifier id)
      raises (InvalidParameter, NotAvailable, InternalError);
    DependencyType get_dependency()
      raises (NotAvailable, InternalError);
    boolean set_dependency (in DependencyType dependency) 
      raises (NotAvailable, InternalError);
  };
};
#endif //_SDO_PACKAGE_IDL_
