public static ContentType fromString(final String value) { return XML.getMediaType().toString().equalsIgnoreCase(value) ? XML : YAML.getMediaType().toString().equalsIgnoreCase(value) ? YAML : JSON; } }
/** * 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); } }
/** * 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); } }
public MediaType getMediaType() { return clientFactory.getContentType().getMediaType(); }
public SyncopeClientFactoryBean setContentType(final String contentType) { this.contentType = ContentType.fromString(contentType); return this; }
public SyncopeClientFactoryBean setContentType(final String contentType) { this.contentType = ContentType.fromString(contentType); return this; }
public static ContentType fromString(final String value) { return XML.getMediaType().toString().equalsIgnoreCase(value) ? XML : YAML.getMediaType().toString().equalsIgnoreCase(value) ? YAML : JSON; } }
public <T> T getService(final MediaType mediaType, final Class<T> serviceClass) { T service; synchronized (clientFactory) { SyncopeClientFactoryBean.ContentType preType = clientFactory.getContentType(); clientFactory.setContentType(SyncopeClientFactoryBean.ContentType.fromString(mediaType.toString())); service = clientFactory.create(getJWT()).getService(serviceClass); clientFactory.setContentType(preType); } return service; }