/*
 * Automatically generated by jrpcgen 1.1.6 on 21.02.24 22:11
 * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
 * See http://remotetea.sourceforge.net for details
 */
package tests.org.acplt.oncrpc.jrpcgen;
import org.acplt.oncrpc.*;
import java.io.IOException;

import java.net.InetAddress;

/**
 * The class <code>demoClient</code> implements the client stub proxy
 * for the DEMO remote program. It provides method stubs
 * which, when called, in turn call the appropriate remote method (procedure).
 */
public class demoClient extends OncRpcClientStub implements demo_DEMO_CltIF {

    /**
     * Constructs a <code>demoClient</code> client stub proxy dummy.
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public demoClient()
           throws OncRpcException, IOException {
        super(null);
    }

    /**
     * Constructs a <code>demoClient</code> client stub proxy object
     * from which the DEMO remote program can be accessed.
     * @param host Internet address of host where to contact the remote program.
     * @param protocol {@link org.acplt.oncrpc.OncRpcProtocols Protocol} to be
     *   used for ONC/RPC calls.
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public demoClient(InetAddress host, int protocol)
           throws OncRpcException, IOException {
        super(host, demo.DEMO, 2, 0, protocol);
    }

    /**
     * Constructs a <code>demoClient</code> client stub proxy object
     * from which the DEMO remote program can be accessed.
     * @param host Internet address of host where to contact the remote program.
     * @param port Port number at host where the remote program can be reached.
     * @param protocol {@link org.acplt.oncrpc.OncRpcProtocols Protocol} to be
     *   used for ONC/RPC calls.
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public demoClient(InetAddress host, int port, int protocol)
           throws OncRpcException, IOException {
        super(host, demo.DEMO, 2, port, protocol);
    }

    /**
     * Constructs a <code>demoClient</code> client stub proxy object
     * from which the DEMO remote program can be accessed.
     * @param client ONC/RPC client connection object implementing a particular
     *   protocol.
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public demoClient(OncRpcClient client)
           throws OncRpcException, IOException {
        super(client);
    }

    /**
     * Constructs a <code>demoClient</code> client stub proxy object
     * from which the DEMO remote program can be accessed.
     * @param host Internet address of host where to contact the remote program.
     * @param program Remote program number.
     * @param version Remote program version number.
     * @param protocol {@link org.acplt.oncrpc.OncRpcProtocols Protocol} to be
     *   used for ONC/RPC calls.
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public demoClient(InetAddress host, int program, int version, int protocol)
           throws OncRpcException, IOException {
        super(host, program, version, 0, protocol);
    }

    /**
     * Constructs a <code>demoClient</code> client stub proxy object
     * from which the DEMO remote program can be accessed.
     * @param host Internet address of host where to contact the remote program.
     * @param program Remote program number.
     * @param version Remote program version number.
     * @param port Port number at host where the remote program can be reached.
     * @param protocol {@link org.acplt.oncrpc.OncRpcProtocols Protocol} to be
     *   used for ONC/RPC calls.
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public demoClient(InetAddress host, int program, int version, int port, int protocol)
           throws OncRpcException, IOException {
        super(host, program, version, port, protocol);
    }

    /**
     * Usually there is no need to define
     * the null-procedure call, explicitely.
     */
    public void NULL_1()
           throws OncRpcException, IOException {
        XdrVoid args$ = XdrVoid.XDR_VOID;
        XdrVoid result$ = XdrVoid.XDR_VOID;
        client.call(demo.NULL_1, demo.FIRST_DEMO_VERSION, args$, result$);
    }

    /**
     * Let's echo the passed string!
     *
     * @param The string to be echoed. 
     * @return The passed string.
     */
    public String echo_1(String arg1)
           throws OncRpcException, IOException {
        XdrString args$ = new XdrString(arg1);
        XdrString result$ = new XdrString();
        client.call(demo.echo_1, demo.FIRST_DEMO_VERSION, args$, result$);
        return result$.stringValue();
    }

