//#
//#  COMPONENT_NAME: somi
//#
//#  ORIGINS: 27
//#
//#
//#    25H7912  (C)   COPYRIGHT International Business Machines Corp. 1992,1996,1996,1996  
//#  All Rights Reserved
//#  Licensed Materials - Property of IBM
//#  US Government Users Restricted Rights - Use, duplication or
//#  disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//#
//#  @(#) 2.13.2.8 src/somi/ir/somir/repostry.idl, somi.corba, som3.0 3/28/96 11:57:13 [12/22/96 21:12:37]


//#  Repository: CORBA Interface for access to repository objects
//#  See CORBA 1.1, 7.5.2, pp.132-133
//#
//#                        DEFECT HISTORY
//#                        --------------
//#  20692  03/28/96   Partha      Specify SOMClass as explicit parent for M_Repository interface
//#

#ifndef repostry_idl
#define repostry_idl

#include <containr.idl>
#include <somcls.idl>

#define RepositoryId string
#define InterfaceName string

interface Repository : Container
// The Repository interface provides global access to the SOM
// CORBA-compliant Interface Repository (IR).  To obtain an object
// reference to an instance of Repository, use the RepositoryNew
// function.
//
// See CORBA 1.1, 7.5.2, p.133
{
    struct RepositoryDescription {
	Identifier   name;
	RepositoryId id;
	RepositoryId defined_in;
    };
    // The inherited describe_contents method returns an instance
    // of this (RepositoryDescription) structure in the value
    // member of the Description structure defined in the Container
    // interface.

    enum irOpenErrorCodes {
	NOACCESS, BADMAGICNUMBER, MISSINGVERSIONINFO,
	IOERROR, VERSIONMISMATCH, NOWRITEACCESS,
	INDEXINCONSISTENT, INDEXNOTPRESENT	       /* @dcr13033 */
    };

    exception irOpenError {
	irOpenErrorCodes errorCode;
	string fileName;
    };
    // The irOpenError and associated irOpenErrorCodes are a
    // SOM-unique extension to the Interface Repository.  These
    // errors may be raised by the somNew when instantiating the
    // Repository object and can be found in the SOM global
    // Environment if the returned Repository object is NULL (meaning
    // no Repository object could be created). When the Repository
    // object is not NULL, use the queryException method to place any
    // exception info into a user-supplied Environment
    // (see queryException below).

    Contained lookup_id(in RepositoryId search_id);
    // Returns the object with a RepositoryId given by search_id.

    string lookup_modifier(in RepositoryId name, in string modifier);
    // [SOM-unique extension]
    //
    // Returns the value string associated with the given SOM modifier
    // for the object whose id is specified.  If the object does not
    // exist or does not possess the modifier, NULL (or zero) is returned.
    // If the modifier exists but does not have a value, a zero-length
    // value string is returned.
    //
    // You must free the returned string when finished with it (using
    // SOMFree).

    void release_cache();
    // [SOM-unique extension]
    //
    // This method releases all currently unreferenced Interface Repository
    // objects from the internal object cache.	This may release some storage
    // at the cost of slowing down (slightly) the next few lookup operations.
    // The internal cache will replenish itself (over time) with each
    // subsequent lookup operation.

    boolean queryException();
    // [SOM-unique extension]
    //
    // This method returns TRUE if an exception condition was
    // raised during the creation of the Repository object, otherwise
    // it returns FALSE.  When the result is TRUE, the actual
    // exception info may be found in the Environment passed in to
    // the queryException operation.

#ifdef __SOMIDL__
  implementation {
      releaseorder: lookup_id, lookup_modifier, release_cache
		  , reserved1, reserved2, reserved3
		  , queryException
		    ;

      //# Class Modifiers
      callstyle = idl;
      majorversion = 2;
      minorversion = 3;
      filestem = repostry;
      dllname = "somir.dll";

      passthru C_h =
	""
	"    #include <stdio.h>"
	"    #include <somtcnst.h>"
	"    #include <somir.h>"
	"    #include <containd.h>"
	"";
      passthru C_xh =
	""
	"    #include <stdio.h>"
	"    #include <somtcnst.xh>"
	"    #include <somir.xh>"
	"    #include <containd.xh>"
	"";

      //# Method Modifiers
      describe_contents: override;
      somFree: override;
      somDumpSelf: override;
      somDumpSelfInt: override;
      somDefaultCopyInit: override, init;
#if defined __SOM_KERNEL_LEVEL && __SOM_KERNEL_LEVEL == 210
      lookup_id: caller_owns_result, caller_owns_parameters="search_id";
      lookup_modifier: caller_owns_result, caller_owns_parameters="modifier";
#endif

  };
#endif /* __SOMIDL__ */
};


#endif	/* repostry_idl */
