// **********************************************************************
//
// Copyright (c) 1999
// Object Oriented Concepts, Inc.
// Billerica, MA, USA
//
// All Rights Reserved
//
// **********************************************************************

#ifndef OOC_POLICIES_IDL
#define OOC_POLICIES_IDL

#include <Policy.idl>
#include <IOP.idl>

#pragma prefix "ooc.com"

module SSL
{

/**
 *
 * This enumeration is used to specify whether connection attempts
 * should be secure or insecure.
 *
 **/
enum ConnectPolicyType
{
    ConnectSecure,
    ConnectInsecure
};

/**
 *
 * This policy type identifies the connection policy.
 *
 **/
const CORBA::PolicyType CONNECT_POLICY = 1;

/**
 *
 * The connection policy. This policy is used to specify whether
 * secure or insecure connections are used.
 *
 **/
interface ConnectPolicy : CORBA::Policy
{
    /**
     *
     * If an object has a <code>ConnectPolicy</code> set with
     * <code>value</code> set to <code>ConnectSecure</code>, then only
     * secure connections will be used for that object.
     *
     **/
    readonly attribute ConnectPolicyType value;
}; 

}; // End module SSL

module OB
{

/**
 *
 * This policy type identifies the protocol policy.
 *
 **/
const CORBA::PolicyType PROTOCOL_POLICY = 2;

/**
 *
 * The protocol policy. This policy is used to force the selection of
 * a specific protocol.
 *
 **/
interface ProtocolPolicy : CORBA::Policy
{
    /**
     *
     * If a <code>ProtocolPolicy</code> is set, then the protocol with
     * the identified tag will be used, if possible. If it is not
     * possible to use this protocol, a
     * <code>CORBA::NO_RESOURCES</code> exception will be raised.
     *
     **/
    readonly attribute IOP::ProfileId value;
};

/**
 *
 * This policy type identifies the connection reuse policy.
 *
 **/
const CORBA::PolicyType CONNECTION_REUSE_POLICY = 3;

/**
 *
 * The connection reuse policy. This policy determines whether
 * connections may be reused or are private to specific objects.
 *
 **/
interface ConnectionReusePolicy : CORBA::Policy
{
    /**
     *
     * If an object has a <code>ConnectionReusePolicy</code> set with
     * <code>value</code> set to <code>FALSE</code>, then other
     * objects will not be permitted to also use any connection made
     * on behalf of this object.
     *
     **/
    readonly attribute boolean value;
};

/**
 *
 * This policy type identifies the reconnect policy.
 *
 **/
const CORBA::PolicyType RECONNECT_POLICY = 4;

/**
 *
 * The reconnect policy. This policy determines if an object will
 * automatically try to reconnect to a server upon a communication
 * failure.
 *
 **/
interface ReconnectPolicy : CORBA::Policy
{
    /**
     *
     * If an object has a <code>ReconnectPolicy</code> set with
     * <code>value</code> set to <code>TRUE</code>, then upon a
     * <code>CORBA::COMM_FAILURE</code> a reconnection will
     * automatically be attempted.
     *
     **/
    readonly attribute boolean value;
};

/**
 *
 * This policy type identifies the timeout policy.
 *
 **/
const CORBA::PolicyType TIMEOUT_POLICY = 5;

/**
 *
 * The timeout policy. This policy can be used to specify
 * communication timeouts.
 *
 **/
interface TimeoutPolicy : CORBA::Policy
{
    /**
     *
     * If an object has a <code>TimeoutPolicy</code> set and no
     * response to a request is available after <code>value</code>
     * milliseconds, a <code>CORBA::NO_RESOURCE</code> exception is
     * raised.
     *
     **/
    readonly attribute unsigned long value;
};

}; // End module OB

#endif
