All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ars.invoke.remote.slice.ResourcePrxHelper Maven / Gradle / Ivy

The newest version!
// **********************************************************************
//
// Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.6.2
//
// 
//
// Generated from file `ars-remote.ice'
//
// Warning: do not edit this file.
//
// 
//

package ars.invoke.remote.slice;

/**
 * Provides type-specific helper functions.
 **/
public final class ResourcePrxHelper extends Ice.ObjectPrxHelperBase implements ResourcePrx {
    private static final String __download_name = "download";

    public byte[] download(String id, int index, int length) {
        return download(id, index, length, null, false);
    }

    public byte[] download(String id, int index, int length, java.util.Map __ctx) {
        return download(id, index, length, __ctx, true);
    }

    private byte[] download(String id, int index, int length, java.util.Map __ctx,
                            boolean __explicitCtx) {
        __checkTwowayOnly(__download_name);
        return end_download(begin_download(id, index, length, __ctx, __explicitCtx, true, null));
    }

    public Ice.AsyncResult begin_download(String id, int index, int length) {
        return begin_download(id, index, length, null, false, false, null);
    }

    public Ice.AsyncResult begin_download(String id, int index, int length, java.util.Map __ctx) {
        return begin_download(id, index, length, __ctx, true, false, null);
    }

    public Ice.AsyncResult begin_download(String id, int index, int length, Ice.Callback __cb) {
        return begin_download(id, index, length, null, false, false, __cb);
    }

    public Ice.AsyncResult begin_download(String id, int index, int length, java.util.Map __ctx,
                                          Ice.Callback __cb) {
        return begin_download(id, index, length, __ctx, true, false, __cb);
    }

    public Ice.AsyncResult begin_download(String id, int index, int length, Callback_Resource_download __cb) {
        return begin_download(id, index, length, null, false, false, __cb);
    }

    public Ice.AsyncResult begin_download(String id, int index, int length, java.util.Map __ctx,
                                          Callback_Resource_download __cb) {
        return begin_download(id, index, length, __ctx, true, false, __cb);
    }

    public Ice.AsyncResult begin_download(String id, int index, int length,
                                          IceInternal.Functional_GenericCallback1 __responseCb,
                                          IceInternal.Functional_GenericCallback1 __exceptionCb) {
        return begin_download(id, index, length, null, false, false, __responseCb, __exceptionCb, null);
    }

    public Ice.AsyncResult begin_download(String id, int index, int length,
                                          IceInternal.Functional_GenericCallback1 __responseCb,
                                          IceInternal.Functional_GenericCallback1 __exceptionCb,
                                          IceInternal.Functional_BoolCallback __sentCb) {
        return begin_download(id, index, length, null, false, false, __responseCb, __exceptionCb, __sentCb);
    }

    public Ice.AsyncResult begin_download(String id, int index, int length, java.util.Map __ctx,
                                          IceInternal.Functional_GenericCallback1 __responseCb,
                                          IceInternal.Functional_GenericCallback1 __exceptionCb) {
        return begin_download(id, index, length, __ctx, true, false, __responseCb, __exceptionCb, null);
    }

    public Ice.AsyncResult begin_download(String id, int index, int length, java.util.Map __ctx,
                                          IceInternal.Functional_GenericCallback1 __responseCb,
                                          IceInternal.Functional_GenericCallback1 __exceptionCb,
                                          IceInternal.Functional_BoolCallback __sentCb) {
        return begin_download(id, index, length, __ctx, true, false, __responseCb, __exceptionCb, __sentCb);
    }

    private Ice.AsyncResult begin_download(String id, int index, int length, java.util.Map __ctx,
                                           boolean __explicitCtx, boolean __synchronous, IceInternal.Functional_GenericCallback1 __responseCb,
                                           IceInternal.Functional_GenericCallback1 __exceptionCb,
                                           IceInternal.Functional_BoolCallback __sentCb) {
        return begin_download(id, index, length, __ctx, __explicitCtx, __synchronous,
            new IceInternal.Functional_TwowayCallbackArg1(__responseCb, __exceptionCb, __sentCb) {
                public final void __completed(Ice.AsyncResult __result) {
                    ResourcePrxHelper.__download_completed(this, __result);
                }
            });
    }