    /**
     * Call remote procedure concat_1.
     * @param arg1 parameter (of type STRINGVECTOR) to the remote procedure call.
     * @return Result from remote procedure call (of type string).
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public String concat_1(STRINGVECTOR arg1)
           throws OncRpcException, IOException {
        XdrString result$ = new XdrString();
        client.call(demo.concat_1, demo.FIRST_DEMO_VERSION, arg1, result$);
        return result$.stringValue();
    }

    /**
     * Call remote procedure checkfoo_1.
     * @param arg1 parameter (of type ENUMFOO) to the remote procedure call.
     * @return Result from remote procedure call (of type bool).
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public boolean checkfoo_1(ENUMFOO arg1)
           throws OncRpcException, IOException {
        XdrEnum<ENUMFOO> args$ = new XdrEnum<ENUMFOO>(arg1);
        XdrBoolean result$ = new XdrBoolean();
        client.call(demo.checkfoo_1, demo.FIRST_DEMO_VERSION, args$, result$);
        return result$.booleanValue();
    }

    /**
     * Call remote procedure foo_1.
     * @return Result from remote procedure call (of type ENUMFOO).
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public ENUMFOO foo_1()
           throws OncRpcException, IOException {
        XdrVoid args$ = XdrVoid.XDR_VOID;
        XdrEnum<ENUMFOO> result$ = new XdrEnum<ENUMFOO>(ENUMFOO.FOO);
        client.call(demo.foo_1, demo.FIRST_DEMO_VERSION, args$, result$);
        return result$.getValue();
    }

    /**
     * Call remote procedure ll_1.
     * @param arg1 parameter (of type LINKEDLIST) to the remote procedure call.
     * @return Result from remote procedure call (of type LINKEDLIST).
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public LINKEDLIST ll_1(LINKEDLIST arg1)
           throws OncRpcException, IOException {
        LINKEDLIST result$ = new LINKEDLIST();
        client.call(demo.ll_1, demo.FIRST_DEMO_VERSION, arg1, result$);
        return result$;
    }

    /**
     * Call remote procedure readSomeResult_1.
     * @return Result from remote procedure call (of type SOMERESULT).
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public SOMERESULT readSomeResult_1()
           throws OncRpcException, IOException {
        XdrVoid args$ = XdrVoid.XDR_VOID;
        SOMERESULT result$ = new SOMERESULT();
        client.call(demo.readSomeResult_1, demo.FIRST_DEMO_VERSION, args$, result$);
        return result$;
    }

    /**
     * Call remote procedure NULL_2.
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public void NULL_2()
           throws OncRpcException, IOException {
        XdrVoid args$ = XdrVoid.XDR_VOID;
        XdrVoid result$ = XdrVoid.XDR_VOID;
        client.call(demo.NULL_2, demo.SECOND_DEMO_VERSION, args$, result$);
    }

    /**
     * Call remote procedure cat_2.
     * @param arg1 parameter (of type String) to the remote procedure call.
     * @param arg2 parameter (of type String) to the remote procedure call.
     * @return Result from remote procedure call (of type string).
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public String cat_2(final String arg1, final String arg2)
           throws OncRpcException, IOException {
        XdrAble args$ = new XdrAble() {
            public void xdrEncode(XdrEncodingStream xdr)
                   throws OncRpcException, IOException {
                xdr.xdrEncodeString(arg1);
                xdr.xdrEncodeString(arg2);
            }
            public void xdrDecode(XdrDecodingStream xdr)
                   throws OncRpcException, IOException {
            }
        };
        XdrString result$ = new XdrString();
        client.call(demo.cat_2, demo.SECOND_DEMO_VERSION, args$, result$);
        return result$.stringValue();
    }

    /**
     * Concatenates the passed strings.
     *
     * @param one The beginning of the string to build
     * @param two The second part of the string to build
     * @param three The last part of the string to build
     * @return The string resulting from the concatenation of
     * the passed three strings {@code one}, {@code two} and
     * {@code three}.
     */
    public String cat3_2(final String one, final String two, final String three)
           throws OncRpcException, IOException {
        XdrAble args$ = new XdrAble() {
            public void xdrEncode(XdrEncodingStream xdr)
                   throws OncRpcException, IOException {
                xdr.xdrEncodeString(one);
                xdr.xdrEncodeString(two);
                xdr.xdrEncodeString(three);
            }
            public void xdrDecode(XdrDecodingStream xdr)
                   throws OncRpcException, IOException {
            }
        };
        XdrString result$ = new XdrString();
        client.call(demo.cat3_2, demo.SECOND_DEMO_VERSION, args$, result$);
        return result$.stringValue();
    }

    /**
     * Call remote procedure checkfoo_2.
     * @param foo parameter (of type ENUMFOO) to the remote procedure call.
     * @return Result from remote procedure call (of type string).
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public String checkfoo_2(ENUMFOO foo)
           throws OncRpcException, IOException {
        XdrEnum<ENUMFOO> args$ = new XdrEnum<ENUMFOO>(foo);
        XdrString result$ = new XdrString();
        client.call(demo.checkfoo_2, demo.SECOND_DEMO_VERSION, args$, result$);
        return result$.stringValue();
    }

    /**
     * Call remote procedure llcat_2.
     * @param l1 parameter (of type LINKEDLIST) to the remote procedure call.
     * @param l2 parameter (of type LINKEDLIST) to the remote procedure call.
     * @return Result from remote procedure call (of type LINKEDLIST).
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public LINKEDLIST llcat_2(final LINKEDLIST l1, final LINKEDLIST l2)
           throws OncRpcException, IOException {
        XdrAble args$ = new XdrAble() {
            public void xdrEncode(XdrEncodingStream xdr)
                   throws OncRpcException, IOException {
                l1.xdrEncode(xdr);
                l2.xdrEncode(xdr);
            }
            public void xdrDecode(XdrDecodingStream xdr)
                   throws OncRpcException, IOException {
            }
        };
        LINKEDLIST result$ = new LINKEDLIST();
        client.call(demo.llcat_2, demo.SECOND_DEMO_VERSION, args$, result$);
        return result$;
    }

    /**
     * Call remote procedure test_2.
     * @param a parameter (of type String) to the remote procedure call.
     * @param b parameter (of type ENUMFOO) to the remote procedure call.
     * @param c parameter (of type ENUMFOO) to the remote procedure call.
     * @param d parameter (of type int) to the remote procedure call.
     * @throws OncRpcException if an ONC/RPC error occurs.
     * @throws IOException if an I/O error occurs.
     */
    public void test_2(final String a, final ENUMFOO b, final ENUMFOO c, final int d)
           throws OncRpcException, IOException {
        XdrAble args$ = new XdrAble() {
            public void xdrEncode(XdrEncodingStream xdr)
                   throws OncRpcException, IOException {
                xdr.xdrEncodeString(a);
                xdr.xdrEncodeInt(b.getEncoding());
                xdr.xdrEncodeInt(c.getEncoding());
                xdr.xdrEncodeInt(d);
            }
            public void xdrDecode(XdrDecodingStream xdr)
                   throws OncRpcException, IOException {
            }
        };
        XdrVoid result$ = XdrVoid.XDR_VOID;
        client.call(demo.test_2, demo.SECOND_DEMO_VERSION, args$, result$);
    }

}
// End of demoClient.java
