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


Java ApiCallback.onDownloadProgress方法代码示例

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


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

示例1: addDeviceAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Add Device (asynchronously)
 * Create a device
 * @param device Device to be added to the user (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 addDeviceAsync(Device device, final ApiCallback<DeviceEnvelope> 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 = addDeviceValidateBeforeCall(device, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<DeviceEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:35,代码来源:DevicesApi.java

示例2: getManifestPropertiesAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get manifest properties (asynchronously)
 * Get a Device Type&#39;s manifest properties for a specific version.
 * @param deviceTypeId Device Type ID. (required)
 * @param version Manifest Version. (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 getManifestPropertiesAsync(String deviceTypeId, String version, final ApiCallback<ManifestPropertiesEnvelope> 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 = getManifestPropertiesValidateBeforeCall(deviceTypeId, version, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ManifestPropertiesEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:36,代码来源:DeviceTypesApi.java

示例3: exportRequestAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Create Export Request (asynchronously)
 * Export normalized messages. The following input combinations are supported:&lt;br/&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt;Combination&lt;/th&gt;&lt;th&gt;Parameters&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Get by users&lt;/td&gt;&lt;td&gt;uids&lt;/td&gt;&lt;td&gt;Search by a list of User IDs. For each user in the list, the current authenticated user must have read access over the specified user.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Get by devices&lt;/td&gt;&lt;td&gt;sdids&lt;/td&gt;&lt;td&gt;Search by Source Device IDs.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Get by device types&lt;/td&gt;&lt;td&gt;uids,sdtids&lt;/td&gt;&lt;td&gt;Search by list of Source Device Type IDs for the given list of users.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Get by trial&lt;/td&gt;&lt;td&gt;trialId&lt;/td&gt;&lt;td&gt;Search by Trial ID.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Get by combination of parameters&lt;/td&gt;&lt;td&gt;uids,sdids,sdtids&lt;/td&gt;&lt;td&gt;Search by list of Source Device IDs. Each Device ID must belong to a Source Device Type ID and a User ID.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Common&lt;/td&gt;&lt;td&gt;startDate,endDate,order,format,url,csvHeaders&lt;/td&gt;&lt;td&gt;Parameters that can be used with the above combinations.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
 * @param exportRequestInfo ExportRequest 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 exportRequestAsync(ExportRequestInfo exportRequestInfo, final ApiCallback<ExportRequestResponse> 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 = exportRequestValidateBeforeCall(exportRequestInfo, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ExportRequestResponse>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:35,代码来源:ExportApi.java

示例4: getDeviceAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get Device (asynchronously)
 * Retrieves a device
 * @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 getDeviceAsync(String deviceId, final ApiCallback<DeviceEnvelope> 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 = getDeviceValidateBeforeCall(deviceId, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<DeviceEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:35,代码来源:DevicesApi.java

示例5: getDevicePresenceAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get device presence information (asynchronously)
 * Return the presence status of the given device along with the time it was last seen
 * @param deviceId 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 getDevicePresenceAsync(String deviceId, final ApiCallback<PresenceEnvelope> 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 = getDevicePresenceValidateBeforeCall(deviceId, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<PresenceEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:35,代码来源:DevicesApi.java

示例6: getDeviceTypesAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get Device Types (asynchronously)
 * Retrieves Device Types
 * @param name Device Type name (required)
 * @param offset Offset for pagination. (optional)
 * @param count Desired count of items in the result set (optional)
 * @param tags Elements tagged with the list of tags. (comma separated) (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 getDeviceTypesAsync(String name, Integer offset, Integer count, String tags, final ApiCallback<DeviceTypesEnvelope> 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 = getDeviceTypesValidateBeforeCall(name, offset, count, tags, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<DeviceTypesEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:38,代码来源:DeviceTypesApi.java

示例7: getUserRulesAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get User Rules (asynchronously)
 * Retrieve User&#39;s Rules
 * @param userId User ID. (required)
 * @param excludeDisabled Exclude disabled rules in the result. (optional)
 * @param count Desired count of items in the result set. (optional)
 * @param offset Offset for pagination. (optional)
 * @param owner Rule owner (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 getUserRulesAsync(String userId, Boolean excludeDisabled, Integer count, Integer offset, String owner, final ApiCallback<RulesEnvelope> 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 = getUserRulesValidateBeforeCall(userId, excludeDisabled, count, offset, owner, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<RulesEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:39,代码来源:UsersApi.java

示例8: deleteVdidAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Delete a vdid from the devicetype whitelist. (asynchronously)
 * Delete a vdid from the devicetype whitelist.
 * @param dtid Device Type ID. (required)
 * @param vdid Vendor 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 deleteVdidAsync(String dtid, String vdid, final ApiCallback<WhitelistEnvelope> 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 = deleteVdidValidateBeforeCall(dtid, vdid, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<WhitelistEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:36,代码来源:WhitelistingApi.java

示例9: getDevicesStatusAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get Devices Status (asynchronously)
 * Get Devices Status
 * @param dids List of device ids (comma-separated) for which the statuses are requested. (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 getDevicesStatusAsync(String dids, Boolean includeSnapshot, Boolean includeSnapshotTimestamp, final ApiCallback<DeviceStatusBatch> 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 = getDevicesStatusValidateBeforeCall(dids, includeSnapshot, includeSnapshotTimestamp, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<DeviceStatusBatch>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:37,代码来源:DevicesStatusApi.java

示例10: getExportHistoryAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get Export History (asynchronously)
 * Get the history of export requests.
 * @param trialId Filter by trialId. (optional)
 * @param count Pagination count. (optional)
 * @param offset Pagination offset. (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 getExportHistoryAsync(String trialId, Integer count, Integer offset, final ApiCallback<ExportHistoryResponse> 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 = getExportHistoryValidateBeforeCall(trialId, count, offset, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<ExportHistoryResponse>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:37,代码来源:ExportApi.java

示例11: getRequestStatusForUserAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get Request Status For User (asynchronously)
 * This call checks the status of the request so users can poll and know when registration is complete.
 * @param requestId Request 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 getRequestStatusForUserAsync(String requestId, final ApiCallback<DeviceRegStatusResponseEnvelope> 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 = getRequestStatusForUserValidateBeforeCall(requestId, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<DeviceRegStatusResponseEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:35,代码来源:RegistrationsApi.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: getStatusesAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Returns the details and status of a task id and the individual statuses of each device id in the list. (asynchronously)
 * Returns the details and status of a task id and the individual statuses of each device id in the list.
 * @param tid Task ID. (required)
 * @param count Max results count. (optional)
 * @param offset Result starting offset. (optional)
 * @param status Status filter. Comma-separated statuses. (optional)
 * @param dids Devices filter. Comma-separated device IDs. (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 getStatusesAsync(String tid, Integer count, Integer offset, String status, String dids, final ApiCallback<TaskStatusesEnvelope> 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 = getStatusesValidateBeforeCall(tid, count, offset, status, dids, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<TaskStatusesEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:39,代码来源:DevicesManagementApi.java

示例14: 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

示例15: getUploadStatusAsync

import cloud.artik.client.ApiCallback; //导入方法依赖的package包/类
/**
 * Get the status of a uploaded CSV file. (asynchronously)
 * Get the status of a uploaded CSV file.
 * @param dtid Device type id related to the uploaded CSV file. (required)
 * @param uploadId Upload id related to the uploaded CSV file. (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 getUploadStatusAsync(String dtid, String uploadId, final ApiCallback<UploadStatusEnvelope> 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 = getUploadStatusValidateBeforeCall(dtid, uploadId, progressListener, progressRequestListener);
    Type localVarReturnType = new TypeToken<UploadStatusEnvelope>(){}.getType();
    apiClient.executeAsync(call, localVarReturnType, callback);
    return call;
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:36,代码来源:WhitelistingApi.java


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