// **********************************************************************
//
// Copyright (c) 2002
// IONA Technologies, Inc.
// Waltham, MA, USA
//
// All Rights Reserved
//
// **********************************************************************

#ifndef OBORB_IDL
#define OBORB_IDL

#pragma prefix "omg.org"

#include <OB/Policy.idl>
#include <OB/OBPolicies.idl>
#include <OB/Messaging.idl>
#include <OB/IFR1.idl>
#include <OB/ServiceInfo.idl>
#include <OB/Native.idl>

#pragma prefix "omg.org"

module CORBA
{

local interface _Context;
local interface NVList;

#ifdef OB_CPLUSPLUS
//
// The IDL-to-C++ mapping adds operations with out parameters of these
// interface types
//
local interface NamedValue;
local interface ContextList;
local interface ExceptionList;
local interface Environment;
#endif

local interface OperationDef;

local interface Request;

#ifndef OB_CPLUSPLUS
typedef sequence< Request > RequestSeq;
#endif

//
// Do *not* move ORB to a separate header ORB.idl, to avoid conflicts
// with orb.idl on file systems that are case insensitive
//
local interface ORB
{
#   pragma version ORB 2.3

    typedef string ObjectId;

    typedef sequence< ObjectId > ObjectIdList;

    exception InvalidName { };

    string object_to_string(in Object obj);
    Object string_to_object(in string str);

    void create_list(in long count, out NVList new_list);
    void create_operation_list(in OperationDef oper, out NVList new_list);

    void get_default_context(out _Context ctx);

#ifdef OB_CPLUSPLUS
    //
    // The IDL-to-C++ mapping adds the following operations
    //
    void create_named_value(out NamedValue nmval);
    void create_exception_list(out ExceptionList exclist);
    void create_context_list(out ContextList ctxtlist);
    void create_environment(out Environment new_env);

    typedef sequence< Request > RequestSeq;
#endif

    void send_multiple_requests_oneway(in RequestSeq req);
    void send_multiple_requests_deferred(in RequestSeq req);

    boolean poll_next_response();
    void get_next_response(out Request req);

    boolean get_service_information(in ServiceType service_type,
	                           out ServiceInformation service_information);

    ObjectIdList list_initial_services();

    Object resolve_initial_references(in ObjectId identifier)
	 raises(InvalidName);

    //
    // This will become part of CORBA once the PI spec is adopted
    //
    void register_initial_reference(in ObjectId id,
                                    in Object obj)
	 raises(InvalidName);

    TypeCode create_struct_tc(in RepositoryId id,
			      in Identifier name,
			      in StructMemberSeq members);

    TypeCode create_union_tc(in RepositoryId id,
			     in Identifier name,
			     in TypeCode discriminator_type,
			     in UnionMemberSeq members);

    TypeCode create_enum_tc(in RepositoryId id,
			    in Identifier name,
			    in EnumMemberSeq members);

    TypeCode create_alias_tc(in RepositoryId id,
			     in Identifier name,
			     in TypeCode original_type);

    TypeCode create_exception_tc(in RepositoryId id,
				 in Identifier name,
				 in StructMemberSeq members);

    TypeCode create_interface_tc(in RepositoryId id,
				 in Identifier name);

    TypeCode create_string_tc(in unsigned long bound);

    TypeCode create_wstring_tc(in unsigned long bound);

    TypeCode create_fixed_tc(in unsigned short digits,
			     in short scale);

    TypeCode create_sequence_tc(in unsigned long bound,
				in TypeCode element_type);

    TypeCode create_array_tc(in unsigned long length,
			     in TypeCode element_type);

    TypeCode create_value_tc(in RepositoryId id,
			     in Identifier name,
			     in ValueModifier type_modifier,
			     in TypeCode concrete_base,
			     in ValueMemberSeq members);

    TypeCode create_value_box_tc(in RepositoryId id,
				 in Identifier name,
				 in TypeCode boxed_type);

    TypeCode create_native_tc(in RepositoryId id,
			      in Identifier name);

    TypeCode create_recursive_tc(in RepositoryId id);

    TypeCode create_abstract_interface_tc(in RepositoryId id,
					  in Identifier name);

    TypeCode create_local_interface_tc(in RepositoryId id,
				       in Identifier name);

    boolean work_pending();
    void perform_work();
    void run();
    void shutdown(in boolean wait_for_completion);
    void destroy();

    Policy create_policy(in PolicyType type, in any val)
	raises(PolicyError);

    ValueFactory register_value_factory(in RepositoryId id,
					in ValueFactory fact);

    void unregister_value_factory(in RepositoryId id);
    ValueFactory lookup_value_factory(in RepositoryId id);
};

}; // End of module CORBA

