/*
 * @(#)UserServiceImpl_Stub.java
 *
 * Copyright 2006 Sony Corporation
 */

package info.dragonlady.cluster;

import java.rmi.RemoteException;

/**
 * ユーザ管理情報をクラスタリングサーバ間で共有する為のクライアント側スタブクラス。
 * 
 * RMIコンパイラによる自動生成ファイル。
 * 
 * @author Hiroshi.Ebata(INFOCITY)
 * @version $Revision: 1.3 $ $Date: 2006/03/10 14:28:48 $
 */
public final class UserServiceImpl_Stub
    extends java.rmi.server.RemoteStub
    implements info.dragonlady.cluster.UserService, java.rmi.Remote
{
    private static final java.rmi.server.Operation[] operations = {
	new java.rmi.server.Operation("boolean add(java.lang.String, java.lang.String)"),
	new java.rmi.server.Operation("java.util.Map get()"),
	new java.rmi.server.Operation("boolean remove(java.lang.String)"),
	new java.rmi.server.Operation("boolean removeByRelationId(java.lang.String)"),
	new java.rmi.server.Operation("void set(java.util.Map)")
    };
    
    private static final long interfaceHash = -3445262185807050204L;
    
    private static final long serialVersionUID = 2;
    
    private static boolean useNewInvoke;
    private static java.lang.reflect.Method $method_add_0;
    private static java.lang.reflect.Method $method_get_1;
    private static java.lang.reflect.Method $method_remove_2;
    private static java.lang.reflect.Method $method_removeByRelationId_3;
    private static java.lang.reflect.Method $method_set_4;
    
    static {
	try {
	    java.rmi.server.RemoteRef.class.getMethod("invoke",
		new java.lang.Class[] {
		    java.rmi.Remote.class,
		    java.lang.reflect.Method.class,
		    java.lang.Object[].class,
		    long.class
		});
	    useNewInvoke = true;
	    $method_add_0 = info.dragonlady.cluster.UserService.class.getMethod("add", new java.lang.Class[] {java.lang.String.class, java.lang.String.class});
	    $method_get_1 = info.dragonlady.cluster.UserService.class.getMethod("get", new java.lang.Class[] {});
	    $method_remove_2 = info.dragonlady.cluster.UserService.class.getMethod("remove", new java.lang.Class[] {java.lang.String.class});
	    $method_removeByRelationId_3 = info.dragonlady.cluster.UserService.class.getMethod("removeByRelationId", new java.lang.Class[] {java.lang.String.class});
	    $method_set_4 = info.dragonlady.cluster.UserService.class.getMethod("set", new java.lang.Class[] {java.util.Map.class});
	} catch (java.lang.NoSuchMethodException e) {
	    useNewInvoke = false;
	}
    }
    
    /**
     * コンストラクタ。
     */
    public UserServiceImpl_Stub() {
	super();
    }
    /**
     * コンストラクタ。
     * 
     * @param ref リモート参照
     */
    public UserServiceImpl_Stub(java.rmi.server.RemoteRef ref) {
	super(ref);
    }
    
    // methods from remote interfaces
    
	/**
	 * ユーザ追加。
	 * 
	 * @param $param_String_1 ユーザ名
	 * @param $param_String_2 ユーザと紐づくID
	 * @return boolean true：追加成功／false：追加失敗
	 * @throws RemoteException
     * @see info.dragonlady.cluster.UserService#add(java.lang.String, java.lang.String)
     */
    public boolean add(java.lang.String $param_String_1, java.lang.String $param_String_2)
	throws java.rmi.RemoteException
    {
	try {
	    if (useNewInvoke) {
		Object $result = ref.invoke(this, $method_add_0, new java.lang.Object[] {$param_String_1, $param_String_2}, -1748326657702671300L);
		return ((java.lang.Boolean) $result).booleanValue();
	    } else {
		java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 0, interfaceHash);
		try {
		    java.io.ObjectOutput out = call.getOutputStream();
		    out.writeObject($param_String_1);
		    out.writeObject($param_String_2);
		} catch (java.io.IOException e) {
		    throw new java.rmi.MarshalException("error marshalling arguments", e);
		}
		ref.invoke(call);
		boolean $result;
		try {
		    java.io.ObjectInput in = call.getInputStream();
		    $result = in.readBoolean();
		} catch (java.io.IOException e) {
		    throw new java.rmi.UnmarshalException("error unmarshalling return", e);
		} finally {
		    ref.done(call);
		}
		return $result;
	    }
	} catch (java.lang.RuntimeException e) {
	    throw e;
	} catch (java.rmi.RemoteException e) {
	    throw e;
	} catch (java.lang.Exception e) {
	    throw new java.rmi.UnexpectedException("undeclared checked exception", e);
	}
    }
    
	/**
	 * ユーザ管理マップ取得。
	 * 
	 * @return Map ユーザ管理マップ（key:ユーザ名、value:関連するID）
	 * @throws RemoteException
     * @see info.dragonlady.cluster.UserService#get()
     */
    public java.util.Map get()
	throws java.rmi.RemoteException
    {
	try {
	    if (useNewInvoke) {
		Object $result = ref.invoke(this, $method_get_1, null, 1702275998944278185L);
		return ((java.util.Map) $result);
	    } else {
		java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 1, interfaceHash);
		ref.invoke(call);
		java.util.Map $result;
		try {
		    java.io.ObjectInput in = call.getInputStream();
		    $result = (java.util.Map) in.readObject();
		} catch (java.io.IOException e) {
		    throw new java.rmi.UnmarshalException("error unmarshalling return", e);
		} catch (java.lang.ClassNotFoundException e) {
		    throw new java.rmi.UnmarshalException("error unmarshalling return", e);
		} finally {
		    ref.done(call);
		}
		return $result;
	    }
	} catch (java.lang.RuntimeException e) {
	    throw e;
	} catch (java.rmi.RemoteException e) {
	    throw e;
	} catch (java.lang.Exception e) {
	    throw new java.rmi.UnexpectedException("undeclared checked exception", e);
	}
    }
    
	/**
	 * ユーザ削除。
	 * 
	 * @param $param_String_1 ユーザ名
	 * @return boolean true：削除成功／false：削除失敗
	 * @throws RemoteException
     * @see info.dragonlady.cluster.UserService#remove(java.lang.String)
     */
    public boolean remove(java.lang.String $param_String_1)
	throws java.rmi.RemoteException
    {
	try {
	    if (useNewInvoke) {
		Object $result = ref.invoke(this, $method_remove_2, new java.lang.Object[] {$param_String_1}, -7371028326840638641L);
		return ((java.lang.Boolean) $result).booleanValue();
	    } else {
		java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 2, interfaceHash);
		try {
		    java.io.ObjectOutput out = call.getOutputStream();
		    out.writeObject($param_String_1);
		} catch (java.io.IOException e) {
		    throw new java.rmi.MarshalException("error marshalling arguments", e);
		}
		ref.invoke(call);
		boolean $result;
		try {
		    java.io.ObjectInput in = call.getInputStream();
		    $result = in.readBoolean();
		} catch (java.io.IOException e) {
		    throw new java.rmi.UnmarshalException("error unmarshalling return", e);
		} finally {
		    ref.done(call);
		}
		return $result;
	    }
	} catch (java.lang.RuntimeException e) {
	    throw e;
	} catch (java.rmi.RemoteException e) {
	    throw e;
	} catch (java.lang.Exception e) {
	    throw new java.rmi.UnexpectedException("undeclared checked exception", e);
	}
    }
    
	/**
	 * ユーザに紐づく管理用IDでユーザを削除。
	 * 
	 * @param $param_String_1 ユーザに紐づくID
	 * @return boolean true：削除成功／false：削除失敗
	 * @throws RemoteException
     * @see info.dragonlady.cluster.UserService#removeByRelationId(java.lang.String)
     */
    public boolean removeByRelationId(java.lang.String $param_String_1)
	throws java.rmi.RemoteException
    {
	try {
	    if (useNewInvoke) {
		Object $result = ref.invoke(this, $method_removeByRelationId_3, new java.lang.Object[] {$param_String_1}, -1977614195662247028L);
		return ((java.lang.Boolean) $result).booleanValue();
	    } else {
		java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 3, interfaceHash);
		try {
		    java.io.ObjectOutput out = call.getOutputStream();
		    out.writeObject($param_String_1);
		} catch (java.io.IOException e) {
		    throw new java.rmi.MarshalException("error marshalling arguments", e);
		}
		ref.invoke(call);
		boolean $result;
		try {
		    java.io.ObjectInput in = call.getInputStream();
		    $result = in.readBoolean();
		} catch (java.io.IOException e) {
		    throw new java.rmi.UnmarshalException("error unmarshalling return", e);
		} finally {
		    ref.done(call);
		}
		return $result;
	    }
	} catch (java.lang.RuntimeException e) {
	    throw e;
	} catch (java.rmi.RemoteException e) {
	    throw e;
	} catch (java.lang.Exception e) {
	    throw new java.rmi.UnexpectedException("undeclared checked exception", e);
	}
    }
    
	/**
	 * ユーザ一覧設定。
	 * 
	 * @param $param_Map_1 ユーザ管理マップ（key:ユーザ名、value:関連するID）
	 * @throws RemoteException
     * @see info.dragonlady.cluster.UserService#set(java.util.Map)
     */
    public void set(java.util.Map $param_Map_1)
	throws java.rmi.RemoteException
    {
	try {
	    if (useNewInvoke) {
		ref.invoke(this, $method_set_4, new java.lang.Object[] {$param_Map_1}, 5112212046473305139L);
	    } else {
		java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 4, interfaceHash);
		try {
		    java.io.ObjectOutput out = call.getOutputStream();
		    out.writeObject($param_Map_1);
		} catch (java.io.IOException e) {
		    throw new java.rmi.MarshalException("error marshalling arguments", e);
		}
		ref.invoke(call);
		ref.done(call);
	    }
	} catch (java.lang.RuntimeException e) {
	    throw e;
	} catch (java.rmi.RemoteException e) {
	    throw e;
	} catch (java.lang.Exception e) {
	    throw new java.rmi.UnexpectedException("undeclared checked exception", e);
	}
    }
}
