package com.interpress_project.modernshare.orb.generated;


/**
 * Generated from IDL interface "MdsService".
 *
 * @author JacORB IDL compiler V 2.3.0, 17-Feb-2007
 * @version generated at 2007/03/21 14:13:25
 */

@SuppressWarnings("unchecked")
public abstract class MdsServicePOA
	extends org.omg.PortableServer.Servant
	implements org.omg.CORBA.portable.InvokeHandler, com.interpress_project.modernshare.orb.generated.MdsServiceOperations
{
	static private final java.util.Hashtable m_opsHash = new java.util.Hashtable();
	static
	{
		m_opsHash.put ( "addUser", new java.lang.Integer(0));
		m_opsHash.put ( "getClientInfo", new java.lang.Integer(1));
		m_opsHash.put ( "recovery", new java.lang.Integer(2));
		m_opsHash.put ( "setClientInfo", new java.lang.Integer(3));
		m_opsHash.put ( "getServerInfo", new java.lang.Integer(4));
		m_opsHash.put ( "changePassword", new java.lang.Integer(5));
		m_opsHash.put ( "deleteUser", new java.lang.Integer(6));
		m_opsHash.put ( "backup", new java.lang.Integer(7));
	}
	private String[] ids = {"IDL:com/interpress_project/modernshare/orb/generated/MdsService:1.0"};
	public com.interpress_project.modernshare.orb.generated.MdsService _this()
	{
		return com.interpress_project.modernshare.orb.generated.MdsServiceHelper.narrow(_this_object());
	}
	public com.interpress_project.modernshare.orb.generated.MdsService _this(org.omg.CORBA.ORB orb)
	{
		return com.interpress_project.modernshare.orb.generated.MdsServiceHelper.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: // addUser
			{
			try
			{
				java.lang.String _arg0=_input.read_wstring();
				java.lang.String _arg1=_input.read_wstring();
				_out = handler.createReply();
				addUser(_arg0,_arg1);
			}
			catch(com.interpress_project.modernshare.orb.generated.InternalError _ex0)
			{
				_out = handler.createExceptionReply();
				com.interpress_project.modernshare.orb.generated.InternalErrorHelper.write(_out, _ex0);
			}
			catch(com.interpress_project.modernshare.orb.generated.NoPrivilege _ex1)
			{
				_out = handler.createExceptionReply();
				com.interpress_project.modernshare.orb.generated.NoPrivilegeHelper.write(_out, _ex1);
			}
			catch(com.interpress_project.modernshare.orb.generated.AccountExist _ex2)
			{
				_out = handler.createExceptionReply();
				com.interpress_project.modernshare.orb.generated.AccountExistHelper.write(_out, _ex2);
			}
			catch(com.interpress_project.modernshare.orb.generated.LicenseError _ex3)
			{
				_out = handler.createExceptionReply();
				com.interpress_project.modernshare.orb.generated.LicenseErrorHelper.write(_out, _ex3);
			}
				break;
			}
			case 1: // getClientInfo
			{
				java.lang.String _arg0=_input.read_wstring();
				java.lang.String _arg1=_input.read_wstring();
				_out = handler.createReply();
				((org.omg.CORBA_2_3.portable.OutputStream)_out).write_value (getClientInfo(_arg0,_arg1));
				break;
			}
			case 2: // recovery
			{
			try
			{
				_out = handler.createReply();
				recovery();
			}
			catch(com.interpress_project.modernshare.orb.generated.InternalError _ex0)
			{
				_out = handler.createExceptionReply();
				com.interpress_project.modernshare.orb.generated.InternalErrorHelper.write(_out, _ex0);
			}
			catch(com.interpress_project.modernshare.orb.generated.NoPrivilege _ex1)
			{
				_out = handler.createExceptionReply();
				com.interpress_project.modernshare.orb.generated.NoPrivilegeHelper.write(_out, _ex1);
			}
				break;
			}
			case 3: // setClientInfo
			{
				com.interpress_project.modernshare.orb.generated.MdsClientInfo _arg0=(com.interpress_project.modernshare.orb.generated.MdsClientInfo)((org.omg.CORBA_2_3.portable.InputStream)_input).read_value ("IDL:com/interpress_project/modernshare/orb/generated/MdsClientInfo:1.0");
				_out = handler.createReply();
				setClientInfo(_arg0);
				break;
			}
			case 4: // getServerInfo
			{
				_out = handler.createReply();
				((org.omg.CORBA_2_3.portable.OutputStream)_out).write_value (getServerInfo());
				break;
			}
			case 5: // changePassword
			{
			try
			{
				java.lang.String _arg0=_input.read_wstring();
				java.lang.String _arg1=_input.read_wstring();
				_out = handler.createReply();
				changePassword(_arg0,_arg1);
			}
			catch(com.interpress_project.modernshare.orb.generated.AccountNotFound _ex0)
			{
				_out = handler.createExceptionReply();
				com.interpress_project.modernshare.orb.generated.AccountNotFoundHelper.write(_out, _ex0);
			}
				break;
			}
			case 6: // deleteUser
			{
			try
			{
				java.lang.String _arg0=_input.read_wstring();
				_out = handler.createReply();
				deleteUser(_arg0);
			}
			catch(com.interpress_project.modernshare.orb.generated.InternalError _ex0)
			{
				_out = handler.createExceptionReply();
				com.interpress_project.modernshare.orb.generated.InternalErrorHelper.write(_out, _ex0);
			}
			catch(com.interpress_project.modernshare.orb.generated.AccountNotFound _ex1)
			{
				_out = handler.createExceptionReply();
				com.interpress_project.modernshare.orb.generated.AccountNotFoundHelper.write(_out, _ex1);
			}
			catch(com.interpress_project.modernshare.orb.generated.NoPrivilege _ex2)
			{
				_out = handler.createExceptionReply();
				com.interpress_project.modernshare.orb.generated.NoPrivilegeHelper.write(_out, _ex2);
			}
				break;
			}
			case 7: // backup
			{
			try
			{
				_out = handler.createReply();
				_out.write_string(backup());
			}
			catch(com.interpress_project.modernshare.orb.generated.InternalError _ex0)
			{
				_out = handler.createExceptionReply();
				com.interpress_project.modernshare.orb.generated.InternalErrorHelper.write(_out, _ex0);
			}
			catch(com.interpress_project.modernshare.orb.generated.NoPrivilege _ex1)
			{
				_out = handler.createExceptionReply();
				com.interpress_project.modernshare.orb.generated.NoPrivilegeHelper.write(_out, _ex1);
			}
				break;
			}
		}
		return _out;
	}

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