#pragma prefix "ooc.com"

module OB
{

local interface Logger;
local interface Reactor;
local interface UnknownExceptionStrategy;

/** The ORBacus property set. */
native PropertySet;

}; // End of module OB

module OBCORBA
{

/**
 *
 * The ORBacus ORB interface. This is an extension of the standard
 * CORBA ORB interface.
 *
 **/
local interface ORB : CORBA::ORB
{
    /** This ORB's property set. */
    readonly attribute OB::PropertySet properties;

    /** This ORB's message logger. */
    readonly attribute OB::Logger logger;

    /** This ORB's reactor. */
    readonly attribute OB::Reactor reactor;

    /**
     *
     * Set the unknown exception strategy for this ORB.
     *
     * @param strategy The new strategy.
     *
     * @return The previous strategy.
     *
     **/
    OB::UnknownExceptionStrategy set_unknown_exception_strategy(
        in OB::UnknownExceptionStrategy strategy);

    /**
     *
     * Create a Connection Reuse policy
     *
     * @param value The Connection Reuse policy value
     *
     * @return A new ConnectionReusePolicy
     *
     **/
    OB::ConnectionReusePolicy create_connection_reuse_policy(
	in boolean value);

    /**
     *
     * Create a Protocol policy
     *
     * @param value The Protocol policy value
     *
     * @return A new ProtocolPolicy
     *
     **/
    OB::ProtocolPolicy create_protocol_policy(in OCI::PluginIdSeq value);

    /**
     *
     * Create a Retry policy
     *
     * @param value The Retry policy value
     *
     * @return A new RetryPolicy
     *
     **/
    OB::RetryPolicy create_retry_policy(in short mode,
    					in unsigned long interval,
					in unsigned long max,
					in boolean remote);

    /**
     *
     * Create a Timeout policy
     *
     * @param value The Timeout policy value
     *
     * @return A new TimeoutPolicy
     *
     **/
    OB::TimeoutPolicy create_timeout_policy(
	in unsigned long value);

    /**
     *
     * Create a Location Transparency policy
     *
     * @param value The Location Transparency policy value
     *
     * @return A new LocationTransparencyPolicy
     *
     **/
     OB::LocationTransparencyPolicy create_location_transparency_policy(
	in short value);

    /**
     *
     * Create a Synchronization Scope policy
     *
     * @param value The Synchronization Scope policy value
     *
     * @return A new SyncScopePolicy
     *
     **/
    Messaging::SyncScopePolicy create_sync_scope_policy(
	in Messaging::SyncScope value);

    /**
     *
     * Create an Interceptor policy
     *
     * @param value The Interceptor policy value
     *
     * @return A new InterceptorPolicy
     *
     **/
     OB::InterceptorPolicy create_interceptor_policy(
	in boolean value);

    /**
     *
     * Create a Connection Timeout policy
     *
     * @param value The Connection Timeout policy value
     *
     * @return A new ConnectTimeoutPolicy
     *
     **/
     OB::ConnectTimeoutPolicy create_connection_timeout_policy(
	in unsigned long value);

    /**
     *
     * Create a Request Timeout policy
     *
     * @param value The Request Timeout policy value
     *
     * @return A new RequestTimeoutPolicy
     *
     **/
     OB::RequestTimeoutPolicy create_request_timeout_policy(
	in unsigned long value);
};

}; // End of module OBCORBA

#endif
