@Override public Map<String, Object> getProperties() { if (request.getProperties() != null) { return Collections.unmodifiableMap(request.getProperties()); } else { return null; } }
@Override public Map<String, Object> getProperties() { if (request.getProperties() != null) { return Collections.unmodifiableMap(request.getProperties()); } else { return null; } }
/** * Get a feature that is boolean property of the property bag. * * @param name the name of the feature; * @param defaultValue the default boolean value if the property is absent. * @return true if the feature value is present and is an instance of * <code>Boolean</code> and that value is true, otherwise the * <code>defaultValue</code>. */ public boolean getPropertyAsFeature(String name, boolean defaultValue) { Boolean v = (Boolean)getProperties().get(name); return (v != null) ? v : defaultValue; }
@Override public void setProperty(String name, Object value) { clientRequest.getProperties().put(name, value); }
@Override public void setProperty(String name, Object value) { clientRequest.getProperties().put(name, value); }
/** * Get a feature that is boolean property of the property bag. * * @param name the name of the feature; * @param defaultValue the default boolean value if the property is absent. * @return true if the feature value is present and is an instance of * <code>Boolean</code> and that value is true, otherwise the * <code>defaultValue</code>. */ public boolean getPropertyAsFeature(String name, boolean defaultValue) { Boolean v = (Boolean)getProperties().get(name); return (v != null) ? v : defaultValue; }
@Override public Object getProperty(String name) { return clientRequest.getProperties().get(name); }
private Boolean isBufferingEnabled(ClientRequest cr) { Boolean enabled = (Boolean) cr.getProperties().get(ApacheHttpClient4Config.PROPERTY_ENABLE_BUFFERING); return enabled != null && enabled; }
@Override public Object getProperty(String name) { return clientRequest.getProperties().get(name); }
private EntityStreamingListener getEntityStreamingListener( final ClientRequest clientRequest) { EntityStreamingListener result = (EntityStreamingListener) clientRequest .getProperties().get(EntityStreamingListener.class.getName()); if (result != null) { return result; } return EMPTY_STREAMING_LISTENER; }
private EntityStreamingListener getEntityStreamingListener( final ClientRequest clientRequest) { EntityStreamingListener result = (EntityStreamingListener) clientRequest .getProperties().get(EntityStreamingListener.class.getName()); if (result != null) { return result; } return EMPTY_STREAMING_LISTENER; }
/** * Create POST client request to given (request/access) token uri. Request properties from {@code originalRequest} are * copied to the new request. * * @param originalRequest client request to copy properties from. * @param tokenUri token uri endpoint. * @return new client request to the token uri endpoint. */ private ClientRequest createTokenClientRequest(final ClientRequest originalRequest, final URI tokenUri) { final ClientRequest request = ClientRequest.create().build(tokenUri, HttpMethod.POST); request.getProperties().putAll(originalRequest.getProperties()); return request; }
@Override public ClientResponse handle(ClientRequest cr) { String key = getKey(); if (cr.getProperties().containsKey(key)) { return this.getNext().handle(cr); } cr.getProperties().put(key, this); return doHandle(cr); }
@Override public ClientResponse handle(ClientRequest cr) { String key = getKey(); if (cr.getProperties().containsKey(key)) { return this.getNext().handle(cr); } cr.getProperties().put(key, this); return doHandle(cr); }
@Override public ClientResponse handle(final ClientRequest request) throws ClientHandlerException { Map<String, Object> effectiveProperties = new HashMap<String, Object>(properties); effectiveProperties.put(Client.class.getName(), this); effectiveProperties.putAll(request.getProperties()); request.setProperties(effectiveProperties); final ClientResponse response = getHeadHandler().handle(request); response.getProperties().put(Client.class.getName(), this); return response; }
@Override public ClientResponse handle(final ClientRequest request) throws ClientHandlerException { Map<String, Object> effectiveProperties = new HashMap<String, Object>(properties); effectiveProperties.put(Client.class.getName(), this); effectiveProperties.putAll(request.getProperties()); request.setProperties(effectiveProperties); final ClientResponse response = getHeadHandler().handle(request); response.getProperties().put(Client.class.getName(), this); return response; }
public CollectionState newCollectionState(URI discoveryUri, Client client, String method) { ClientRequest request = ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(discoveryUri, method); if (Boolean.valueOf(System.getProperty(DONT_FOLLOW_REDIRECTS))) { request.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, false); } return newCollectionState(request, client.handle(request), null); }
public RecordState newRecordState(URI discoveryUri, Client client, String method) { ClientRequest request = ClientRequest.create().accept(GedcomxConstants.GEDCOMX_JSON_MEDIA_TYPE).build(discoveryUri, method); if (Boolean.valueOf(System.getProperty(DONT_FOLLOW_REDIRECTS))) { request.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, false); } return newRecordState(request, client.handle(request), null); }
@Override public ClientResponse handle(ClientRequest request) throws ClientHandlerException { String namespace = (String) request.getProperties().get(RestUtil.PROPERTY_NAMESPACE); if (namespace != null) { if (s3Config.isUseVHost()) { request.setURI(insertNamespace(request.getURI(), namespace)); } else { // add to headers (x-emc-namespace: namespace) request.getHeaders().putSingle(RestUtil.EMC_NAMESPACE, namespace); } } return getNext().handle(request); } }
@Override public ClientResponse handle(ClientRequest request) throws ClientHandlerException { URI uri = request.getURI(); String bucketName = (String) request.getProperties().get(S3Constants.PROPERTY_BUCKET_NAME); if (bucketName != null) { request.setURI(insertBucket(uri, bucketName, s3Config.isUseVHost())); } return getNext().handle(request); } }