public class CosServiceRequest extends Object implements Cloneable, ReadLimitInfo
Constructor and Description |
---|
CosServiceRequest() |
Modifier and Type | Method and Description |
---|---|
CosServiceRequest |
clone()
Creates a shallow clone of this object for all fields except the handler context.
|
protected <T extends CosServiceRequest> |
copyBaseTo(T target)
Copies the internal state of this base class to that of the target request.
|
String |
getCiSpecialEndParameter() |
CosServiceRequest |
getCloneRoot()
Returns the root object from which the current object was cloned; or null if there isn't one.
|
CosServiceRequest |
getCloneSource()
Returns the source object from which the current object was cloned; or null if there isn't
one.
|
COSCredentials |
getCosCredentials() |
Map<String,List<String>> |
getCustomQueryParameters() |
Map<String,String> |
getCustomRequestHeaders()
Returns an immutable map of custom header names to header values.
|
String |
getFixedEndpointAddr()
Returns the setted server ip and port.
|
ProgressListener |
getGeneralProgressListener()
Returns the optional progress listener for receiving updates about the progress of the
request.
|
int |
getReadLimit()
Returns the read limit for mark-and-reset during retries; or -1 if not
available.
|
RequestClientOptions |
getRequestClientOptions()
Gets the options stored with this request object.
|
void |
putCustomQueryParameter(String name,
String value)
Add a custom query parameter for the request.
|
String |
putCustomRequestHeader(String name,
String value)
Put a new custom header to the map of custom header names to custom header values, and return
the previous value if the header has already been set in this map.
|
void |
setCiSpecialEndParameter(String ciSpecialEndParameter) |
void |
setCosCredentials(COSCredentials cosCredentials) |
void |
setFixedEndpointAddr(String fixedEndpointAddr)
Sets the cos server ip and port .
|
void |
setGeneralProgressListener(ProgressListener progressListener)
Sets the optional progress listener for receiving updates about the progress of the request.
|
<T extends CosServiceRequest> |
withGeneralProgressListener(ProgressListener progressListener)
Sets the optional progress listener for receiving updates about the progress of the request,
and returns a reference to this object so that method calls can be chained together.
|
public void setGeneralProgressListener(ProgressListener progressListener)
progressListener
- The new progress listener.public ProgressListener getGeneralProgressListener()
public void setFixedEndpointAddr(String fixedEndpointAddr)
fixedEndpointAddr
- ip and port string, format is ip:portpublic String getFixedEndpointAddr()
public <T extends CosServiceRequest> T withGeneralProgressListener(ProgressListener progressListener)
progressListener
- The new progress listener.public Map<String,String> getCustomRequestHeaders()
public String putCustomRequestHeader(String name, String value)
NOTE: Custom header values set via this method will overwrite any conflicting values coming from the request parameters.
name
- The name of the header to addvalue
- The value of the header to addpublic Map<String,List<String>> getCustomQueryParameters()
public void putCustomQueryParameter(String name, String value)
name
- The name of the query parametervalue
- The value of the query parameter. Only the parameter name will be added in the URI
if the value is set to null. For example, putCustomQueryParameter("param", null)
will be serialized to "?param", while putCustomQueryParameter("param", "") will be
serialized to "?param=".public RequestClientOptions getRequestClientOptions()
protected final <T extends CosServiceRequest> T copyBaseTo(T target)
public int getReadLimit()
ReadLimitInfo
getReadLimit
in interface ReadLimitInfo
public CosServiceRequest getCloneSource()
public CosServiceRequest getCloneRoot()
public CosServiceRequest clone()
clone
in class Object
Object.clone()
public COSCredentials getCosCredentials()
public void setCosCredentials(COSCredentials cosCredentials)
public String getCiSpecialEndParameter()
public void setCiSpecialEndParameter(String ciSpecialEndParameter)
Copyright © 2023. All rights reserved.