    private Ice.AsyncResult begin_download(String id, int index, int length, java.util.Map __ctx,
                                           boolean __explicitCtx, boolean __synchronous, IceInternal.CallbackBase __cb) {
        __checkAsyncTwowayOnly(__download_name);
        IceInternal.OutgoingAsync __result = getOutgoingAsync(__download_name, __cb);
        try {
            __result.prepare(__download_name, Ice.OperationMode.Normal, __ctx, __explicitCtx, __synchronous);
            IceInternal.BasicStream __os = __result.startWriteParams(Ice.FormatType.DefaultFormat);
            __os.writeString(id);
            __os.writeInt(index);
            __os.writeInt(length);
            __result.endWriteParams();
            __result.invoke();
        } catch (Ice.Exception __ex) {
            __result.abort(__ex);
        }
        return __result;
    }

    public byte[] end_download(Ice.AsyncResult __iresult) {
        IceInternal.OutgoingAsync __result = IceInternal.OutgoingAsync.check(__iresult, this, __download_name);
        try {
            if (!__result.__wait()) {
                try {
                    __result.throwUserException();
                } catch (Ice.UserException __ex) {
                    throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
                }
            }
            IceInternal.BasicStream __is = __result.startReadParams();
            byte[] __ret;
            __ret = ByteArrayHelper.read(__is);
            __result.endReadParams();
            return __ret;
        } finally {
            if (__result != null) {
                __result.cacheMessageBuffers();
            }
        }
    }

    static public void __download_completed(Ice.TwowayCallbackArg1 __cb, Ice.AsyncResult __result) {
        ars.invoke.remote.slice.ResourcePrx __proxy = (ars.invoke.remote.slice.ResourcePrx) __result.getProxy();
        byte[] __ret = null;
        try {
            __ret = __proxy.end_download(__result);
        } catch (Ice.LocalException __ex) {
            __cb.exception(__ex);
            return;
        } catch (Ice.SystemException __ex) {
            __cb.exception(__ex);
            return;
        }
        __cb.response(__ret);
    }

    private static final String __invoke_name = "invoke";

    public Iresult invoke(String client, Itoken token, String uri, String parameter) {
        return invoke(client, token, uri, parameter, null, false);
    }

    public Iresult invoke(String client, Itoken token, String uri, String parameter,
                          java.util.Map __ctx) {
        return invoke(client, token, uri, parameter, __ctx, true);
    }

    private Iresult invoke(String client, Itoken token, String uri, String parameter,
                           java.util.Map __ctx, boolean __explicitCtx) {
        __checkTwowayOnly(__invoke_name);
        return end_invoke(begin_invoke(client, token, uri, parameter, __ctx, __explicitCtx, true, null));
    }

    public Ice.AsyncResult begin_invoke(String client, Itoken token, String uri, String parameter) {
        return begin_invoke(client, token, uri, parameter, null, false, false, null);
    }

    public Ice.AsyncResult begin_invoke(String client, Itoken token, String uri, String parameter,
                                        java.util.Map __ctx) {
        return begin_invoke(client, token, uri, parameter, __ctx, true, false, null);
    }

    public Ice.AsyncResult begin_invoke(String client, Itoken token, String uri, String parameter, Ice.Callback __cb) {
        return begin_invoke(client, token, uri, parameter, null, false, false, __cb);
    }

    public Ice.AsyncResult begin_invoke(String client, Itoken token, String uri, String parameter,
                                        java.util.Map __ctx, Ice.Callback __cb) {
        return begin_invoke(client, token, uri, parameter, __ctx, true, false, __cb);
    }

    public Ice.AsyncResult begin_invoke(String client, Itoken token, String uri, String parameter,
                                        Callback_Resource_invoke __cb) {
        return begin_invoke(client, token, uri, parameter, null, false, false, __cb);
    }

    public Ice.AsyncResult begin_invoke(String client, Itoken token, String uri, String parameter,
                                        java.util.Map __ctx, Callback_Resource_invoke __cb) {
        return begin_invoke(client, token, uri, parameter, __ctx, true, false, __cb);
    }

    public Ice.AsyncResult begin_invoke(String client, Itoken token, String uri, String parameter,
                                        IceInternal.Functional_GenericCallback1 __responseCb,
                                        IceInternal.Functional_GenericCallback1 __exceptionCb) {
        return begin_invoke(client, token, uri, parameter, null, false, false, __responseCb, __exceptionCb, null);
    }

