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

#ifndef OB_POA_MANAGER_IDL
#define OB_POA_MANAGER_IDL

#include <OB/POAManager.idl>

#include <OB/OCI.idl>

#pragma prefix "ooc.com"

module OBPortableServer
{

/**
 *
 * This interface is a proprietary extension to the standard POAManager.
 *
 * @see PortableServer::POAManager
 *
 **/
local interface POAManager : PortableServer::POAManager
{
    /** The POAManager name. */
    readonly attribute string name;

    /**
     *
     * Retrieve the acceptors associated with this POAManager.
     *
     * @return The acceptors.
     *
     **/
    OCI::AcceptorSeq get_acceptors()
        raises(AdapterInactive);
};

/** A sequence of POAManagers */
typedef sequence< POAManager > POAManagerSeq;

/**
 *
 * A Factory for OBPortableServer::POAManager.
 *
 * @see OBPortableServer::POAManager
 *
 **/
local interface POAManagerFactory
{
    /**
     *
     * Acceptor configuration information.
     *
     * @member id The plugin id.
     *
     * @member params The configuration parameters.
     *
     **/
    struct AcceptorConfig
    {
        OCI::PluginId id;
        OCI::ParamSeq params;
    };

    /** Alias for a sequence of acceptor configuration information. */
    typedef sequence< AcceptorConfig > AcceptorConfigSeq;

    /** A POAManager already exists with the same name. */
    exception POAManagerAlreadyExists
    {
    };

    /**
     *
     * Create a new POA manager. The configuration properties for this
     * POA manager will be held in "ooc.orb.poamanager.<name>." If the
     * name is the empty string then a POA manager with a unique name
     * will be created. The POAManager will be created with a single
     * IIOP Acceptor.
     *
     * @param name The POAManager name.
     *
     * @return A POAManager.
     *
     * @exception POAManagerAlreadyExists If a POAManager with the same
     * name already exists.
     *
     * @exception OCI::InvalidParam If a configuration parameter was
     * invalid.
     *
     **/
    POAManager create_poa_manager(in string name)
        raises(POAManagerAlreadyExists,
               OCI::InvalidParam);

    /**
     *
     * Create a new POA manager. The configuration properties for this
     * POA manager will be held in "ooc.orb.poamanager.<name>." If the
     * name is the empty string then a POA manager with a unique name
     * will be created.
     *
     * @param name The POAManager name.
     *
     * @param config The acceptor configuration parameters. One acceptor
     * will be created for each element of the sequence.
     *
     * @return The POAManager.
     *
     * @exception POAManagerAlreadyExists If a POAManager with the same
     * name already exists.
     *
     * @exception OCI::NoSuchFactory If no Acceptor factory could be
     * found for a protocol id.
     *
     * @exception OCI::InvalidParam If a configuration parameter was
     * invalid.
     *
     **/
    POAManager create_poa_manager_with_config(in string name,
                                              in AcceptorConfigSeq config)
        raises(POAManagerAlreadyExists,
               OCI::NoSuchFactory,
               OCI::InvalidParam);

    /**
     *
     * Get all POA managers.
     *
     * @return A sequence of POAManagers.
     *
     **/
    POAManagerSeq get_poa_managers();

    /**
     *
     * Destroy all POAManagers.
     *
     **/
    void destroy();
};

}; // End module OBPortableServer

#endif
