public class ClientSession extends java.lang.Object implements JcmsRestConstants
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_REDIRECT |
static int |
NOFOLLOWREDIRECT_MAX_REDIRECT |
static java.lang.String |
REVISION |
CSRF_HEADER_NAME, HTTP_HEADERS, METHOD_OVERRIDE_HTTP_HEADER, UTS_ADMIN, UTS_CACHES, UTS_DATA_CHILDREN, UTS_DATA_PARAM, UTS_DATATYPE_ITEM, UTS_DATATYPE_LIST, UTS_JSYNC, UTS_JSYNC_REPLICA, UTS_LUCENE, UTS_LUCENE_CATEGORIES, UTS_LUCENE_PUBLICATIONS, UTS_MEMBER_ITEM, UTS_MEMBER_PHOTO_UPDATE, UTS_PRIVATE_RESOURCE, UTS_SEARCH, UTS_WHOAMI_ITEM, UTS_WORKFLOWS, UTS_WORKFLOWS_ITEM
Constructor and Description |
---|
ClientSession(java.lang.String baseUrl) |
Modifier and Type | Method and Description |
---|---|
RestQuery |
createQuery(org.restlet.data.Reference reference) |
RestQuery |
createQuery(java.lang.String resourcePath) |
JcmsResource |
findResource(org.restlet.data.Reference resourceRef) |
java.lang.String |
getBaseUrl() |
org.restlet.Client |
getClient()
Retrieve the underlying Restlet Client instance used for remote communication.
|
org.restlet.data.Reference |
getCreatedDataRef(JcmsResource response)
When a data is created (while using createData), the URI of the new data is given in the HTTP
response header "Location".
|
org.restlet.data.MediaType |
getDefaultMediaType() |
org.restlet.data.Request |
getFormMultipartRequest(org.restlet.data.Reference reference,
java.util.List<MultipartParameter> multipartContent)
Create a Request with Content-Type form-multipart and entity body compliant to
form-multipart specification, with content in the Map multipartContent.
|
JcmsResource |
getJcmsResource(org.restlet.data.Reference resourceRef,
Authentication forcedAuthentication) |
JcmsResource |
getJcmsResource(java.lang.String resourcePath,
Authentication forcedAuthentication) |
org.restlet.data.Reference |
getReference(java.lang.String uriRelativePath) |
org.restlet.data.Request |
getRequest(org.restlet.data.Reference reference,
org.restlet.data.Method method) |
java.lang.String |
getUserAgent() |
Authentication |
removeAuthentication()
Removes and returns the current authentication (null if none was added).
|
org.restlet.data.Response |
sendRequest(org.restlet.data.Reference reference,
org.restlet.data.Method method,
Authentication forcedAuthentication) |
org.restlet.data.Response |
sendRequest(org.restlet.data.Request request,
Authentication forcedAuthentication) |
org.restlet.data.Response |
sendRequest(org.restlet.data.Request request,
org.restlet.data.MediaType[] mediaTypes,
Authentication forcedAuthentication) |
org.restlet.data.Response |
sendRequest(org.restlet.data.Request request,
org.restlet.data.MediaType[] mediaTypes,
Authentication forcedAuthentication,
boolean noFollowRedirect) |
org.restlet.data.Response |
sendRequest(org.restlet.data.Request request,
org.restlet.data.MediaType[] mediaTypes,
Authentication forcedAuthentication,
int maxRedirect)
In the context of a client session (same cookies, same authentication), send
request to the server, including authentication and managing cookies.
|
org.restlet.data.Response |
sendRequest(org.restlet.data.Request request,
org.restlet.data.MediaType mediaType,
Authentication forcedAuthentication) |
org.restlet.data.Response |
sendRequest(org.restlet.data.Request request,
org.restlet.data.MediaType mediaType,
Authentication forcedAuthentication,
boolean noFollowRedirect) |
org.restlet.data.Response |
sendRequest(org.restlet.data.Request request,
org.restlet.data.MediaType mediaType,
Authentication forcedAuthentication,
int maxRedirect) |
void |
setAcceptLanguage(java.lang.String acceptLanguage) |
void |
setAuthentication(Authentication authentication)
Add an authentication to the session
|
void |
setCookies(org.restlet.data.Request request)
Cookies management : set cookies relative to the current client in the given request.
|
void |
setDefaultMediaType(org.restlet.data.MediaType defaultMediaType)
Modify the default media type manipulated in this session
|
void |
setUserAgent(java.lang.String userAgent) |
void |
storeCookies(org.restlet.util.Series<org.restlet.data.CookieSetting> cookiesSettings)
Cookies management : store cookies relative to the current client.
|
public static final java.lang.String REVISION
public static int DEFAULT_MAX_REDIRECT
public static int NOFOLLOWREDIRECT_MAX_REDIRECT
public org.restlet.Client getClient()
public org.restlet.data.MediaType getDefaultMediaType()
public void setDefaultMediaType(org.restlet.data.MediaType defaultMediaType)
defaultMediaType
- public void setAuthentication(Authentication authentication)
authentication
- the authentication to be addedpublic Authentication removeAuthentication()
public void storeCookies(org.restlet.util.Series<org.restlet.data.CookieSetting> cookiesSettings)
cookiesSettings
- public void setCookies(org.restlet.data.Request request)
request
- public org.restlet.data.Reference getReference(java.lang.String uriRelativePath)
uriRelativePath
- The uriRelativePath as given genericaly in OpenAPI, without the context path and the "rest" prefixpublic void setAcceptLanguage(java.lang.String acceptLanguage)
public org.restlet.data.Response sendRequest(org.restlet.data.Request request, org.restlet.data.MediaType[] mediaTypes, Authentication forcedAuthentication, int maxRedirect)
request
- the request to send (without authentication and cookies)mediaTypes
- accepted media type.forcedAuthentication
- the authentication for this request onlymaxRedirect
- the number of maximum redirection made if -1, redirect is not followedpublic org.restlet.data.Response sendRequest(org.restlet.data.Request request, org.restlet.data.MediaType mediaType, Authentication forcedAuthentication, int maxRedirect)
public org.restlet.data.Response sendRequest(org.restlet.data.Request request, org.restlet.data.MediaType[] mediaTypes, Authentication forcedAuthentication)
public org.restlet.data.Response sendRequest(org.restlet.data.Request request, org.restlet.data.MediaType mediaType, Authentication forcedAuthentication)
public org.restlet.data.Response sendRequest(org.restlet.data.Request request, Authentication forcedAuthentication)
public org.restlet.data.Response sendRequest(org.restlet.data.Reference reference, org.restlet.data.Method method, Authentication forcedAuthentication)
public org.restlet.data.Response sendRequest(org.restlet.data.Request request, org.restlet.data.MediaType[] mediaTypes, Authentication forcedAuthentication, boolean noFollowRedirect)
public org.restlet.data.Response sendRequest(org.restlet.data.Request request, org.restlet.data.MediaType mediaType, Authentication forcedAuthentication, boolean noFollowRedirect)
public org.restlet.data.Request getRequest(org.restlet.data.Reference reference, org.restlet.data.Method method)
public org.restlet.data.Request getFormMultipartRequest(org.restlet.data.Reference reference, java.util.List<MultipartParameter> multipartContent)
reference
- The reference of the requestmultipartContent
- the content of the form-multipart entity bodypublic java.lang.String getBaseUrl()
public JcmsResource findResource(org.restlet.data.Reference resourceRef)
public JcmsResource getJcmsResource(java.lang.String resourcePath, Authentication forcedAuthentication) throws RestException
RestException
public JcmsResource getJcmsResource(org.restlet.data.Reference resourceRef, Authentication forcedAuthentication) throws RestException
RestException
public RestQuery createQuery(java.lang.String resourcePath)
public RestQuery createQuery(org.restlet.data.Reference reference)
public org.restlet.data.Reference getCreatedDataRef(JcmsResource response)
response
- the response of the the createData requestpublic java.lang.String getUserAgent()
public void setUserAgent(java.lang.String userAgent)
Copyright © 2001-2021 Jalios SA. All Rights Reserved.