package nsdb;

/** stream-based skeleton class */

public abstract class NucFeatureWriterPOA
	extends org.omg.PortableServer.Servant
	implements org.omg.CORBA.portable.InvokeHandler, nsdb.NucFeatureWriterOperations
{
	static private final java.util.Hashtable m_opsHash = new java.util.Hashtable();
	static
	{
		m_opsHash.put ( "getDatestamp", new java.lang.Integer(0));
		m_opsHash.put ( "getQualifiers", new java.lang.Integer(1));
		m_opsHash.put ( "set", new java.lang.Integer(2));
		m_opsHash.put ( "getNucSeqs", new java.lang.Integer(3));
		m_opsHash.put ( "setLocation", new java.lang.Integer(4));
		m_opsHash.put ( "getFeatureId", new java.lang.Integer(5));
		m_opsHash.put ( "removeQualiferByName", new java.lang.Integer(6));
		m_opsHash.put ( "setKey", new java.lang.Integer(7));
		m_opsHash.put ( "getLocation", new java.lang.Integer(8));
		m_opsHash.put ( "getQualifier", new java.lang.Integer(9));
		m_opsHash.put ( "setQualifiers", new java.lang.Integer(10));
		m_opsHash.put ( "getFeatureVersion", new java.lang.Integer(11));
		m_opsHash.put ( "setQualifier", new java.lang.Integer(12));
		m_opsHash.put ( "getKey", new java.lang.Integer(13));
	}
	private String[] ids = {"IDL:nsdb/NucFeatureWriter:1.0","IDL:nsdb/NucFeature:1.0","IDL:seqdb/Feature:1.0"};
	public nsdb.NucFeatureWriter _this()
	{
		return nsdb.NucFeatureWriterHelper.narrow(_this_object());
	}
	public nsdb.NucFeatureWriter _this(org.omg.CORBA.ORB orb)
	{
		return nsdb.NucFeatureWriterHelper.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: // getDatestamp
			{
				_out = handler.createReply();
				nsdb.DatestampHelper.write(_out,getDatestamp());
				break;
			}
			case 1: // getQualifiers
			{
			try
			{
				_out = handler.createReply();
				nsdb.NucFeaturePackage.QualifierListHelper.write(_out,getQualifiers());
			}
			catch(type.NoResult _ex0)
			{
				_out = handler.createExceptionReply();
				type.NoResultHelper.write(_out, _ex0);
			}
				break;
			}
			case 2: // set
			{
			try
			{
				nsdb.Datestamp _arg0=nsdb.DatestampHelper.read(_input);
				java.lang.String _arg1=_input.read_string();
				java.lang.String _arg2=_input.read_string();
				nsdb.NucFeaturePackage.Qualifier[] _arg3=nsdb.NucFeaturePackage.QualifierListHelper.read(_input);
				_out = handler.createReply();
				set(_arg0,_arg1,_arg2,_arg3);
			}
			catch(nsdb.InvalidKey _ex0)
			{
				_out = handler.createExceptionReply();
				nsdb.InvalidKeyHelper.write(_out, _ex0);
			}
			catch(nsdb.LocationParse _ex1)
			{
				_out = handler.createExceptionReply();
				nsdb.LocationParseHelper.write(_out, _ex1);
			}
			catch(type.IndexOutOfRange _ex2)
			{
				_out = handler.createExceptionReply();
				type.IndexOutOfRangeHelper.write(_out, _ex2);
			}
			catch(type.InvalidRelation _ex3)
			{
				_out = handler.createExceptionReply();
				type.InvalidRelationHelper.write(_out, _ex3);
			}
			catch(nsdb.QualifierParse _ex4)
			{
				_out = handler.createExceptionReply();
				nsdb.QualifierParseHelper.write(_out, _ex4);
			}
			catch(nsdb.InvalidQualifier _ex5)
			{
				_out = handler.createExceptionReply();
				nsdb.InvalidQualifierHelper.write(_out, _ex5);
			}
			catch(nsdb.OutOfDate _ex6)
			{
				_out = handler.createExceptionReply();
				nsdb.OutOfDateHelper.write(_out, _ex6);
			}
			catch(nsdb.ReadOnlyException _ex7)
			{
				_out = handler.createExceptionReply();
				nsdb.ReadOnlyExceptionHelper.write(_out, _ex7);
			}
				break;
			}
			case 3: // getNucSeqs
			{
				_out = handler.createReply();
				type.DbXrefListHelper.write(_out,getNucSeqs());
				break;
			}
			case 4: // setLocation
			{
			try
			{
				nsdb.Datestamp _arg0=nsdb.DatestampHelper.read(_input);
				java.lang.String _arg1=_input.read_string();
				_out = handler.createReply();
				setLocation(_arg0,_arg1);
			}
			catch(nsdb.LocationParse _ex0)
			{
				_out = handler.createExceptionReply();
				nsdb.LocationParseHelper.write(_out, _ex0);
			}
			catch(type.IndexOutOfRange _ex1)
			{
				_out = handler.createExceptionReply();
				type.IndexOutOfRangeHelper.write(_out, _ex1);
			}
			catch(nsdb.OutOfDate _ex2)
			{
				_out = handler.createExceptionReply();
				nsdb.OutOfDateHelper.write(_out, _ex2);
			}
			catch(nsdb.ReadOnlyException _ex3)
			{
				_out = handler.createExceptionReply();
				nsdb.ReadOnlyExceptionHelper.write(_out, _ex3);
			}
				break;
			}
			case 5: // getFeatureId
			{
				_out = handler.createReply();
				_out.write_string(getFeatureId());
				break;
			}
			case 6: // removeQualiferByName
			{
			try
			{
				nsdb.Datestamp _arg0=nsdb.DatestampHelper.read(_input);
				java.lang.String _arg1=_input.read_string();
				_out = handler.createReply();
				removeQualiferByName(_arg0,_arg1);
			}
			catch(type.InvalidRelation _ex0)
			{
				_out = handler.createExceptionReply();
				type.InvalidRelationHelper.write(_out, _ex0);
			}
			catch(nsdb.OutOfDate _ex1)
			{
				_out = handler.createExceptionReply();
				nsdb.OutOfDateHelper.write(_out, _ex1);
			}
			catch(nsdb.ReadOnlyException _ex2)
			{
				_out = handler.createExceptionReply();
				nsdb.ReadOnlyExceptionHelper.write(_out, _ex2);
			}
				break;
			}
			case 7: // setKey
			{
			try
			{
				nsdb.Datestamp _arg0=nsdb.DatestampHelper.read(_input);
				java.lang.String _arg1=_input.read_string();
				_out = handler.createReply();
				setKey(_arg0,_arg1);
			}
			catch(nsdb.InvalidKey _ex0)
			{
				_out = handler.createExceptionReply();
				nsdb.InvalidKeyHelper.write(_out, _ex0);
			}
			catch(type.InvalidRelation _ex1)
			{
				_out = handler.createExceptionReply();
				type.InvalidRelationHelper.write(_out, _ex1);
			}
			catch(nsdb.OutOfDate _ex2)
			{
				_out = handler.createExceptionReply();
				nsdb.OutOfDateHelper.write(_out, _ex2);
			}
			catch(nsdb.ReadOnlyException _ex3)
			{
				_out = handler.createExceptionReply();
				nsdb.ReadOnlyExceptionHelper.write(_out, _ex3);
			}
				break;
			}
			case 8: // getLocation
			{
			try
			{
				_out = handler.createReply();
				nsdb.FeatureLocationHelper.write(_out,getLocation());
			}
			catch(type.NoResult _ex0)
			{
				_out = handler.createExceptionReply();
				type.NoResultHelper.write(_out, _ex0);
			}
				break;
			}
			case 9: // getQualifier
			{
			try
			{
				java.lang.String _arg0=_input.read_string();
				_out = handler.createReply();
				nsdb.NucFeaturePackage.QualifierHelper.write(_out,getQualifier(_arg0));
			}
			catch(type.NoResult _ex0)
			{
				_out = handler.createExceptionReply();
				type.NoResultHelper.write(_out, _ex0);
			}
			catch(type.InvalidRelation _ex1)
			{
				_out = handler.createExceptionReply();
				type.InvalidRelationHelper.write(_out, _ex1);
			}
				break;
			}
			case 10: // setQualifiers
			{
			try
			{
				nsdb.Datestamp _arg0=nsdb.DatestampHelper.read(_input);
				nsdb.NucFeaturePackage.Qualifier[] _arg1=nsdb.NucFeaturePackage.QualifierListHelper.read(_input);
				_out = handler.createReply();
				setQualifiers(_arg0,_arg1);
			}
			catch(type.InvalidRelation _ex0)
			{
				_out = handler.createExceptionReply();
				type.InvalidRelationHelper.write(_out, _ex0);
			}
			catch(nsdb.QualifierParse _ex1)
			{
				_out = handler.createExceptionReply();
				nsdb.QualifierParseHelper.write(_out, _ex1);
			}
			catch(nsdb.InvalidQualifier _ex2)
			{
				_out = handler.createExceptionReply();
				nsdb.InvalidQualifierHelper.write(_out, _ex2);
			}
			catch(nsdb.OutOfDate _ex3)
			{
				_out = handler.createExceptionReply();
				nsdb.OutOfDateHelper.write(_out, _ex3);
			}
			catch(nsdb.ReadOnlyException _ex4)
			{
				_out = handler.createExceptionReply();
				nsdb.ReadOnlyExceptionHelper.write(_out, _ex4);
			}
				break;
			}
			case 11: // getFeatureVersion
			{
				_out = handler.createReply();
				_out.write_long(getFeatureVersion());
				break;
			}
			case 12: // setQualifier
			{
			try
			{
				nsdb.Datestamp _arg0=nsdb.DatestampHelper.read(_input);
				nsdb.NucFeaturePackage.Qualifier _arg1=nsdb.NucFeaturePackage.QualifierHelper.read(_input);
				_out = handler.createReply();
				setQualifier(_arg0,_arg1);
			}
			catch(type.InvalidRelation _ex0)
			{
				_out = handler.createExceptionReply();
				type.InvalidRelationHelper.write(_out, _ex0);
			}
			catch(nsdb.QualifierParse _ex1)
			{
				_out = handler.createExceptionReply();
				nsdb.QualifierParseHelper.write(_out, _ex1);
			}
			catch(nsdb.InvalidQualifier _ex2)
			{
				_out = handler.createExceptionReply();
				nsdb.InvalidQualifierHelper.write(_out, _ex2);
			}
			catch(nsdb.OutOfDate _ex3)
			{
				_out = handler.createExceptionReply();
				nsdb.OutOfDateHelper.write(_out, _ex3);
			}
			catch(nsdb.ReadOnlyException _ex4)
			{
				_out = handler.createExceptionReply();
				nsdb.ReadOnlyExceptionHelper.write(_out, _ex4);
			}
				break;
			}
			case 13: // getKey
			{
				_out = handler.createReply();
				_out.write_string(getKey());
				break;
			}
		}
		return _out;
	}

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