public abstract class COSXMLTask
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static interface |
COSXMLTask.OnGetHttpTaskMetrics |
static interface |
COSXMLTask.OnSignatureListener
已过时。
|
限定符和类型 | 字段和说明 |
---|---|
protected java.lang.String |
bucket
存储桶
|
protected java.lang.String |
cosPath
对象cos路径
|
protected CosXmlProgressListener |
cosXmlProgressListener
进度回调监听器
|
protected CosXmlResultListener |
cosXmlResultListener
结果回调监听器
|
protected CosXmlSimpleService |
cosXmlService
Tencent Cloud COS服务
|
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
headers
header 属性
|
protected InitMultipleUploadListener |
initMultipleUploadListener
初始化分块上传监听器
|
protected InitMultipleUploadListener |
internalInitMultipleUploadListener |
protected CosXmlProgressListener |
internalProgressListener |
protected TransferStateListener |
internalStateListener |
protected java.util.concurrent.atomic.AtomicBoolean |
IS_EXIT
退出:pause, cancel, failed
|
protected boolean |
isNeedMd5
是否需要计算 MD5
|
protected java.lang.Exception |
mException
需要抛出的异常
|
protected static com.tencent.cos.xml.transfer.TaskStateMonitor |
monitor
状态监听器
|
protected CosXmlResult |
mResult
返回结果
|
protected COSXMLTask.OnGetHttpTaskMetrics |
onGetHttpTaskMetrics
获取 http metrics
|
protected COSXMLTask.OnSignatureListener |
onSignatureListener
直接提供签名串
|
protected java.util.Map<java.lang.String,java.lang.String> |
queries
url query 属性
|
protected java.lang.String |
region
区域
|
protected TransferStateListener |
transferStateListener
状态监听器
|
protected java.util.Timer |
waitTimeoutTimer |
构造器和说明 |
---|
COSXMLTask() |
限定符和类型 | 方法和说明 |
---|---|
protected abstract CosXmlRequest |
buildCOSXMLTaskRequest()
构造COSXMLTask返回的Request
|
protected abstract CosXmlResult |
buildCOSXMLTaskResult(CosXmlResult sourceResult)
构造COSXMLTask返回的Result
|
void |
cancel()
取消任务
|
void |
clearResultAndException() |
protected abstract void |
encounterError(CosXmlRequest cosXmlRequest,
CosXmlClientException clientException,
CosXmlServiceException serviceException) |
java.lang.Exception |
getException()
获取需要抛出的异常
|
protected void |
getHttpMetrics(CosXmlRequest cosXmlRequest,
java.lang.String requestName) |
CosXmlResult |
getResult()
获取返回结果
|
TransferState |
getTaskState()
获取任务状态
|
protected void |
internalCancel() |
protected void |
internalCompleted() |
protected void |
internalFailed() |
protected void |
internalPause() |
protected void |
internalResume() |
void |
pause()
暂停任务,若是
COSXMLUploadTask 请调用 COSXMLUploadTask.pauseSafely() 接口来暂停。 |
void |
resume()
恢复任务
|
void |
setCosXmlProgressListener(CosXmlProgressListener cosXmlProgressListener)
设置进度回调监听器
|
void |
setCosXmlResultListener(CosXmlResultListener cosXmlResultListener)
设置结果回调监听器
|
protected void |
setCosXmlService(CosXmlSimpleService cosXmlService)
设置COS服务
|
void |
setInitMultipleUploadListener(InitMultipleUploadListener initMultipleUploadListener)
设置初始化分块上传监听器
|
void |
setOnGetHttpTaskMetrics(COSXMLTask.OnGetHttpTaskMetrics onGetHttpTaskMetrics) |
void |
setOnSignatureListener(COSXMLTask.OnSignatureListener onSignatureListener) |
void |
setTransferStateListener(TransferStateListener transferStateListener)
设置状态监听器
|
void |
startTimeoutTimer(long millisecond) |
protected void |
updateState(TransferState newTaskState,
java.lang.Exception exception,
CosXmlResult result,
boolean isInit)
更新状态
waiting: 准备状态, 任何状态都可以转为它, task 准备执行.
|
protected static com.tencent.cos.xml.transfer.TaskStateMonitor monitor
protected CosXmlSimpleService cosXmlService
protected java.lang.String region
protected java.lang.String bucket
protected java.lang.String cosPath
protected CosXmlResult mResult
protected java.lang.Exception mException
protected java.util.Map<java.lang.String,java.lang.String> queries
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers
protected boolean isNeedMd5
protected CosXmlProgressListener cosXmlProgressListener
protected CosXmlResultListener cosXmlResultListener
protected TransferStateListener transferStateListener
protected InitMultipleUploadListener initMultipleUploadListener
protected TransferStateListener internalStateListener
protected CosXmlProgressListener internalProgressListener
protected InitMultipleUploadListener internalInitMultipleUploadListener
protected java.util.concurrent.atomic.AtomicBoolean IS_EXIT
protected COSXMLTask.OnSignatureListener onSignatureListener
protected COSXMLTask.OnGetHttpTaskMetrics onGetHttpTaskMetrics
protected java.util.Timer waitTimeoutTimer
protected void setCosXmlService(CosXmlSimpleService cosXmlService)
cosXmlService
- COS服务类public void setCosXmlProgressListener(CosXmlProgressListener cosXmlProgressListener)
cosXmlProgressListener
- 进度回调监听器public void setCosXmlResultListener(CosXmlResultListener cosXmlResultListener)
cosXmlResultListener
- 结果回调监听器public void setTransferStateListener(TransferStateListener transferStateListener)
transferStateListener
- 状态监听器public void setInitMultipleUploadListener(InitMultipleUploadListener initMultipleUploadListener)
initMultipleUploadListener
- 初始化分块上传监听器public void setOnSignatureListener(COSXMLTask.OnSignatureListener onSignatureListener)
public void setOnGetHttpTaskMetrics(COSXMLTask.OnGetHttpTaskMetrics onGetHttpTaskMetrics)
protected void getHttpMetrics(CosXmlRequest cosXmlRequest, java.lang.String requestName)
public void startTimeoutTimer(long millisecond)
protected void internalCompleted()
protected void internalFailed()
protected void internalPause()
protected void internalCancel()
protected void internalResume()
protected abstract void encounterError(@Nullable CosXmlRequest cosXmlRequest, CosXmlClientException clientException, CosXmlServiceException serviceException)
public void pause()
COSXMLUploadTask
请调用 COSXMLUploadTask.pauseSafely()
接口来暂停。public void cancel()
public void resume()
public TransferState getTaskState()
public CosXmlResult getResult()
public java.lang.Exception getException()
protected abstract CosXmlRequest buildCOSXMLTaskRequest()
public void clearResultAndException()
protected abstract CosXmlResult buildCOSXMLTaskResult(CosXmlResult sourceResult)
sourceResult
- 原始CosXmlResultprotected void updateState(TransferState newTaskState, java.lang.Exception exception, CosXmlResult result, boolean isInit)
newTaskState
- new state for operating