public class SyncopeClient extends Object
SyncopeClientFactoryBean.| Constructor and Description |
|---|
SyncopeClient(javax.ws.rs.core.MediaType mediaType,
org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean restClientFactory,
RestClientExceptionMapper exceptionMapper,
AuthenticationHandler handler,
boolean useCompression,
org.apache.cxf.configuration.jsse.TLSClientParameters tlsClientParameters) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanup() |
static org.apache.syncope.common.lib.search.AnyObjectFiqlSearchConditionBuilder |
getAnyObjectSearchConditionBuilder(String type)
Returns a new instance of
AnyObjectFiqlSearchConditionBuilder, for assisted building of FIQL queries. |
String |
getDomain()
Returns the domain configured for this instance, or
SyncopeConstants.MASTER_DOMAIN if not set. |
static org.apache.syncope.common.lib.search.GroupFiqlSearchConditionBuilder |
getGroupSearchConditionBuilder()
Returns a new instance of
GroupFiqlSearchConditionBuilder, for assisted building of FIQL queries. |
String |
getJWT()
Returns the JWT in used by this instance, passed with the
HttpHeaders.AUTHORIZATION header
in all requests. |
<T> javax.ws.rs.core.EntityTag |
getLatestEntityTag(T service)
Fetches
ETag header value from latest service run (if available). |
static org.apache.syncope.common.lib.search.OrderByClauseBuilder |
getOrderByClauseBuilder()
Returns a new instance of
OrderByClauseBuilder, for assisted building of orderby clauses. |
<T> T |
getService(Class<T> serviceClass)
Creates an instance of the given service class, with configured content type and authentication.
|
static org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder |
getUserSearchConditionBuilder()
Returns a new instance of
UserFiqlSearchConditionBuilder, for assisted building of FIQL queries. |
<T> T |
header(T service,
String key,
Object... values)
Sets the given header on the give service instance.
|
<T> T |
ifMatch(T service,
javax.ws.rs.core.EntityTag etag)
Sets the
If-Match header on the given service instance. |
<T> T |
ifNoneMatch(T service,
javax.ws.rs.core.EntityTag etag)
Sets the
If-None-Match header on the given service instance. |
protected void |
init(AuthenticationHandler handler)
Initializes the provided
restClientFactory with the authentication capabilities of the provided
handler. |
void |
login(AuthenticationHandler handler)
(Re)initializes the current instance with the authentication capabilities of the provided
handler. |
void |
logout()
Invalidates the JWT currently in use.
|
<T> T |
nullPriorityAsync(T service,
boolean nullPriorityAsync)
Asks for asynchronous propagation towards external resources with null priority.
|
<T> T |
prefer(T service,
Preference preference)
Sets the
Prefer header on the give service instance. |
void |
refresh()
Attempts to extend the lifespan of the JWT currently in use.
|
org.apache.commons.lang3.tuple.Pair<Map<String,Set<String>>,org.apache.syncope.common.lib.to.UserTO> |
self() |
public SyncopeClient(javax.ws.rs.core.MediaType mediaType,
org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean restClientFactory,
RestClientExceptionMapper exceptionMapper,
AuthenticationHandler handler,
boolean useCompression,
org.apache.cxf.configuration.jsse.TLSClientParameters tlsClientParameters)
protected void init(AuthenticationHandler handler)
restClientFactory with the authentication capabilities of the provided
handler.
Currently supports:
More can be supported by subclasses.handler - authentication handlerprotected void cleanup()
public void refresh()
public void logout()
public void login(AuthenticationHandler handler)
handler.handler - authentication handlerpublic static org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder getUserSearchConditionBuilder()
UserFiqlSearchConditionBuilder, for assisted building of FIQL queries.UserFiqlSearchConditionBuilderpublic static org.apache.syncope.common.lib.search.GroupFiqlSearchConditionBuilder getGroupSearchConditionBuilder()
GroupFiqlSearchConditionBuilder, for assisted building of FIQL queries.GroupFiqlSearchConditionBuilderpublic static org.apache.syncope.common.lib.search.AnyObjectFiqlSearchConditionBuilder getAnyObjectSearchConditionBuilder(String type)
AnyObjectFiqlSearchConditionBuilder, for assisted building of FIQL queries.type - any typeAnyObjectFiqlSearchConditionBuilderpublic static org.apache.syncope.common.lib.search.OrderByClauseBuilder getOrderByClauseBuilder()
OrderByClauseBuilder, for assisted building of orderby clauses.OrderByClauseBuilderpublic String getJWT()
HttpHeaders.AUTHORIZATION header
in all requests. It can be null (in case NoAuthenticationHandler or
AnonymousAuthenticationHandler were used).public String getDomain()
SyncopeConstants.MASTER_DOMAIN if not set.public <T> T getService(Class<T> serviceClass)
T - any service classserviceClass - service class referencepublic org.apache.commons.lang3.tuple.Pair<Map<String,Set<String>>,org.apache.syncope.common.lib.to.UserTO> self()
public <T> T header(T service,
String key,
Object... values)
T - any service classservice - service class instancekey - HTTP header keyvalues - HTTP header valuespublic <T> T prefer(T service,
Preference preference)
Prefer header on the give service instance.T - any service classservice - service class instancepreference - preference to be set via Prefer headerPrefer header setpublic <T> T nullPriorityAsync(T service,
boolean nullPriorityAsync)
T - any service classservice - service class instancenullPriorityAsync - whether asynchronous propagation towards external resources with null priority is
requestedpublic <T> T ifMatch(T service,
javax.ws.rs.core.EntityTag etag)
If-Match header on the given service instance.T - any service classservice - service class instanceetag - ETag valueIf-Match setpublic <T> T ifNoneMatch(T service,
javax.ws.rs.core.EntityTag etag)
If-None-Match header on the given service instance.T - any service classservice - service class instanceetag - ETag valueIf-None-Match setpublic <T> javax.ws.rs.core.EntityTag getLatestEntityTag(T service)
ETag header value from latest service run (if available).T - any service classservice - service class instanceETag header value from latest service run (if available)Copyright © 2010–2019 The Apache Software Foundation. All rights reserved.