package org.dbxml.core.corba.db;

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

public class _CollectionManagerStub
	extends org.omg.CORBA.portable.ObjectImpl
	implements org.dbxml.core.corba.db.CollectionManager
{
	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 String[] _ids()
	{
		return ids;
	}

	public final static java.lang.Class _opsClass = org.dbxml.core.corba.db.CollectionManagerOperations.class;
	public void createXMLObject(org.dbxml.core.corba.db.EncodedBuffer config) throws org.dbxml.core.corba.db.APIException
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "createXMLObject", true);
				org.dbxml.core.corba.db.EncodedBufferHelper.write(_os,config);
				_is = _invoke(_os);
				return;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:org/dbxml/core/corba/db/APIException:1.0"))
				{
					throw org.dbxml.core.corba.db.APIExceptionHelper.read(_ax.getInputStream());
				}
				else 
					throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "createXMLObject", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			CollectionManagerOperations _localServant = (CollectionManagerOperations)_so.servant;
			try
			{
			_localServant.createXMLObject(config);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return;
		}

		}

	}

	public void dropIndexer(java.lang.String nam) throws org.dbxml.core.corba.db.APIException
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "dropIndexer", true);
				org.dbxml.core.corba.db.NameHelper.write(_os,nam);
				_is = _invoke(_os);
				return;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:org/dbxml/core/corba/db/APIException:1.0"))
				{
					throw org.dbxml.core.corba.db.APIExceptionHelper.read(_ax.getInputStream());
				}
				else 
					throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "dropIndexer", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			CollectionManagerOperations _localServant = (CollectionManagerOperations)_so.servant;
			try
			{
			_localServant.dropIndexer(nam);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return;
		}

		}

	}

	public void createIndexer(org.dbxml.core.corba.db.EncodedBuffer config) throws org.dbxml.core.corba.db.APIException
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "createIndexer", true);
				org.dbxml.core.corba.db.EncodedBufferHelper.write(_os,config);
				_is = _invoke(_os);
				return;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:org/dbxml/core/corba/db/APIException:1.0"))
				{
					throw org.dbxml.core.corba.db.APIExceptionHelper.read(_ax.getInputStream());
				}
				else 
					throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "createIndexer", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			CollectionManagerOperations _localServant = (CollectionManagerOperations)_so.servant;
			try
			{
			_localServant.createIndexer(config);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return;
		}

		}

	}

	public org.dbxml.core.corba.db.Collection createCollection(java.lang.String path, org.dbxml.core.corba.db.EncodedBuffer config) throws org.dbxml.core.corba.db.APIException
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "createCollection", true);
				org.dbxml.core.corba.db.NameHelper.write(_os,path);
				org.dbxml.core.corba.db.EncodedBufferHelper.write(_os,config);
				_is = _invoke(_os);
				org.dbxml.core.corba.db.Collection _result = org.dbxml.core.corba.db.CollectionHelper.read(_is);
				return _result;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:org/dbxml/core/corba/db/APIException:1.0"))
				{
					throw org.dbxml.core.corba.db.APIExceptionHelper.read(_ax.getInputStream());
				}
				else 
					throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "createCollection", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			CollectionManagerOperations _localServant = (CollectionManagerOperations)_so.servant;
			org.dbxml.core.corba.db.Collection _result;			try
			{
			_result = _localServant.createCollection(path,config);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

	public void dropCollection(java.lang.String path) throws org.dbxml.core.corba.db.APIException
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "dropCollection", true);
				org.dbxml.core.corba.db.NameHelper.write(_os,path);
				_is = _invoke(_os);
				return;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:org/dbxml/core/corba/db/APIException:1.0"))
				{
					throw org.dbxml.core.corba.db.APIExceptionHelper.read(_ax.getInputStream());
				}
				else 
					throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "dropCollection", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			CollectionManagerOperations _localServant = (CollectionManagerOperations)_so.servant;
			try
			{
			_localServant.dropCollection(path);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return;
		}

		}

	}

	public void remove()
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "remove", true);
				_is = _invoke(_os);
				return;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "remove", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			CollectionManagerOperations _localServant = (CollectionManagerOperations)_so.servant;
			try
			{
			_localServant.remove();
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return;
		}

		}

	}

	public java.lang.String getName() throws org.dbxml.core.corba.db.APIException
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "getName", true);
				_is = _invoke(_os);
				java.lang.String _result = _is.read_string();
				return _result;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:org/dbxml/core/corba/db/APIException:1.0"))
				{
					throw org.dbxml.core.corba.db.APIExceptionHelper.read(_ax.getInputStream());
				}
				else 
					throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "getName", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			CollectionManagerOperations _localServant = (CollectionManagerOperations)_so.servant;
			java.lang.String _result;			try
			{
			_result = _localServant.getName();
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

	public java.lang.String getCanonicalName() throws org.dbxml.core.corba.db.APIException
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "getCanonicalName", true);
				_is = _invoke(_os);
				java.lang.String _result = _is.read_string();
				return _result;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:org/dbxml/core/corba/db/APIException:1.0"))
				{
					throw org.dbxml.core.corba.db.APIExceptionHelper.read(_ax.getInputStream());
				}
				else 
					throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "getCanonicalName", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			CollectionManagerOperations _localServant = (CollectionManagerOperations)_so.servant;
			java.lang.String _result;			try
			{
			_result = _localServant.getCanonicalName();
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

	public java.lang.String[] listXMLObjects() throws org.dbxml.core.corba.db.APIException
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "listXMLObjects", true);
				_is = _invoke(_os);
				java.lang.String[] _result = org.dbxml.core.corba.db.NamesHelper.read(_is);
				return _result;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:org/dbxml/core/corba/db/APIException:1.0"))
				{
					throw org.dbxml.core.corba.db.APIExceptionHelper.read(_ax.getInputStream());
				}
				else 
					throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "listXMLObjects", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			CollectionManagerOperations _localServant = (CollectionManagerOperations)_so.servant;
			java.lang.String[] _result;			try
			{
			_result = _localServant.listXMLObjects();
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

	public void dropXMLObject(java.lang.String nam) throws org.dbxml.core.corba.db.APIException
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "dropXMLObject", true);
				org.dbxml.core.corba.db.NameHelper.write(_os,nam);
				_is = _invoke(_os);
				return;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:org/dbxml/core/corba/db/APIException:1.0"))
				{
					throw org.dbxml.core.corba.db.APIExceptionHelper.read(_ax.getInputStream());
				}
				else 
					throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "dropXMLObject", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			CollectionManagerOperations _localServant = (CollectionManagerOperations)_so.servant;
			try
			{
			_localServant.dropXMLObject(nam);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return;
		}

		}

	}

	public java.lang.String[] listIndexers() throws org.dbxml.core.corba.db.APIException
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "listIndexers", true);
				_is = _invoke(_os);
				java.lang.String[] _result = org.dbxml.core.corba.db.NamesHelper.read(_is);
				return _result;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:org/dbxml/core/corba/db/APIException:1.0"))
				{
					throw org.dbxml.core.corba.db.APIExceptionHelper.read(_ax.getInputStream());
				}
				else 
					throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "listIndexers", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			CollectionManagerOperations _localServant = (CollectionManagerOperations)_so.servant;
			java.lang.String[] _result;			try
			{
			_result = _localServant.listIndexers();
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

}