    public Ice.AsyncResult begin_invoke(String client, Itoken token, String uri, String parameter,
                                        IceInternal.Functional_GenericCallback1 __responseCb,
                                        IceInternal.Functional_GenericCallback1 __exceptionCb,
                                        IceInternal.Functional_BoolCallback __sentCb) {
        return begin_invoke(client, token, uri, parameter, null, false, false, __responseCb, __exceptionCb, __sentCb);
    }

    public Ice.AsyncResult begin_invoke(String client, Itoken token, String uri, String parameter,
                                        java.util.Map __ctx, IceInternal.Functional_GenericCallback1 __responseCb,
                                        IceInternal.Functional_GenericCallback1 __exceptionCb) {
        return begin_invoke(client, token, uri, parameter, __ctx, true, false, __responseCb, __exceptionCb, null);
    }

    public Ice.AsyncResult begin_invoke(String client, Itoken token, String uri, String parameter,
                                        java.util.Map __ctx, IceInternal.Functional_GenericCallback1 __responseCb,
                                        IceInternal.Functional_GenericCallback1 __exceptionCb,
                                        IceInternal.Functional_BoolCallback __sentCb) {
        return begin_invoke(client, token, uri, parameter, __ctx, true, false, __responseCb, __exceptionCb, __sentCb);
    }

    private Ice.AsyncResult begin_invoke(String client, Itoken token, String uri, String parameter,
                                         java.util.Map __ctx, boolean __explicitCtx, boolean __synchronous,
                                         IceInternal.Functional_GenericCallback1 __responseCb,
                                         IceInternal.Functional_GenericCallback1 __exceptionCb,
                                         IceInternal.Functional_BoolCallback __sentCb) {
        return begin_invoke(client, token, uri, parameter, __ctx, __explicitCtx, __synchronous,
            new IceInternal.Functional_TwowayCallbackArg1(__responseCb,
                __exceptionCb, __sentCb) {
                public final void __completed(Ice.AsyncResult __result) {
                    ResourcePrxHelper.__invoke_completed(this, __result);
                }
            });
    }

    private Ice.AsyncResult begin_invoke(String client, Itoken token, String uri, String parameter,
                                         java.util.Map __ctx, boolean __explicitCtx, boolean __synchronous,
                                         IceInternal.CallbackBase __cb) {
        __checkAsyncTwowayOnly(__invoke_name);
        IceInternal.OutgoingAsync __result = getOutgoingAsync(__invoke_name, __cb);
        try {
            __result.prepare(__invoke_name, Ice.OperationMode.Normal, __ctx, __explicitCtx, __synchronous);
            IceInternal.BasicStream __os = __result.startWriteParams(Ice.FormatType.DefaultFormat);
            __os.writeString(client);
            Itoken.__write(__os, token);
            __os.writeString(uri);
            __os.writeString(parameter);
            __result.endWriteParams();
            __result.invoke();
        } catch (Ice.Exception __ex) {
            __result.abort(__ex);
        }
        return __result;
    }

    public Iresult end_invoke(Ice.AsyncResult __iresult) {
        IceInternal.OutgoingAsync __result = IceInternal.OutgoingAsync.check(__iresult, this, __invoke_name);
        try {
            if (!__result.__wait()) {
                try {
                    __result.throwUserException();
                } catch (Ice.UserException __ex) {
                    throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
                }
            }
            IceInternal.BasicStream __is = __result.startReadParams();
            IresultHolder __ret = new IresultHolder();
            __is.readObject(__ret);
            __is.readPendingObjects();
            __result.endReadParams();
            return __ret.value;
        } finally {
            if (__result != null) {
                __result.cacheMessageBuffers();
            }
        }
    }

    static public void __invoke_completed(Ice.TwowayCallbackArg1 __cb, Ice.AsyncResult __result) {
        ars.invoke.remote.slice.ResourcePrx __proxy = (ars.invoke.remote.slice.ResourcePrx) __result.getProxy();
        Iresult __ret = null;
        try {
            __ret = __proxy.end_invoke(__result);
        } catch (Ice.LocalException __ex) {
            __cb.exception(__ex);
            return;
        } catch (Ice.SystemException __ex) {
            __cb.exception(__ex);
            return;
        }
        __cb.response(__ret);
    }

