public abstract class COSTransferTask
extends java.lang.Object
Created by rickenwang on 2021/6/30. Copyright 2010-2021 Tencent Cloud. All Rights Reserved.
限定符和类型 | 类和说明 |
---|---|
protected static class |
COSTransferTask.TaskThreadFactory |
限定符和类型 | 字段和说明 |
---|---|
protected java.lang.String |
bucket |
protected CosXmlClientException |
clientException |
protected COSDirect |
cosDirect |
protected CosXmlProgressListener |
cosXmlProgressListener |
protected CosXmlRequest |
cosXmlRequest |
protected CosXmlResult |
cosXmlResult |
protected CosXmlResultListener |
cosXmlResultListener |
protected CosXmlServiceConfig |
cosXmlServiceConfig |
protected CryptoModuleBase |
cryptoModuleBase |
protected java.lang.String |
key |
protected boolean |
manualCancel |
protected boolean |
manualPause |
protected bolts.CancellationTokenSource |
mTransferTaskCts |
protected java.lang.String |
region |
protected CosXmlServiceException |
serviceException |
protected java.lang.String |
taskId |
protected TransferStateListener |
transferStateListener |
protected TransferTaskMetrics |
transferTaskMetrics
任务运行的整体情况
|
限定符和类型 | 方法和说明 |
---|---|
void |
cancel()
取消传输,如果是分片上传会调用 abort 接口
|
protected void |
checking()
检查传输参数,并计算额外参数
|
protected abstract CosXmlResult |
execute()
执行上传任务
|
protected abstract java.util.concurrent.Executor |
executor() |
CosXmlClientException |
getClientException() |
CosXmlServiceException |
getServiceException() |
TransferState |
getTaskState() |
TransferTaskMetrics |
getTransferTaskMetrics()
获得本次传输的运行信息
|
protected boolean |
isManualCanceled() |
protected boolean |
isManualPaused() |
protected static void |
loggerInfo(java.lang.String tag,
java.lang.String taskId,
java.lang.String format,
java.lang.Object... params) |
protected static void |
loggerWarn(java.lang.String tag,
java.lang.String taskId,
java.lang.String format,
java.lang.Object... params) |
protected void |
onTransferFailed(CosXmlRequest cosXmlRequest,
CosXmlClientException clientException,
CosXmlServiceException serviceException) |
protected void |
onTransferInProgress() |
protected void |
onTransferPaused() |
protected void |
onTransferProgressChange(long complete,
long target) |
protected void |
onTransferSuccess(CosXmlRequest cosXmlRequest,
CosXmlResult cosXmlResult) |
protected void |
onTransferWaiting() |
void |
pause()
暂停传输
|
void |
resume()
恢复传输
|
void |
setCosXmlProgressListener(CosXmlProgressListener cosXmlProgressListener) |
void |
setCosXmlResultListener(CosXmlResultListener cosXmlResultListener) |
void |
setTransferStateListener(TransferStateListener transferStateListener) |
protected void |
start()
开始传输,内部调用
|
protected abstract java.lang.String |
tag() |
protected java.lang.String region
protected java.lang.String bucket
protected java.lang.String key
protected CosXmlProgressListener cosXmlProgressListener
protected CosXmlResultListener cosXmlResultListener
protected TransferStateListener transferStateListener
protected CosXmlRequest cosXmlRequest
protected CosXmlResult cosXmlResult
protected CosXmlClientException clientException
protected CosXmlServiceException serviceException
protected volatile TransferTaskMetrics transferTaskMetrics
protected volatile java.lang.String taskId
protected volatile boolean manualPause
protected volatile boolean manualCancel
protected volatile bolts.CancellationTokenSource mTransferTaskCts
protected CosXmlServiceConfig cosXmlServiceConfig
protected COSDirect cosDirect
protected CryptoModuleBase cryptoModuleBase
public void setCosXmlResultListener(CosXmlResultListener cosXmlResultListener)
public void setTransferStateListener(TransferStateListener transferStateListener)
public void setCosXmlProgressListener(CosXmlProgressListener cosXmlProgressListener)
protected void start()
public void pause()
public void resume()
public void cancel()
public TransferTaskMetrics getTransferTaskMetrics()
protected abstract java.lang.String tag()
protected abstract java.util.concurrent.Executor executor()
protected abstract CosXmlResult execute() throws java.lang.Exception
java.lang.Exception
protected void checking() throws CosXmlClientException
public TransferState getTaskState()
protected void onTransferWaiting()
protected void onTransferInProgress()
protected void onTransferPaused()
protected void onTransferSuccess(CosXmlRequest cosXmlRequest, CosXmlResult cosXmlResult)
protected void onTransferFailed(CosXmlRequest cosXmlRequest, CosXmlClientException clientException, CosXmlServiceException serviceException)
protected void onTransferProgressChange(long complete, long target)
protected boolean isManualPaused()
protected boolean isManualCanceled()
public CosXmlClientException getClientException()
public CosXmlServiceException getServiceException()
protected static void loggerInfo(java.lang.String tag, java.lang.String taskId, java.lang.String format, java.lang.Object... params)
protected static void loggerWarn(java.lang.String tag, java.lang.String taskId, java.lang.String format, java.lang.Object... params)