public class ClientResource extends Resource
Resource.getRequest()
and
Resource.getResponse()
methods. Since a clientResource may receive
severals responses for a single request (in case of interim response), the
Resource.getResponse()
method returns the last received response object. The
Request object returned by the Resource.getRequest()
is actually a prototype
which is cloned (except the representation) just before the handle()
method is called.StringRepresentation
stored the entity in
memory which can be read several times but has the drawback to consume
memory.Client
class instead.Modifier | Constructor and Description |
---|---|
protected |
ClientResource()
Empty constructor.
|
|
ClientResource(ClientResource resource)
Constructor.
|
|
ClientResource(Context context,
Method method,
Reference reference)
Constructor.
|
|
ClientResource(Context context,
Method method,
java.lang.String uri)
Constructor.
|
|
ClientResource(Context context,
Method method,
java.net.URI uri)
Constructor.
|
|
ClientResource(Context context,
Reference reference)
Constructor.
|
|
ClientResource(Context context,
Request request)
Constructor.
|
|
ClientResource(Context context,
Request request,
Response response)
Constructor.
|
|
ClientResource(Context context,
java.lang.String uri)
Constructor.
|
|
ClientResource(Context context,
java.net.URI uri)
Constructor.
|
|
ClientResource(Method method,
Reference reference)
Constructor.
|
|
ClientResource(Method method,
java.lang.String uri)
Constructor.
|
|
ClientResource(Method method,
java.net.URI uri)
Constructor.
|
|
ClientResource(Reference reference)
Constructor.
|
|
ClientResource(Request request)
Constructor.
|
|
ClientResource(Request request,
Response response)
Constructor.
|
|
ClientResource(java.lang.String uri)
Constructor.
|
|
ClientResource(java.net.URI uri)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(Metadata... metadata)
Updates the client preferences to accept the given metadata (media types,
character sets, etc.) with a 1.0 quality in addition to existing ones.
|
void |
accept(Metadata metadata,
float quality)
Updates the client preferences to accept the given metadata (media types,
character sets, etc.) with a given quality in addition to existing ones.
|
Reference |
addQueryParameter(Parameter parameter)
Adds a parameter to the query component.
|
Reference |
addQueryParameter(java.lang.String name,
java.lang.String value)
Adds a parameter to the query component.
|
Reference |
addQueryParameters(java.lang.Iterable<Parameter> parameters)
Adds several parameters to the query component.
|
Reference |
addSegment(java.lang.String value)
Adds a segment at the end of the path.
|
static <T> T |
create(Context context,
Reference reference,
java.lang.Class<? extends T> resourceInterface)
Creates a client resource that proxy calls to the given Java interface
into Restlet method calls.
|
static <T> T |
create(Reference reference,
java.lang.Class<? extends T> resourceInterface)
Creates a client resource that proxy calls to the given Java interface
into Restlet method calls.
|
static <T> T |
create(java.lang.String uri,
java.lang.Class<? extends T> resourceInterface)
Creates a client resource that proxy calls to the given Java interface
into Restlet method calls.
|
protected Uniform |
createNext()
Creates a next Restlet is no one is set.
|
Request |
createRequest()
Creates a new request by cloning the one wrapped by this class.
|
protected Response |
createResponse(Request request)
Creates a new response for the given request.
|
Representation |
delete()
Deletes the target resource and all its representations.
|
<T> T |
delete(java.lang.Class<T> resultClass)
Deletes the target resource and all its representations.
|
Representation |
delete(MediaType mediaType)
Deletes the target resource and all its representations.
|
void |
doError(Request request,
Response response)
By default, it throws a new resource exception.
|
void |
doError(Status errorStatus)
By default, it throws a new resource exception.
|
void |
doError(Status errorStatus,
Request request,
Response response)
By default, it throws a new resource exception.
|
protected void |
doRelease()
Releases the resource by stopping any connector automatically created and
associated to the "next" property (see
getNext() method. |
protected void |
finalize()
Attempts to
Resource.release() the resource. |
Representation |
get()
Represents the resource using content negotiation to select the best
variant based on the client preferences.
|
<T> T |
get(java.lang.Class<T> resultClass)
Represents the resource in the given object class.
|
Representation |
get(MediaType mediaType)
Represents the resource using a given media type.
|
java.lang.String |
getAttribute(java.lang.String name)
Returns the attribute value by looking up the given name in the response
attributes maps.
|
ClientResource |
getChild(Reference relativeRef)
Returns the child resource defined by its URI relatively to the current
resource.
|
<T> T |
getChild(Reference relativeRef,
java.lang.Class<? extends T> resourceInterface)
Wraps the child client resource to proxy calls to the given Java
interface into Restlet method calls.
|
ClientResource |
getChild(java.lang.String relativeUri)
Returns the child resource defined by its URI relatively to the current
resource.
|
<T> T |
getChild(java.lang.String relativeUri,
java.lang.Class<? extends T> resourceInterface)
Wraps the child client resource to proxy calls to the given Java
interface into Restlet method calls.
|
int |
getMaxRedirects()
Returns the maximum number of redirections that can be automatically
followed for a single call.
|
Uniform |
getNext()
Returns the next Restlet.
|
Uniform |
getOnResponse()
Returns the callback invoked on response reception.
|
Uniform |
getOnSent()
Returns the callback invoked after sending the request.
|
ClientResource |
getParent()
Returns the parent resource.
|
<T> T |
getParent(java.lang.Class<? extends T> resourceInterface)
Wraps the parent client resource to proxy calls to the given Java
interface into Restlet method calls.
|
int |
getRetryAttempts()
Returns the number of retry attempts before reporting an error.
|
long |
getRetryDelay()
Returns the delay in milliseconds between two retry attempts.
|
Representation |
handle()
Handles the call by invoking the next handler.
|
protected Representation |
handle(Method method)
Handles the call by cloning the prototype request, setting the method and
entity.
|
protected <T> T |
handle(Method method,
java.lang.Class<T> resultClass)
Handles the call by cloning the prototype request, setting the method and
entity.
|
protected Representation |
handle(Method method,
MediaType mediaType)
Handles the call by cloning the prototype request, setting the method and
entity.
|
protected <T> T |
handle(Method method,
java.lang.Object entity,
java.lang.Class<T> resultClass)
Handles an object entity.
|
protected Representation |
handle(Method method,
Representation entity)
Handles the call by cloning the prototype request, setting the method and
entity.
|
protected Representation |
handle(Method method,
Representation entity,
ClientInfo clientInfo)
Handles the call by cloning the prototype request, setting the method and
entity.
|
protected Representation |
handle(Method method,
Representation entity,
MediaType mediaType)
Handles the call by cloning the prototype request, setting the method and
entity.
|
protected void |
handle(Request request,
Response response,
java.util.List<Reference> references,
int retryAttempt,
Uniform next)
Handle the call and follow redirection for safe methods.
|
Representation |
handleInbound(Response response)
Handles the inbound call.
|
Response |
handleOutbound(Request request)
Handles the outbound call by invoking the next handler.
|
boolean |
hasNext()
Indicates if there is a next Restlet.
|
Representation |
head()
Represents the resource using content negotiation to select the best
variant based on the client preferences.
|
Representation |
head(MediaType mediaType)
Represents the resource using a given media type.
|
boolean |
isFollowingRedirects()
Indicates if redirections are followed.
|
boolean |
isRequestEntityBuffering()
Indicates if transient or unknown size response entities should be
buffered after being received.
|
boolean |
isResponseEntityBuffering()
Indicates if transient or unknown size response entities should be
buffered after being received.
|
boolean |
isRetryOnError()
Indicates if idempotent requests should be retried on error.
|
Representation |
options()
Describes the resource using content negotiation to select the best
variant based on the client preferences.
|
<T> T |
options(java.lang.Class<T> resultClass)
Describes the resource using a given media type.
|
Representation |
options(MediaType mediaType)
Describes the resource using a given media type.
|
Representation |
patch(java.lang.Object entity)
Patches a resource with the given object as delta state.
|
<T> T |
patch(java.lang.Object entity,
java.lang.Class<T> resultClass)
Patches a resource with the given object as delta state.
|
Representation |
patch(java.lang.Object entity,
MediaType mediaType)
Patches a resource with the given object as delta state.
|
Representation |
patch(Representation entity)
Patches a resource with the given representation as delta state.
|
Representation |
post(java.lang.Object entity)
Posts an object entity.
|
<T> T |
post(java.lang.Object entity,
java.lang.Class<T> resultClass)
Posts an object entity.
|
Representation |
post(java.lang.Object entity,
MediaType mediaType)
Posts an object entity.
|
Representation |
post(Representation entity)
Posts a representation.
|
Representation |
put(java.lang.Object entity)
Puts an object entity.
|
<T> T |
put(java.lang.Object entity,
java.lang.Class<T> resultClass)
Puts an object entity.
|
Representation |
put(java.lang.Object entity,
MediaType mediaType)
Puts an object entity.
|
Representation |
put(Representation entity)
Creates or updates a resource with the given representation as new state
to be stored.
|
protected void |
redirect(Request request,
Response response,
java.util.List<Reference> references,
int retryAttempt,
Uniform next)
Effectively redirects a client call.
|
protected void |
retry(Request request,
Response response,
java.util.List<Reference> references,
int retryAttempt,
Uniform next)
Effectively retries a failed client call.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets the request attribute value.
|
void |
setChallengeResponse(ChallengeResponse challengeResponse)
Sets the authentication response sent by a client to an origin server.
|
void |
setChallengeResponse(ChallengeScheme scheme,
java.lang.String identifier,
java.lang.String secret)
Sets the authentication response sent by a client to an origin server
given a scheme, identifier and secret.
|
void |
setClientInfo(ClientInfo clientInfo)
Sets the client-specific information.
|
void |
setConditions(Conditions conditions)
Sets the conditions applying to this request.
|
void |
setCookies(Series<Cookie> cookies)
Sets the cookies provided by the client.
|
void |
setEntityBuffering(boolean entityBuffering)
Indicates if transient entities should be buffered after being received
or before being sent.
|
void |
setFollowingRedirects(boolean followingRedirects)
Indicates if redirections are followed.
|
void |
setHostRef(Reference hostRef)
Sets the host reference.
|
void |
setHostRef(java.lang.String hostUri)
Sets the host reference using an URI string.
|
void |
setLoggable(boolean loggable)
Indicates if the call is loggable
|
void |
setMaxRedirects(int maxRedirects)
Sets the maximum number of redirections that can be automatically
followed for a single call.
|
void |
setMethod(Method method)
Sets the method called.
|
void |
setNext(Uniform next)
Sets the next handler such as a Restlet or a Filter.
|
void |
setOnResponse(Uniform onResponseCallback)
Sets the callback invoked on response reception.
|
void |
setOnSent(Uniform onSentCallback)
Sets the callback invoked after sending the request.
|
void |
setOriginalRef(Reference originalRef)
Sets the original reference requested by the client.
|
void |
setProtocol(Protocol protocol)
Sets the protocol used or to be used.
|
void |
setProxyChallengeResponse(ChallengeResponse challengeResponse)
Sets the proxy authentication response sent by a client to an origin
server.
|
void |
setProxyChallengeResponse(ChallengeScheme scheme,
java.lang.String identifier,
java.lang.String secret)
Sets the proxy authentication response sent by a client to an origin
server given a scheme, identifier and secret.
|
void |
setRanges(java.util.List<Range> ranges)
Sets the ranges to return from the target resource's representation.
|
void |
setReference(Reference reference)
Sets the resource's reference.
|
void |
setReference(java.lang.String uri)
Sets the resource's reference using an URI string.
|
void |
setReferrerRef(Reference referrerRef)
Sets the referrer reference if available.
|
void |
setReferrerRef(java.lang.String referrerUri)
Sets the referrer reference if available using an URI string.
|
void |
setRequestEntityBuffering(boolean requestEntityBuffering)
Indicates if transient or unknown size response entities should be
buffered after being received.
|
void |
setResponseEntityBuffering(boolean responseEntityBuffering)
Indicates if transient or unknown size response entities should be
buffered after being received.
|
void |
setRetryAttempts(int retryAttempts)
Sets the number of retry attempts before reporting an error.
|
void |
setRetryDelay(long retryDelay)
Sets the delay in milliseconds between two retry attempts.
|
void |
setRetryOnError(boolean retryOnError)
Indicates if idempotent requests should be retried on error.
|
<T> T |
wrap(java.lang.Class<? extends T> resourceInterface)
Wraps the client resource to proxy calls to the given Java interface into
Restlet method calls.
|
<T> T |
wrap(java.lang.Class<? extends T> resourceInterface,
java.lang.ClassLoader classLoader)
Wraps the client resource to proxy calls to the given Java interface into
Restlet method calls.
|
doCatch, doError, doInit, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMatrixValue, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getProxyChallengeRequests, getProxyChallengeResponse, getQuery, getQueryValue, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setQueryValue, setRequest, setResponse, toBoolean, toByte, toDouble, toFloat, toInteger, toLong, toObject, toRepresentation, toRepresentation, toRepresentation, toShort, toString
protected ClientResource()
public ClientResource(ClientResource resource)
resource
- The client resource to copy.public ClientResource(Context context, java.net.URI uri)
context
- The context.uri
- The target URI.public ClientResource(Context context, Method method, java.net.URI uri)
context
- The context.method
- The method to call.uri
- The target URI.public ClientResource(Context context, Method method, Reference reference)
context
- The context.method
- The method to call.reference
- The target reference.public ClientResource(Context context, Method method, java.lang.String uri)
context
- The context.method
- The method to call.uri
- The target URI.public ClientResource(Context context, Reference reference)
context
- The context.reference
- The target reference.public ClientResource(Context context, Request request)
context
- The current context.request
- The handled request.public ClientResource(Context context, Request request, Response response)
context
- The current context.request
- The handled request.response
- The handled response.public ClientResource(Context context, java.lang.String uri)
context
- The context.uri
- The target URI.public ClientResource(java.net.URI uri)
uri
- The target URI.public ClientResource(Method method, java.net.URI uri)
method
- The method to call.uri
- The target URI.public ClientResource(Method method, Reference reference)
method
- The method to call.reference
- The target reference.public ClientResource(Method method, java.lang.String uri)
method
- The method to call.uri
- The target URI.public ClientResource(Reference reference)
reference
- The target reference.public ClientResource(Request request)
request
- The handled request.public ClientResource(Request request, Response response)
request
- The handled request.response
- The handled response.public ClientResource(java.lang.String uri)
uri
- The target URI.public static <T> T create(Context context, Reference reference, java.lang.Class<? extends T> resourceInterface)
ClientResource
and invokes the wrap(Class)
method.T
- context
- The context.reference
- The target reference.resourceInterface
- The annotated resource interface class to proxy.public static <T> T create(Reference reference, java.lang.Class<? extends T> resourceInterface)
ClientResource
and invokes the wrap(Class)
method.T
- resourceInterface
- The annotated resource interface class to proxy.public static <T> T create(java.lang.String uri, java.lang.Class<? extends T> resourceInterface)
ClientResource
and invokes the wrap(Class)
method.T
- uri
- The target URI.resourceInterface
- The annotated resource interface class to proxy.public void accept(Metadata... metadata)
metadata
- The metadata to accept.ClientInfo.accept(Metadata...)
public void accept(Metadata metadata, float quality)
metadata
- The metadata to accept.quality
- The quality to set.ClientInfo.accept(Metadata, float)
public Reference addQueryParameter(Parameter parameter)
parameter
- The parameter to add.Reference.addQueryParameter(Parameter)
public Reference addQueryParameter(java.lang.String name, java.lang.String value)
name
- The parameter name.value
- The optional parameter value.Reference.addQueryParameter(String, String)
public Reference addQueryParameters(java.lang.Iterable<Parameter> parameters)
parameters
- The parameters to add.Reference.addQueryParameters(Iterable)
public Reference addSegment(java.lang.String value)
value
- The segment value to add.Reference.addSegment(String)
protected Uniform createNext()
Client
based on the protocol of the resource's URI reference.public Request createRequest()
Resource.getRequest()
protected Response createResponse(Request request)
request
- The associated request.public Representation delete() throws ResourceException
ResourceException
public <T> T delete(java.lang.Class<T> resultClass) throws ResourceException
T
- The expected type for the response entity.resultClass
- The expected class for the response entity object.ResourceException
public Representation delete(MediaType mediaType) throws ResourceException
mediaType
- The media type of the representation to retrieve.ResourceException
public void doError(Request request, Response response)
doError(org.restlet.data.Status, org.restlet.Request, org.restlet.Response)
.request
- The associated request.response
- The associated response.public void doError(Status errorStatus)
doError(org.restlet.data.Status, org.restlet.Request, org.restlet.Response)
.public void doError(Status errorStatus, Request request, Response response)
errorStatus
- The error status received.request
- The associated request.response
- The associated response.protected void doRelease() throws ResourceException
getNext()
method.doRelease
in class Resource
ResourceException
Resource.release()
protected void finalize() throws java.lang.Throwable
Resource.release()
the resource.finalize
in class java.lang.Object
java.lang.Throwable
public Representation get() throws ResourceException
Resource.getClientInfo()
method.ResourceException
public <T> T get(java.lang.Class<T> resultClass) throws ResourceException
Resource.getClientInfo()
method.T
- The expected type for the response entity.resultClass
- The expected class for the response entity object.ResourceException
public Representation get(MediaType mediaType) throws ResourceException
Resource.getClientInfo()
method.mediaType
- The media type of the representation to retrieve.ResourceException
public java.lang.String getAttribute(java.lang.String name)
getAttribute
in class Resource
name
- The attribute name.public ClientResource getChild(Reference relativeRef) throws ResourceException
relativeRef
- The URI reference of the child resource relatively to the
current resource seen as the parent resource.ResourceException
public <T> T getChild(Reference relativeRef, java.lang.Class<? extends T> resourceInterface) throws ResourceException
T
- relativeRef
- The URI reference of the child resource relatively to the
current resource seen as the parent resource.resourceInterface
- The annotated resource interface class to proxy.ResourceException
public ClientResource getChild(java.lang.String relativeUri) throws ResourceException
relativeUri
- The URI of the child resource relatively to the current
resource seen as the parent resource.ResourceException
public <T> T getChild(java.lang.String relativeUri, java.lang.Class<? extends T> resourceInterface) throws ResourceException
T
- relativeUri
- The URI of the child resource relatively to the current
resource seen as the parent resource.resourceInterface
- The annotated resource interface class to proxy.ResourceException
public int getMaxRedirects()
public Uniform getNext()
public Uniform getOnResponse()
public Uniform getOnSent()
public ClientResource getParent() throws ResourceException
ResourceException
public <T> T getParent(java.lang.Class<? extends T> resourceInterface) throws ResourceException
T
- resourceInterface
- The annotated resource interface class to proxy.ResourceException
public int getRetryAttempts()
public long getRetryDelay()
public Representation handle()
Resource.getRequest()
and cloned and the response is set as
the latest with Resource.setResponse(Response)
. If necessary the
setNext(Uniform)
method is called as well with a Client
instance matching the request protocol.protected Representation handle(Method method)
method
- The request method to use.protected <T> T handle(Method method, java.lang.Class<T> resultClass) throws ResourceException
T
- The expected type for the response entity.method
- The request method to use.resultClass
- The expected class for the response entity object.ResourceException
protected Representation handle(Method method, MediaType mediaType)
method
- The request method to use.mediaType
- The preferred result media type.protected <T> T handle(Method method, java.lang.Object entity, java.lang.Class<T> resultClass) throws ResourceException
ConverterService
.method
- The request method to use.entity
- The object entity to post.resultClass
- The class of the response entity.ResourceException
protected Representation handle(Method method, Representation entity)
method
- The request method to use.entity
- The request entity to set.protected Representation handle(Method method, Representation entity, ClientInfo clientInfo)
method
- The request method to use.entity
- The request entity to set.clientInfo
- The client preferences.protected Representation handle(Method method, Representation entity, MediaType mediaType)
method
- The request method to use.entity
- The request entity to set.mediaType
- The preferred result media type.protected void handle(Request request, Response response, java.util.List<Reference> references, int retryAttempt, Uniform next)
request
- The request to send.response
- The response to update.references
- The references that caused a redirection to prevent infinite
loops.retryAttempt
- The number of remaining attempts.next
- The next handler handling the call.public Representation handleInbound(Response response)
response
- public Response handleOutbound(Request request)
request
- The request to handle.getNext()
public boolean hasNext()
public Representation head() throws ResourceException
get()
but doesn't return the actual content of the
representation, only its metadata.Resource.getClientInfo()
method.ResourceException
public Representation head(MediaType mediaType) throws ResourceException
get(MediaType)
but doesn't return the actual
content of the representation, only its metadata.Resource.getClientInfo()
method.mediaType
- The media type of the representation to retrieve.ResourceException
public boolean isFollowingRedirects()
public boolean isRequestEntityBuffering()
public boolean isResponseEntityBuffering()
public boolean isRetryOnError()
public Representation options() throws ResourceException
ResourceException
public <T> T options(java.lang.Class<T> resultClass) throws ResourceException
T
- The expected type for the response entity.resultClass
- The expected class for the response entity object.ResourceException
public Representation options(MediaType mediaType) throws ResourceException
mediaType
- The media type of the representation to retrieve.ResourceException
public Representation patch(java.lang.Object entity) throws ResourceException
ConverterService
.entity
- The object entity containing the patch.ResourceException
public <T> T patch(java.lang.Object entity, java.lang.Class<T> resultClass) throws ResourceException
ConverterService
.entity
- The object entity containing the patch.resultClass
- The class of the response entity.ResourceException
public Representation patch(java.lang.Object entity, MediaType mediaType) throws ResourceException
ConverterService
.entity
- The object entity containing the patch.mediaType
- The media type of the representation to retrieve.ResourceException
public Representation patch(Representation entity) throws ResourceException
entity
- The request entity containing the patch.ResourceException
public Representation post(java.lang.Object entity) throws ResourceException
ConverterService
.entity
- The object entity to post.ResourceException
public <T> T post(java.lang.Object entity, java.lang.Class<T> resultClass) throws ResourceException
ConverterService
.entity
- The object entity to post.resultClass
- The class of the response entity.ResourceException
public Representation post(java.lang.Object entity, MediaType mediaType) throws ResourceException
ConverterService
.entity
- The object entity to post.mediaType
- The media type of the representation to retrieve.ResourceException
public Representation post(Representation entity) throws ResourceException
entity
- The posted entity.ResourceException
public Representation put(java.lang.Object entity) throws ResourceException
ConverterService
.entity
- The object entity to put.ResourceException
public <T> T put(java.lang.Object entity, java.lang.Class<T> resultClass) throws ResourceException
ConverterService
.entity
- The object entity to put.resultClass
- The class of the response entity.ResourceException
public Representation put(java.lang.Object entity, MediaType mediaType) throws ResourceException
ConverterService
.entity
- The object entity to post.mediaType
- The media type of the representation to retrieve.ResourceException
public Representation put(Representation entity) throws ResourceException
entity
- The request entity to store.ResourceException
protected void redirect(Request request, Response response, java.util.List<Reference> references, int retryAttempt, Uniform next)
handle(Request, Response, List, int, Uniform)
method invoked.request
- The request to send.response
- The response to update.references
- The references that caused a redirection to prevent infinite
loops.retryAttempt
- The number of remaining attempts.next
- The next handler handling the call.protected void retry(Request request, Response response, java.util.List<Reference> references, int retryAttempt, Uniform next)
request
- The request to send.response
- The response to update.references
- The references that caused a redirection to prevent infinite
loops.retryAttempt
- The number of remaining attempts.next
- The next handler handling the call.public void setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in class Resource
name
- The attribute name.value
- The attribute to set.public void setChallengeResponse(ChallengeResponse challengeResponse)
challengeResponse
- The authentication response sent by a client to an origin
server.Request.setChallengeResponse(ChallengeResponse)
public void setChallengeResponse(ChallengeScheme scheme, java.lang.String identifier, java.lang.String secret)
scheme
- The challenge scheme.identifier
- The user identifier, such as a login name or an access key.secret
- The user secret, such as a password or a secret key.public void setClientInfo(ClientInfo clientInfo)
clientInfo
- The client-specific information.Request.setClientInfo(ClientInfo)
public void setConditions(Conditions conditions)
conditions
- The conditions applying to this request.Request.setConditions(Conditions)
public void setCookies(Series<Cookie> cookies)
cookies
- The cookies provided by the client.Request.setCookies(Series)
public void setEntityBuffering(boolean entityBuffering)
entityBuffering
- True if transient entities should be buffered.setRequestEntityBuffering(boolean)
,
setResponseEntityBuffering(boolean)
public void setFollowingRedirects(boolean followingRedirects)
followingRedirects
- True if redirections are followed.public void setHostRef(Reference hostRef)
hostRef
- The host reference.Request.setHostRef(Reference)
public void setHostRef(java.lang.String hostUri)
hostUri
- The host URI.Request.setHostRef(String)
public void setLoggable(boolean loggable)
loggable
- True if the call is loggablepublic void setMaxRedirects(int maxRedirects)
maxRedirects
- The maximum number of redirections that can be automatically
followed for a single call.public void setMethod(Method method)
method
- The method called.Request.setMethod(Method)
public void setNext(Uniform next)
next
- The next handler.public void setOnResponse(Uniform onResponseCallback)
onResponseCallback
- The callback invoked on response reception.public void setOnSent(Uniform onSentCallback)
onSentCallback
- The callback invoked after sending the request.public void setOriginalRef(Reference originalRef)
originalRef
- The original reference.Request.setOriginalRef(Reference)
public void setProtocol(Protocol protocol)
protocol
- The protocol used or to be used.public void setProxyChallengeResponse(ChallengeResponse challengeResponse)
challengeResponse
- The proxy authentication response sent by a client to an
origin server.Request.setProxyChallengeResponse(ChallengeResponse)
public void setProxyChallengeResponse(ChallengeScheme scheme, java.lang.String identifier, java.lang.String secret)
scheme
- The challenge scheme.identifier
- The user identifier, such as a login name or an access key.secret
- The user secret, such as a password or a secret key.public void setRanges(java.util.List<Range> ranges)
ranges
- The ranges.Request.setRanges(List)
public void setReference(Reference reference)
reference
- The resource reference.Request.setResourceRef(Reference)
public void setReference(java.lang.String uri)
uri
- The resource URI.Request.setResourceRef(String)
public void setReferrerRef(Reference referrerRef)
referrerRef
- The referrer reference.Request.setReferrerRef(Reference)
public void setReferrerRef(java.lang.String referrerUri)
referrerUri
- The referrer URI.Request.setReferrerRef(String)
public void setRequestEntityBuffering(boolean requestEntityBuffering)
requestEntityBuffering
- True if transient request entities should be buffered after
being received.public void setResponseEntityBuffering(boolean responseEntityBuffering)
responseEntityBuffering
- True if transient response entities should be buffered after
being received.public void setRetryAttempts(int retryAttempts)
retryAttempts
- The number of retry attempts before reporting an error.public void setRetryDelay(long retryDelay)
retryDelay
- The delay in milliseconds between two retry attempts.public void setRetryOnError(boolean retryOnError)
retryOnError
- True if idempotent requests should be retried on error.public <T> T wrap(java.lang.Class<? extends T> resourceInterface)
Engine
classloader in order to generate the proxy.T
- resourceInterface
- The annotated resource interface class to proxy.public <T> T wrap(java.lang.Class<? extends T> resourceInterface, java.lang.ClassLoader classLoader)
T
- resourceInterface
- The annotated resource interface class to proxy.classLoader
- The classloader used to instantiate the dynamic proxy.Copyright © 2005-2024 Restlet.