    private static final String __upload_name = "upload";

    public void upload(String name, byte[] buffer, int length) {
        upload(name, buffer, length, null, false);
    }

    public void upload(String name, byte[] buffer, int length, java.util.Map __ctx) {
        upload(name, buffer, length, __ctx, true);
    }

    private void upload(String name, byte[] buffer, int length, java.util.Map __ctx,
                        boolean __explicitCtx) {
        end_upload(begin_upload(name, buffer, length, __ctx, __explicitCtx, true, null));
    }

    public Ice.AsyncResult begin_upload(String name, byte[] buffer, int length) {
        return begin_upload(name, buffer, length, null, false, false, null);
    }

    public Ice.AsyncResult begin_upload(String name, byte[] buffer, int length, java.util.Map __ctx) {
        return begin_upload(name, buffer, length, __ctx, true, false, null);
    }

    public Ice.AsyncResult begin_upload(String name, byte[] buffer, int length, Ice.Callback __cb) {
        return begin_upload(name, buffer, length, null, false, false, __cb);
    }

    public Ice.AsyncResult begin_upload(String name, byte[] buffer, int length, java.util.Map __ctx,
                                        Ice.Callback __cb) {
        return begin_upload(name, buffer, length, __ctx, true, false, __cb);
    }

    public Ice.AsyncResult begin_upload(String name, byte[] buffer, int length, Callback_Resource_upload __cb) {
        return begin_upload(name, buffer, length, null, false, false, __cb);
    }

    public Ice.AsyncResult begin_upload(String name, byte[] buffer, int length, java.util.Map __ctx,
                                        Callback_Resource_upload __cb) {
        return begin_upload(name, buffer, length, __ctx, true, false, __cb);
    }

    public Ice.AsyncResult begin_upload(String name, byte[] buffer, int length,
                                        IceInternal.Functional_VoidCallback __responseCb,
                                        IceInternal.Functional_GenericCallback1 __exceptionCb) {
        return begin_upload(name, buffer, length, null, false, false, __responseCb, __exceptionCb, null);
    }

    public Ice.AsyncResult begin_upload(String name, byte[] buffer, int length,
                                        IceInternal.Functional_VoidCallback __responseCb,
                                        IceInternal.Functional_GenericCallback1 __exceptionCb,
                                        IceInternal.Functional_BoolCallback __sentCb) {
        return begin_upload(name, buffer, length, null, false, false, __responseCb, __exceptionCb, __sentCb);
    }

    public Ice.AsyncResult begin_upload(String name, byte[] buffer, int length, java.util.Map __ctx,
                                        IceInternal.Functional_VoidCallback __responseCb,
                                        IceInternal.Functional_GenericCallback1 __exceptionCb) {
        return begin_upload(name, buffer, length, __ctx, true, false, __responseCb, __exceptionCb, null);
    }

    public Ice.AsyncResult begin_upload(String name, byte[] buffer, int length, java.util.Map __ctx,
                                        IceInternal.Functional_VoidCallback __responseCb,
                                        IceInternal.Functional_GenericCallback1 __exceptionCb,
                                        IceInternal.Functional_BoolCallback __sentCb) {
        return begin_upload(name, buffer, length, __ctx, true, false, __responseCb, __exceptionCb, __sentCb);
    }

    private Ice.AsyncResult begin_upload(String name, byte[] buffer, int length, java.util.Map __ctx,
                                         boolean __explicitCtx, boolean __synchronous, IceInternal.Functional_VoidCallback __responseCb,
                                         IceInternal.Functional_GenericCallback1 __exceptionCb,
                                         IceInternal.Functional_BoolCallback __sentCb) {
        return begin_upload(name, buffer, length, __ctx, __explicitCtx, __synchronous,
            new IceInternal.Functional_OnewayCallback(__responseCb, __exceptionCb, __sentCb));
    }

