package org.dbxml.core.corba.db;

/**
 *	Generated from IDL definition of interface "CollectionManager"
 *	@author JacORB IDL compiler 
 */

public abstract class CollectionManagerPOA
	extends org.omg.PortableServer.Servant
	implements org.omg.CORBA.portable.InvokeHandler, org.dbxml.core.corba.db.CollectionManagerOperations
{
	static private final java.util.Hashtable m_opsHash = new java.util.Hashtable();
	static
	{
		m_opsHash.put ( "createXMLObject", new java.lang.Integer(0));
		m_opsHash.put ( "dropIndexer", new java.lang.Integer(1));
		m_opsHash.put ( "createIndexer", new java.lang.Integer(2));
		m_opsHash.put ( "createCollection", new java.lang.Integer(3));
		m_opsHash.put ( "dropCollection", new java.lang.Integer(4));
		m_opsHash.put ( "remove", new java.lang.Integer(5));
		m_opsHash.put ( "getName", new java.lang.Integer(6));
		m_opsHash.put ( "getCanonicalName", new java.lang.Integer(7));
		m_opsHash.put ( "listXMLObjects", new java.lang.Integer(8));
		m_opsHash.put ( "dropXMLObject", new java.lang.Integer(9));
		m_opsHash.put ( "listIndexers", new java.lang.Integer(10));
	}
	private String[] ids = {"IDL:org/dbxml/core/corba/db/CollectionManager:1.0","IDL:org/dbxml/core/corba/db/ServantManagement:1.0","IDL:omg.org/CORBA/Object:1.0"};
	public org.dbxml.core.corba.db.CollectionManager _this()
	{
		return org.dbxml.core.corba.db.CollectionManagerHelper.narrow(_this_object());
	}
	public org.dbxml.core.corba.db.CollectionManager _this(org.omg.CORBA.ORB orb)
	{
		return org.dbxml.core.corba.db.CollectionManagerHelper.narrow(_this_object(orb));
	}
	public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler)
		throws org.omg.CORBA.SystemException
	{
		org.omg.CORBA.portable.OutputStream _out = null;
		// do something
		// quick lookup of operation
		java.lang.Integer opsIndex = (java.lang.Integer)m_opsHash.get ( method );
		if ( null == opsIndex )
			throw new org.omg.CORBA.BAD_OPERATION(method + " not found");
		switch ( opsIndex.intValue() )
		{
			case 0: // createXMLObject
			{
			try
			{
				org.dbxml.core.corba.db.EncodedBuffer _arg0=org.dbxml.core.corba.db.EncodedBufferHelper.read(_input);
				_out = handler.createReply();
				createXMLObject(_arg0);
			}
			catch(org.dbxml.core.corba.db.APIException _ex0)
			{
				_out = handler.createExceptionReply();
				org.dbxml.core.corba.db.APIExceptionHelper.write(_out, _ex0);
			}
				break;
			}
			case 1: // dropIndexer
			{
			try
			{
				java.lang.String _arg0=org.dbxml.core.corba.db.NameHelper.read(_input);
				_out = handler.createReply();
				dropIndexer(_arg0);
			}
			catch(org.dbxml.core.corba.db.APIException _ex0)
			{
				_out = handler.createExceptionReply();
				org.dbxml.core.corba.db.APIExceptionHelper.write(_out, _ex0);
			}
				break;
			}
			case 2: // createIndexer
			{
			try
			{
				org.dbxml.core.corba.db.EncodedBuffer _arg0=org.dbxml.core.corba.db.EncodedBufferHelper.read(_input);
				_out = handler.createReply();
				createIndexer(_arg0);
			}
			catch(org.dbxml.core.corba.db.APIException _ex0)
			{
				_out = handler.createExceptionReply();
				org.dbxml.core.corba.db.APIExceptionHelper.write(_out, _ex0);
			}
				break;
			}
			case 3: // createCollection
			{
			try
			{
				java.lang.String _arg0=org.dbxml.core.corba.db.NameHelper.read(_input);
				org.dbxml.core.corba.db.EncodedBuffer _arg1=org.dbxml.core.corba.db.EncodedBufferHelper.read(_input);
				_out = handler.createReply();
				org.dbxml.core.corba.db.CollectionHelper.write(_out,createCollection(_arg0,_arg1));
			}
			catch(org.dbxml.core.corba.db.APIException _ex0)
			{
				_out = handler.createExceptionReply();
				org.dbxml.core.corba.db.APIExceptionHelper.write(_out, _ex0);
			}
				break;
			}
			case 4: // dropCollection
			{
			try
			{
				java.lang.String _arg0=org.dbxml.core.corba.db.NameHelper.read(_input);
				_out = handler.createReply();
				dropCollection(_arg0);
			}
			catch(org.dbxml.core.corba.db.APIException _ex0)
			{
				_out = handler.createExceptionReply();
				org.dbxml.core.corba.db.APIExceptionHelper.write(_out, _ex0);
			}
				break;
			}
			case 5: // remove
			{
				_out = handler.createReply();
				remove();
				break;
			}
			case 6: // getName
			{
			try
			{
				_out = handler.createReply();
				_out.write_string(getName());
			}
			catch(org.dbxml.core.corba.db.APIException _ex0)
			{
				_out = handler.createExceptionReply();
				org.dbxml.core.corba.db.APIExceptionHelper.write(_out, _ex0);
			}
				break;
			}
			case 7: // getCanonicalName
			{
			try
			{
				_out = handler.createReply();
				_out.write_string(getCanonicalName());
			}
			catch(org.dbxml.core.corba.db.APIException _ex0)
			{
				_out = handler.createExceptionReply();
				org.dbxml.core.corba.db.APIExceptionHelper.write(_out, _ex0);
			}
				break;
			}
			case 8: // listXMLObjects
			{
			try
			{
				_out = handler.createReply();
				org.dbxml.core.corba.db.NamesHelper.write(_out,listXMLObjects());
			}
			catch(org.dbxml.core.corba.db.APIException _ex0)
			{
				_out = handler.createExceptionReply();
				org.dbxml.core.corba.db.APIExceptionHelper.write(_out, _ex0);
			}
				break;
			}
			case 9: // dropXMLObject
			{
			try
			{
				java.lang.String _arg0=org.dbxml.core.corba.db.NameHelper.read(_input);
				_out = handler.createReply();
				dropXMLObject(_arg0);
			}
			catch(org.dbxml.core.corba.db.APIException _ex0)
			{
				_out = handler.createExceptionReply();
				org.dbxml.core.corba.db.APIExceptionHelper.write(_out, _ex0);
			}
				break;
			}
			case 10: // listIndexers
			{
			try
			{
				_out = handler.createReply();
				org.dbxml.core.corba.db.NamesHelper.write(_out,listIndexers());
			}
			catch(org.dbxml.core.corba.db.APIException _ex0)
			{
				_out = handler.createExceptionReply();
				org.dbxml.core.corba.db.APIExceptionHelper.write(_out, _ex0);
			}
				break;
			}
		}
		return _out;
	}

	public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] obj_id)
	{
		return ids;
	}
}
