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("serial")
public class _MdsServiceStub
	extends org.omg.CORBA.portable.ObjectImpl
	implements com.interpress_project.modernshare.orb.generated.MdsService
{
	private String[] ids = {"IDL:com/interpress_project/modernshare/orb/generated/MdsService:1.0"};
	public String[] _ids()
	{
		return ids;
	}

	public final static java.lang.Class _opsClass = com.interpress_project.modernshare.orb.generated.MdsServiceOperations.class;
	public void addUser(java.lang.String account, java.lang.String password) throws com.interpress_project.modernshare.orb.generated.InternalError,com.interpress_project.modernshare.orb.generated.NoPrivilege,com.interpress_project.modernshare.orb.generated.AccountExist,com.interpress_project.modernshare.orb.generated.LicenseError
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "addUser", true);
				_os.write_wstring(account);
				_os.write_wstring(password);
				_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:com/interpress_project/modernshare/orb/generated/InternalError:1.0"))
				{
					throw com.interpress_project.modernshare.orb.generated.InternalErrorHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:com/interpress_project/modernshare/orb/generated/NoPrivilege:1.0"))
				{
					throw com.interpress_project.modernshare.orb.generated.NoPrivilegeHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:com/interpress_project/modernshare/orb/generated/AccountExist:1.0"))
				{
					throw com.interpress_project.modernshare.orb.generated.AccountExistHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:com/interpress_project/modernshare/orb/generated/LicenseError:1.0"))
				{
					throw com.interpress_project.modernshare.orb.generated.LicenseErrorHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "addUser", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			MdsServiceOperations _localServant = (MdsServiceOperations)_so.servant;
			try
			{
				_localServant.addUser(account,password);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return;
		}

		}

	}

	public com.interpress_project.modernshare.orb.generated.MdsClientInfo getClientInfo(java.lang.String account, java.lang.String clientid)
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "getClientInfo", true);
				_os.write_wstring(account);
				_os.write_wstring(clientid);
				_is = _invoke(_os);
				com.interpress_project.modernshare.orb.generated.MdsClientInfo _result = (com.interpress_project.modernshare.orb.generated.MdsClientInfo)((org.omg.CORBA_2_3.portable.InputStream)_is).read_value ("IDL:com/interpress_project/modernshare/orb/generated/MdsClientInfo:1.0");
				return _result;
			}
			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( "getClientInfo", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			MdsServiceOperations _localServant = (MdsServiceOperations)_so.servant;
			com.interpress_project.modernshare.orb.generated.MdsClientInfo _result;
			try
			{
				_result = _localServant.getClientInfo(account,clientid);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

	public void recovery() throws com.interpress_project.modernshare.orb.generated.InternalError,com.interpress_project.modernshare.orb.generated.NoPrivilege
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "recovery", true);
				_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:com/interpress_project/modernshare/orb/generated/InternalError:1.0"))
				{
					throw com.interpress_project.modernshare.orb.generated.InternalErrorHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:com/interpress_project/modernshare/orb/generated/NoPrivilege:1.0"))
				{
					throw com.interpress_project.modernshare.orb.generated.NoPrivilegeHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "recovery", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			MdsServiceOperations _localServant = (MdsServiceOperations)_so.servant;
			try
			{
				_localServant.recovery();
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return;
		}

		}

	}

	public void setClientInfo(com.interpress_project.modernshare.orb.generated.MdsClientInfo info)
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "setClientInfo", true);
				((org.omg.CORBA_2_3.portable.OutputStream)_os).write_value (info);
				_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( "setClientInfo", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			MdsServiceOperations _localServant = (MdsServiceOperations)_so.servant;
			try
			{
				_localServant.setClientInfo(info);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return;
		}

		}

	}

	public com.interpress_project.modernshare.orb.generated.MdsServerInfo getServerInfo()
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "getServerInfo", true);
				_is = _invoke(_os);
				com.interpress_project.modernshare.orb.generated.MdsServerInfo _result = (com.interpress_project.modernshare.orb.generated.MdsServerInfo)((org.omg.CORBA_2_3.portable.InputStream)_is).read_value ("IDL:com/interpress_project/modernshare/orb/generated/MdsServerInfo:1.0");
				return _result;
			}
			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( "getServerInfo", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			MdsServiceOperations _localServant = (MdsServiceOperations)_so.servant;
			com.interpress_project.modernshare.orb.generated.MdsServerInfo _result;
			try
			{
				_result = _localServant.getServerInfo();
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

	public void changePassword(java.lang.String account, java.lang.String newpassword) throws com.interpress_project.modernshare.orb.generated.AccountNotFound
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "changePassword", true);
				_os.write_wstring(account);
				_os.write_wstring(newpassword);
				_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:com/interpress_project/modernshare/orb/generated/AccountNotFound:1.0"))
				{
					throw com.interpress_project.modernshare.orb.generated.AccountNotFoundHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "changePassword", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			MdsServiceOperations _localServant = (MdsServiceOperations)_so.servant;
			try
			{
				_localServant.changePassword(account,newpassword);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return;
		}

		}

	}

	public void deleteUser(java.lang.String account) throws com.interpress_project.modernshare.orb.generated.InternalError,com.interpress_project.modernshare.orb.generated.AccountNotFound,com.interpress_project.modernshare.orb.generated.NoPrivilege
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "deleteUser", true);
				_os.write_wstring(account);
				_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:com/interpress_project/modernshare/orb/generated/InternalError:1.0"))
				{
					throw com.interpress_project.modernshare.orb.generated.InternalErrorHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:com/interpress_project/modernshare/orb/generated/AccountNotFound:1.0"))
				{
					throw com.interpress_project.modernshare.orb.generated.AccountNotFoundHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:com/interpress_project/modernshare/orb/generated/NoPrivilege:1.0"))
				{
					throw com.interpress_project.modernshare.orb.generated.NoPrivilegeHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "deleteUser", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			MdsServiceOperations _localServant = (MdsServiceOperations)_so.servant;
			try
			{
				_localServant.deleteUser(account);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return;
		}

		}

	}

	public java.lang.String backup() throws com.interpress_project.modernshare.orb.generated.InternalError,com.interpress_project.modernshare.orb.generated.NoPrivilege
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "backup", 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:com/interpress_project/modernshare/orb/generated/InternalError:1.0"))
				{
					throw com.interpress_project.modernshare.orb.generated.InternalErrorHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:com/interpress_project/modernshare/orb/generated/NoPrivilege:1.0"))
				{
					throw com.interpress_project.modernshare.orb.generated.NoPrivilegeHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "backup", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			MdsServiceOperations _localServant = (MdsServiceOperations)_so.servant;
			java.lang.String _result;
			try
			{
				_result = _localServant.backup();
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

}
