当前位置: 首页>>代码示例>>Java>>正文


Java ApiCallback.onUploadProgress方法代码示例

本文整理汇总了Java中cloud.artik.client.ApiCallback.onUploadProgress方法的典型用法代码示例。如果您正苦于以下问题:Java ApiCallback.onUploadProgress方法的具体用法?Java ApiCallback.onUploadProgress怎么用?Java ApiCallback.onUploadProgress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cloud.artik.client.ApiCallback的用法示例。


在下文中一共展示了ApiCallback.onUploadProgress方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDeviceTypeAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get Device Type (asynchronously)
 * Retrieves a Device Type
 * @param deviceTypeId deviceTypeId (required)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call getDeviceTypeAsync(String deviceTypeId, final ApiCallback<DeviceTypeEnvelope> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = getDeviceTypeValidateBeforeCall(deviceTypeId, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<DeviceTypeEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:35,代码来源:DeviceTypesApi.java

示例2: getAvailableManifestVersionsAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get Available Manifest Versions (asynchronously)
 * Get a Device Type&#39;s available manifest versions
 * @param deviceTypeId deviceTypeId (required)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call getAvailableManifestVersionsAsync(String deviceTypeId, final ApiCallback<ManifestVersionsEnvelope> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = getAvailableManifestVersionsValidateBeforeCall(deviceTypeId, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ManifestVersionsEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:35,代码来源:DeviceTypesApi.java

示例3: deleteDeviceTokenAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Delete Device Token (asynchronously)
 * Deletes a device&#39;s token
 * @param deviceId deviceId (required)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call deleteDeviceTokenAsync(String deviceId, final ApiCallback<DeviceTokenEnvelope> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = deleteDeviceTokenValidateBeforeCall(deviceId, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<DeviceTokenEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:35,代码来源:DevicesApi.java

示例4: confirmUserAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Confirm User (asynchronously)
 * This call updates the registration request issued earlier by associating it with an authenticated user and captures all additional information required to add a new device.
 * @param registrationInfo Device Registration information. (required)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call confirmUserAsync(DeviceRegConfirmUserRequest registrationInfo, final ApiCallback<DeviceRegConfirmUserResponseEnvelope> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = confirmUserValidateBeforeCall(registrationInfo, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<DeviceRegConfirmUserResponseEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:35,代码来源:RegistrationsApi.java

示例5: updateDeviceTypesInfoAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Updates a device type information (asynchronously)
 * Updates a device type information
 * @param dtid Device type ID. (required)
 * @param deviceTypeInfo Device type info object to be set (required)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call updateDeviceTypesInfoAsync(String dtid, DeviceTypesInfo deviceTypeInfo, final ApiCallback<DeviceTypesInfoEnvelope> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = updateDeviceTypesInfoValidateBeforeCall(dtid, deviceTypeInfo, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<DeviceTypesInfoEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:36,代码来源:DevicesManagementApi.java

示例6: updateUserPropertiesAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Update User Application Properties (asynchronously)
 * Updates application properties of a user
 * @param userId User Id (required)
 * @param properties Properties to be updated (required)
 * @param aid Application ID (optional)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call updateUserPropertiesAsync(String userId, AppProperties properties, String aid, final ApiCallback<PropertiesEnvelope> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = updateUserPropertiesValidateBeforeCall(userId, properties, aid, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<PropertiesEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:37,代码来源:UsersApi.java

示例7: getNormalizedMessagesAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get Normalized Messages (asynchronously)
 * Get the messages normalized
 * @param uid User ID. If not specified, assume that of the current authenticated user. If specified, it must be that of a user for which the current authenticated user has read access to. (optional)
 * @param sdid Source device ID of the messages being searched. (optional)
 * @param mid The message ID being searched. (optional)
 * @param fieldPresence String representing a field from the specified device ID. (optional)
 * @param filter Filter. (optional)
 * @param offset A string that represents the starting item, should be the value of &#39;next&#39; field received in the last response. (required for pagination) (optional)
 * @param count count (optional)
 * @param startDate startDate (optional)
 * @param endDate endDate (optional)
 * @param order Desired sort order: &#39;asc&#39; or &#39;desc&#39; (optional)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call getNormalizedMessagesAsync(String uid, String sdid, String mid, String fieldPresence, String filter, String offset, Integer count, Long startDate, Long endDate, String order, final ApiCallback<NormalizedMessagesEnvelope> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = getNormalizedMessagesValidateBeforeCall(uid, sdid, mid, fieldPresence, filter, offset, count, startDate, endDate, order, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<NormalizedMessagesEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:44,代码来源:MessagesApi.java

示例8: updateTaskForDeviceAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Updates a task for a specific device - For now just allows changing the state to cancelled. (asynchronously)
 * Updates a task for a specific device - For now just allows changing the state to cancelled.
 * @param tid Task ID. (required)
 * @param did Device ID. (required)
 * @param deviceTaskUpdateRequest Device task update request (required)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call updateTaskForDeviceAsync(String tid, String did, DeviceTaskUpdateRequest deviceTaskUpdateRequest, final ApiCallback<DeviceTaskUpdateResponse> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = updateTaskForDeviceValidateBeforeCall(tid, did, deviceTaskUpdateRequest, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<DeviceTaskUpdateResponse>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:37,代码来源:DevicesManagementApi.java

示例9: getDeviceStatusAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get Device Status (asynchronously)
 * Get Device Status
 * @param deviceId Device ID. (required)
 * @param includeSnapshot Include device snapshot into the response (optional)
 * @param includeSnapshotTimestamp Include device snapshot timestamp into the response (optional)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call getDeviceStatusAsync(String deviceId, Boolean includeSnapshot, Boolean includeSnapshotTimestamp, final ApiCallback<DeviceStatus> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = getDeviceStatusValidateBeforeCall(deviceId, includeSnapshot, includeSnapshotTimestamp, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<DeviceStatus>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:37,代码来源:DevicesStatusApi.java

示例10: deleteServerPropertiesAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Deletes a device&#39;s properties. (asynchronously)
 * Deletes a device&#39;s properties.
 * @param did Device ID. (required)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call deleteServerPropertiesAsync(String did, final ApiCallback<MetadataEnvelope> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = deleteServerPropertiesValidateBeforeCall(did, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<MetadataEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:35,代码来源:DevicesManagementApi.java

示例11: updateRuleAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Update Rule (asynchronously)
 * Update an existing Rule
 * @param ruleId Rule ID. (required)
 * @param ruleInfo Rule object that needs to be updated (required)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call updateRuleAsync(String ruleId, RuleUpdateInfo ruleInfo, final ApiCallback<RuleEnvelope> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = updateRuleValidateBeforeCall(ruleId, ruleInfo, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<RuleEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:36,代码来源:RulesApi.java

示例12: getMessagesAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get Messages (asynchronously)
 * Get Messages
 * @param notifId Notification ID. (required)
 * @param offset Offset for pagination. (optional)
 * @param count Desired count of items in the result set. (optional)
 * @param order Sort order of results by ts. Either &#39;asc&#39; or &#39;desc&#39;. (optional)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call getMessagesAsync(String notifId, Integer offset, Integer count, String order, final ApiCallback<NotifMessagesResponse> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = getMessagesValidateBeforeCall(notifId, offset, count, order, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<NotifMessagesResponse>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:38,代码来源:SubscriptionsApi.java

示例13: getMessageSnapshotsAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get Message Snapshots (asynchronously)
 * Get message snapshots.
 * @param sdids Device IDs for which the snapshots are requested. Max 100 device ids per call. (required)
 * @param includeTimestamp Indicates whether to return timestamps of the last update for each field. (optional)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call getMessageSnapshotsAsync(String sdids, Boolean includeTimestamp, final ApiCallback<SnapshotResponses> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = getMessageSnapshotsValidateBeforeCall(sdids, includeTimestamp, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<SnapshotResponses>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:36,代码来源:MessagesApi.java

示例14: sendMessageAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Send Message (asynchronously)
 * Send a message
 * @param data Message object that is passed in the body (required)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call sendMessageAsync(Message data, final ApiCallback<MessageIDEnvelope> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = sendMessageValidateBeforeCall(data, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<MessageIDEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:35,代码来源:MessagesApi.java

示例15: getTasksAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Returns the all the tasks for a device type. (asynchronously)
 * Returns the all the tasks for a device type.
 * @param dtid Device Type ID. (required)
 * @param count Max results count. (optional)
 * @param offset Result starting offset. (optional)
 * @param status Status filter. Comma-separated statuses. (optional)
 * @param order Sort results by a field. Valid fields: createdOn. (optional)
 * @param sort Sort order. Valid values: asc or desc. (optional)
 * @param callback The callback to be executed when the API call finishes
 * @return The request call
 * @throws ApiException If fail to process the API call, e.g. serializing the request body object
 */
public com.squareup.okhttp.Call getTasksAsync(String dtid, Integer count, Integer offset, String status, String order, String sort, final ApiCallback<TaskListEnvelope> callback) throws ApiException {

    ProgressResponseBody.ProgressListener progressListener = null;
    ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

    if (callback != null) {
        progressListener = new ProgressResponseBody.ProgressListener() {
            @Override
            public void update(long bytesRead, long contentLength, boolean done) {
                callback.onDownloadProgress(bytesRead, contentLength, done);
            }
        };

        progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
            @Override
            public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
                callback.onUploadProgress(bytesWritten, contentLength, done);
            }
        };
    }

    com.squareup.okhttp.Call call = getTasksValidateBeforeCall(dtid, count, offset, status, order, sort, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<TaskListEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:40,代码来源:DevicesManagementApi.java


注:本文中的cloud.artik.client.ApiCallback.onUploadProgress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。