com.baidubce.services.bos.model
Class FetchObjectRequest

java.lang.Object
  extended by com.baidubce.model.AbstractBceRequest
      extended by com.baidubce.services.bos.model.GenericBucketRequest
          extended by com.baidubce.services.bos.model.GenericObjectRequest
              extended by com.baidubce.services.bos.model.FetchObjectRequest

public class FetchObjectRequest
extends GenericObjectRequest

Provides options for fetching an Baidu Bos object from url.

All FetchObjectRequest must specify a sourceUrl and mode, along with a destination bucket and key.


Field Summary
static String MODE_ASYNC
           
static String MODE_SYNC
           
 
Constructor Summary
FetchObjectRequest(String bucketName, String key, String sourceUrl)
          Constructs a new FetchObjectRequest with only basic options.
 
Method Summary
 String getMode()
          Gets the mode of this fetching job.
 String getSourceUrl()
          Gets the url string of the sourceUrl to be fetched.
 String getStorageClass()
          Gets the storageClass of the input file which is to be fetched to Baidu Bos.
 void setMode(String mode)
          Sets the mode of this fetching job.
 void setSourceUrl(String sourceUrl)
          Sets the url string of the sourceUrl to be fetched.
 void setStorageClass(String storageClass)
          Sets the storageClass of the input file which is to be fetched to Baidu Bos.
 FetchObjectRequest withBucketName(String bucketName)
          Sets the name of the destination bucket which will contain the new, fetched object and returns this object, enabling additional method calls to be chained together.
 FetchObjectRequest withKey(String key)
          Sets the destination bucket key under which the new, fetched object will be stored and returns this object, enabling additional method calls can be chained together.
 FetchObjectRequest withMode(String mode)
          Sets the mode of this fetching job, enabling additional method calls to be chained together.
 FetchObjectRequest withRequestCredentials(BceCredentials credentials)
           
 FetchObjectRequest withSourceUrl(String sourceUrl)
          Sets the url string of the sourceUrl to be fetched, and returns this object, enabling additional method calls to be chained together.
 FetchObjectRequest withStorageClass(String storageClass)
          Sets the storageClass of the input file which is to be fetched to Baidu Bos.
 
Methods inherited from class com.baidubce.services.bos.model.GenericObjectRequest
getKey, setKey
 
Methods inherited from class com.baidubce.services.bos.model.GenericBucketRequest
getBucketName, setBucketName
 
Methods inherited from class com.baidubce.model.AbstractBceRequest
getRequestCredentials, setRequestCredentials
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_SYNC

public static final String MODE_SYNC
See Also:
Constant Field Values

MODE_ASYNC

public static final String MODE_ASYNC
See Also:
Constant Field Values
Constructor Detail

FetchObjectRequest

public FetchObjectRequest(String bucketName,
                          String key,
                          String sourceUrl)
Constructs a new FetchObjectRequest with only basic options.

Parameters:
bucketName - The name of the Bos bucket to which the new object will be fetched.
key - The destination bucket key under which the new object will be fetched.
sourceUrl - The name of the Bos bucket containing the object to fetch.
Method Detail

getSourceUrl

public String getSourceUrl()
Gets the url string of the sourceUrl to be fetched.

Returns:
The url string of the sourceUrl to be fetched.

setSourceUrl

public void setSourceUrl(String sourceUrl)
Sets the url string of the sourceUrl to be fetched.

Parameters:
sourceUrl - The url string of the sourceUrl to be fetched.

withSourceUrl

public FetchObjectRequest withSourceUrl(String sourceUrl)
Sets the url string of the sourceUrl to be fetched, and returns this object, enabling additional method calls to be chained together.

Parameters:
sourceUrl - The url string of the sourceUrl to be fetched.
Returns:
This FetchObjectRequest instance, enabling additional method calls to be chained together.

getMode

public String getMode()
Gets the mode of this fetching job.

Returns:
The mode of this fetching job.

setMode

public void setMode(String mode)
Sets the mode of this fetching job.

Parameters:
mode - The mode of this fetching job.

withMode

public FetchObjectRequest withMode(String mode)
Sets the mode of this fetching job, enabling additional method calls to be chained together.

Parameters:
mode - The mode of this fetching job.
Returns:
This FetchObjectRequest instance, enabling additional method calls to be chained together.

withRequestCredentials

public FetchObjectRequest withRequestCredentials(BceCredentials credentials)
Specified by:
withRequestCredentials in class AbstractBceRequest

withBucketName

public FetchObjectRequest withBucketName(String bucketName)
Sets the name of the destination bucket which will contain the new, fetched object and returns this object, enabling additional method calls to be chained together.

Specified by:
withBucketName in class GenericBucketRequest
Parameters:
bucketName - The name of the destination bucket which will contain the new object of fetching job.
Returns:
This FetchObjectRequest, enabling additional method calls to be chained together.

withKey

public FetchObjectRequest withKey(String key)
Sets the destination bucket key under which the new, fetched object will be stored and returns this object, enabling additional method calls can be chained together.

Specified by:
withKey in class GenericObjectRequest
Parameters:
key - The destination bucket key under which the new, fetched object will be stored.
Returns:
This FetchObjectRequest, enabling additional method calls to be chained together.

getStorageClass

public String getStorageClass()
Gets the storageClass of the input file which is to be fetched to Baidu Bos.

Returns:
storageClass The storageClass is an identification that distinguish between infrequent access bos and standard bos.

setStorageClass

public void setStorageClass(String storageClass)
Sets the storageClass of the input file which is to be fetched to Baidu Bos.

Parameters:
storageClass - The storageClass is an identification that distinguish between infrequent access bos and standard bos.

withStorageClass

public FetchObjectRequest withStorageClass(String storageClass)
Sets the storageClass of the input file which is to be fetched to Baidu Bos.

Parameters:
storageClass - The StorageClass is an identification that distinguish between infrequent access bos and standard bos.
Returns:
This FetchObjectRequest, so that additional method calls can be chained together.


Copyright © 2018. All rights reserved.