/** * Builds client instance with no authentication, for user self-registration and password reset. * * @return client instance with no authentication */ public SyncopeClient create() { return create(new NoAuthenticationHandler()); }
/** * Builds client instance with the given credentials. * Such credentials will be used only to obtain a valid JWT in the * {@link javax.ws.rs.core.HttpHeaders#AUTHORIZATION} header; * * @param username username * @param password password * @return client instance with the given credentials */ public SyncopeClient create(final String username, final String password) { return create(new BasicAuthenticationHandler(username, password)); }
/** * Builds client instance which will be passing the provided value in the * {@link javax.ws.rs.core.HttpHeaders#AUTHORIZATION} * request header. * * @param jwt value received after login, in the {@link RESTHeaders#TOKEN} response header * @return client instance which will be passing the provided value in the * {@link javax.ws.rs.core.HttpHeaders#AUTHORIZATION} * request header */ public SyncopeClient create(final String jwt) { return create(new JWTAuthenticationHandler(jwt)); }
/** * Builds client instance with the given authentication handler. * * @param handler authentication handler * @return client instance with the given authentication handler */ public SyncopeClient create(final AuthenticationHandler handler) { return new SyncopeClient( getContentType().getMediaType(), getRestClientFactoryBean(), getExceptionMapper(), handler, useCompression, tlsClientParameters); } }
/** * Sets the {@code If-Match} header on the given service instance. * * @param <T> any service class * @param service service class instance * @param etag ETag value * @return given service instance, with {@code If-Match} set */ public <T> T ifMatch(final T service, final EntityTag etag) { return match(service, etag, false); }
public JacksonJaxbJsonProvider getJsonProvider() { return jsonProvider == null ? defaultJsonProvider() : jsonProvider; }
/** * Asks for asynchronous propagation towards external resources with null priority. * * @param <T> any service class * @param service service class instance * @param nullPriorityAsync whether asynchronous propagation towards external resources with null priority is * requested * @return service instance of the given reference class, with related header set */ public <T> T nullPriorityAsync(final T service, final boolean nullPriorityAsync) { return header(service, RESTHeaders.NULL_PRIORITY_ASYNC, nullPriorityAsync); }
public RestClientExceptionMapper getExceptionMapper() { return exceptionMapper == null ? defaultExceptionMapper() : exceptionMapper; }
/** * (Re)initializes the current instance with the authentication capabilities of the provided {@code handler}. * * @param handler authentication handler */ public void login(final AuthenticationHandler handler) { init(handler); }
public JAXBElementProvider<?> getJaxbProvider() { return jaxbProvider == null ? defaultJAXBProvider() : jaxbProvider; }
public JAXRSClientFactoryBean getRestClientFactoryBean() { return restClientFactoryBean == null ? defaultRestClientFactoryBean() : restClientFactoryBean; }
/** * Builds client instance with no authentication, for user self-registration and password reset. * * @return client instance with no authentication */ public SyncopeClient create() { return create(new NoAuthenticationHandler()); }
/** * Builds client instance with the given credentials. * Such credentials will be used only to obtain a valid JWT in the * {@link javax.ws.rs.core.HttpHeaders#AUTHORIZATION} header; * * @param username username * @param password password * @return client instance with the given credentials */ public SyncopeClient create(final String username, final String password) { return create(new BasicAuthenticationHandler(username, password)); }
/** * Builds client instance which will be passing the provided value in the * {@link javax.ws.rs.core.HttpHeaders#AUTHORIZATION} * request header. * * @param jwt value received after login, in the {@link RESTHeaders#TOKEN} response header * @return client instance which will be passing the provided value in the * {@link javax.ws.rs.core.HttpHeaders#AUTHORIZATION} * request header */ public SyncopeClient create(final String jwt) { return create(new JWTAuthenticationHandler(jwt)); }
/** * Sets the {@code If-Match} header on the given service instance. * * @param <T> any service class * @param service service class instance * @param etag ETag value * @return given service instance, with {@code If-Match} set */ public <T> T ifMatch(final T service, final EntityTag etag) { return match(service, etag, false); }
public JacksonJaxbJsonProvider getJsonProvider() { return jsonProvider == null ? defaultJsonProvider() : jsonProvider; }
/** * Asks for asynchronous propagation towards external resources with null priority. * * @param <T> any service class * @param service service class instance * @param nullPriorityAsync whether asynchronous propagation towards external resources with null priority is * requested * @return service instance of the given reference class, with related header set */ public <T> T nullPriorityAsync(final T service, final boolean nullPriorityAsync) { return header(service, RESTHeaders.NULL_PRIORITY_ASYNC, nullPriorityAsync); }
public RestClientExceptionMapper getExceptionMapper() { return exceptionMapper == null ? defaultExceptionMapper() : exceptionMapper; }
/** * Sets the {@code If-None-Match} header on the given service instance. * * @param <T> any service class * @param service service class instance * @param etag ETag value * @return given service instance, with {@code If-None-Match} set */ public <T> T ifNoneMatch(final T service, final EntityTag etag) { return match(service, etag, true); }
/** * Sets the {@code If-None-Match} header on the given service instance. * * @param <T> any service class * @param service service class instance * @param etag ETag value * @return given service instance, with {@code If-None-Match} set */ public <T> T ifNoneMatch(final T service, final EntityTag etag) { return match(service, etag, true); }