    private Ice.AsyncResult begin_upload(String name, byte[] buffer, int length, java.util.Map __ctx,
                                         boolean __explicitCtx, boolean __synchronous, IceInternal.CallbackBase __cb) {
        IceInternal.OutgoingAsync __result = getOutgoingAsync(__upload_name, __cb);
        try {
            __result.prepare(__upload_name, Ice.OperationMode.Normal, __ctx, __explicitCtx, __synchronous);
            IceInternal.BasicStream __os = __result.startWriteParams(Ice.FormatType.DefaultFormat);
            __os.writeString(name);
            ByteArrayHelper.write(__os, buffer);
            __os.writeInt(length);
            __result.endWriteParams();
            __result.invoke();
        } catch (Ice.Exception __ex) {
            __result.abort(__ex);
        }
        return __result;
    }

    public void end_upload(Ice.AsyncResult __iresult) {
        __end(__iresult, __upload_name);
    }

    /**
     * Contacts the remote server to verify that the object implements this type.
     * Raises a local exception if a communication error occurs.
     *
     * @param __obj The untyped proxy.
     * @return A proxy for this type, or null if the object does not support this
     * type.
     **/
    public static ResourcePrx checkedCast(Ice.ObjectPrx __obj) {
        return checkedCastImpl(__obj, ice_staticId(), ResourcePrx.class, ResourcePrxHelper.class);
    }

    /**
     * Contacts the remote server to verify that the object implements this type.
     * Raises a local exception if a communication error occurs.
     *
     * @param __obj The untyped proxy.
     * @param __ctx The Context map to send with the invocation.
     * @return A proxy for this type, or null if the object does not support this
     * type.
     **/
    public static ResourcePrx checkedCast(Ice.ObjectPrx __obj, java.util.Map __ctx) {
        return checkedCastImpl(__obj, __ctx, ice_staticId(), ResourcePrx.class, ResourcePrxHelper.class);
    }

    /**
     * Contacts the remote server to verify that a facet of the object implements
     * this type. Raises a local exception if a communication error occurs.
     *
     * @param __obj   The untyped proxy.
     * @param __facet The name of the desired facet.
     * @return A proxy for this type, or null if the object does not support this
     * type.
     **/
    public static ResourcePrx checkedCast(Ice.ObjectPrx __obj, String __facet) {
        return checkedCastImpl(__obj, __facet, ice_staticId(), ResourcePrx.class, ResourcePrxHelper.class);
    }

    /**
     * Contacts the remote server to verify that a facet of the object implements
     * this type. Raises a local exception if a communication error occurs.
     *
     * @param __obj   The untyped proxy.
     * @param __facet The name of the desired facet.
     * @param __ctx   The Context map to send with the invocation.
     * @return A proxy for this type, or null if the object does not support this
     * type.
     **/
    public static ResourcePrx checkedCast(Ice.ObjectPrx __obj, String __facet, java.util.Map __ctx) {
        return checkedCastImpl(__obj, __facet, __ctx, ice_staticId(), ResourcePrx.class, ResourcePrxHelper.class);
    }

    /**
     * Downcasts the given proxy to this type without contacting the remote server.
     *
     * @param __obj The untyped proxy.
     * @return A proxy for this type.
     **/
    public static ResourcePrx uncheckedCast(Ice.ObjectPrx __obj) {
        return uncheckedCastImpl(__obj, ResourcePrx.class, ResourcePrxHelper.class);
    }

    /**
     * Downcasts the given proxy to this type without contacting the remote server.
     *
     * @param __obj   The untyped proxy.
     * @param __facet The name of the desired facet.
     * @return A proxy for this type.
     **/
    public static ResourcePrx uncheckedCast(Ice.ObjectPrx __obj, String __facet) {
        return uncheckedCastImpl(__obj, __facet, ResourcePrx.class, ResourcePrxHelper.class);
    }

    public static final String[] __ids = {"::Ice::Object", "::ars::invoke::remote::slice::Resource"};

    /**
     * Provides the Slice type ID of this type.
     *
     * @return The Slice type ID.
     **/
    public static String ice_staticId() {
        return __ids[1];
    }

    public static void __write(IceInternal.BasicStream __os, ResourcePrx v) {
        __os.writeProxy(v);
    }

    public static ResourcePrx __read(IceInternal.BasicStream __is) {
        Ice.ObjectPrx proxy = __is.readProxy();
        if (proxy != null) {
            ResourcePrxHelper result = new ResourcePrxHelper();
            result.__copyFrom(proxy);
            return result;
        }
        return null;
    }

    public static final long serialVersionUID = 0L;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy