/* Network-Integrated Multimedia Middleware (NMM)
 * http://www.motama.com/nmm.html
 *
 * Copyright (C) 2006-2007
 * Motama GmbH, Saarbruecken, Germany
 * http://www.motama.com
 *
 * This file is part of NMM. 
 * 
 * NMM is free software; you can redistribute it and/or modify it    
 * under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; only version 2 of the License.      
 * 
 * NMM is distributed in the hope that it will be useful, but WITHOUT 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 
 * License for more details.  
 * 
 * You should have received a copy of the GNU General Public License 
 * along with NMM; if not, write to the Free Software Foundation,    
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 */

#include "IRegistry.idl"
#include "ISession.idl"

module NMM {

/** @class IServerRegistry
  * Base class for all Registry Interfaces.
  */
interface IServerRegistry : IRegistry {
    
    /** This method returns the current system time  */
    Time getSystemTime();

    /** This method returns the timout for access control.
     *
     * @return timout for access control
     */
    nmm_uint32 getTransactionTimeout();

    /** This method sets the timout for access control.
     *
     * @param time_out The new timeout for the access control
     */
  void setTransactionTimeout(in nmm_uint32 time_out);

    /** This method returns the leasing time_out for nodes.
     *
     * @return new timeout for the access control
     */
  nmm_uint32 getNodeLeasingTime();

    /** This method sets the leasing time_out for nodes.
     *
     * @param time_out The new timeout for nodes.
     */
  void setNodeLeasingTime(in nmm_uint32 time_out);

    /** This method refreshes the reservation of a leased nodes.
     * 
     * @param reg_id RegistryID of registry node is reserved at
     * @param node_id ObjectID of node
     * @param user_info UserInfo of node
     * @return new reservation time of node
     */
  nmm_uint32 refreshNodeLeasing(in RegistryID reg_id, in ObjectID node_id, in UserInfo user_info);

    /** This method refreshes the enabled access control.
     * 
     * @param user_info UserInfo specifying user which locked registry
     * @return new transaction time if successful, 0 otherwise 
     */
  nmm_uint32 refreshTransaction(in UserInfo user_info);

    /** Requests NMMObject specified by given ObjectDescription.
     *
     * Currently can only return MultiAudioVideoSynchronizer.
     *
     * @param od ObjectDescription specifying NMMObject to request
     */
    Interface* requestNMMObject(in ObjectDescription od);

    /** Release NMMObject specified by given Interface.
     *
     * @param i_face Interface specifying NMMObject 
     */
    void releaseNMMObject(in Interface i_face);

    /** Sets sharing type on nodes and return session for shared graph.
     *
     * @param gd GraphDescription for shared graph
     * @param user_info UserInfo specifying user requesting graph
     */
    ISession* requestSharedGraph(inout GraphDescription gd, in UserInfo user_info)
      raises (RegistryException);

    /** Releases given session.
     *
     * @param session session to release
     * @param user_info UserInfo which tries to release session
     */
    void releaseSession(in ISession session, in UserInfo user_info);

    /** Releases a requested Node.
     *
     * @param node INode interface for Node to be released
     */
    void releaseSharedNode(in INode node);

    /* initialize a new session */
    /** Initializes new session with synchronizer.
     *
     * @param gd GraphDescription of graph to create session for
     * @param u_info UserInfo describing user initializing session
     * @param given_session Interface to master session or NULL, if this is the master session
     * @return ISession interface to created session
     */
    ISession* initSession(inout GraphDescription gd, in UserInfo u_info, in ISession* given_session);
  
    /** Requests nodes contained in given GraphDescription.
     *
     * @param gd GraphDescription with Nodes to request
     * @param user_info UserInfo specifying user requesting graph
     */
    void requestGraph(inout GraphDescription gd, in UserInfo user_info);

    void sendIServerRegistry();
  };


}

