/*
* Copyright (C) The Community OpenORB Project. All rights reserved.
*
* This software is published under the terms of The OpenORB Community Software
* License version 1.0, a copy of which has been included with this distribution
* in the LICENSE.txt file.
*/

#ifndef _OPENORB_NAMING_IDL_
#define _OPENORB_NAMING_IDL_

#include <CosNaming.idl>

/**
 * This IDL describes interfaces to plug a callback API to the OpenORB Name Server.
 */

module callback
{
    typePrefix callback "ins.openorb.org";

    /**
     * Enumerate all the name service event type
     */
    enum EventType
    {
        ADD, UPDATE, REMOVE
    };

    /**
     * This interface must be implemented by the NS listener which would like to receive NS events.
     */
    interface Callback
    {
        /**
         * This operation is invoked when an event is sent for an object
         */
        oneway void object_event( in CosNaming::Name name, in EventType event, in Object obj );

        /**
         * This operation is invoked when an event is sent for a naming context
         */
        oneway void naming_context_event( in CosNaming::Name name, in EventType event );				
    };

    /**
     * This interface is used to add and to remove NS Callback objects.
     */
    interface CallbackManager
    {
        void add_callback( in Callback _callback );
        void remove_callback( in Callback _callback );
    };
};

#endif // _OPENORB_NAMING_IDL_
