public boolean canConnect(HttpConsumer consumer) throws Exception { return component.canConnect(consumer); }
public void connect(HttpConsumer consumer) throws Exception { component.connect(consumer); }
public void disconnect(HttpConsumer consumer) throws Exception { component.disconnect(consumer); }
@Deprecated public DefaultHttpBinding(HttpCommonEndpoint endpoint) { this.headerFilterStrategy = endpoint.getHeaderFilterStrategy(); this.transferException = endpoint.isTransferException(); if (endpoint.getComponent() != null) { this.allowJavaSerializedObject = endpoint.getComponent().isAllowJavaSerializedObject(); } }
/** * To use a custom HttpBinding to control the mapping between Camel message and HttpClient. */ @Override public void setHttpBinding(HttpBinding httpBinding) { // need to override and call super for component docs super.setHttpBinding(httpBinding); }
/** * Gets the parameter. This method doesn't resolve reference parameters in the registry. * * @param parameters the parameters * @param key the key * @param type the requested type to convert the value from the parameter * @return the converted value parameter */ public <T> T getParameter(Map<String, Object> parameters, String key, Class<T> type) { return getParameter(parameters, key, type, null); }
/** * To use the shared HttpConfiguration as base configuration. */ @Override public void setHttpConfiguration(HttpConfiguration httpConfiguration) { // need to override and call super for component docs super.setHttpConfiguration(httpConfiguration); }
/** * Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object * <p/> * This is by default turned off. If you enable this then be aware that Java will deserialize the incoming * data from the request to Java and that can be a potential security risk. */ @Override public void setAllowJavaSerializedObject(boolean allowJavaSerializedObject) { // need to override and call super for component docs super.setAllowJavaSerializedObject(allowJavaSerializedObject); }
/** * Gets the parameter. This method doesn't resolve reference parameters in the registry. * * @param parameters the parameters * @param key the key * @param type the requested type to convert the value from the parameter * @param defaultValue use this default value if the parameter does not contain the key * @return the converted value parameter */ public <T> T getParameter(Map<String, Object> parameters, String key, Class<T> type, T defaultValue) { Object value = parameters.get(key); if (value == null) { value = defaultValue; } if (value == null) { return null; } return CamelContextHelper.convertTo(getCamelContext(), type, value); }
@Override protected void doStart() throws Exception { super.doStart(); RestConfiguration config = getCamelContext().getRestConfiguration("servlet", true); // configure additional options on jetty configuration if (config.getComponentProperties() != null && !config.getComponentProperties().isEmpty()) { setProperties(this, config.getComponentProperties()); } } }
if (!getEndpoint().getComponent().isAllowJavaSerializedObject()) { throw new CamelExchangeException("Content-type " + HttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT + " is not allowed", exchange);
if (getEndpoint().getComponent().isAllowJavaSerializedObject() || getEndpoint().isTransferException()) { return HttpHelper.deserializeJavaObjectFromStream(is, exchange.getContext()); } else {
public HttpBinding getHttpBinding() { if (httpBinding == null) { // create a new binding and use the options from this endpoint httpBinding = new DefaultHttpBinding(); httpBinding.setHeaderFilterStrategy(getHeaderFilterStrategy()); httpBinding.setTransferException(isTransferException()); if (getComponent() != null) { httpBinding.setAllowJavaSerializedObject(getComponent().isAllowJavaSerializedObject()); } httpBinding.setEagerCheckContentAvailable(isEagerCheckContentAvailable()); httpBinding.setMapHttpMessageBody(isMapHttpMessageBody()); httpBinding.setMapHttpMessageHeaders(isMapHttpMessageHeaders()); httpBinding.setMapHttpMessageFormUrlEncodedBody(isMapHttpMessageFormUrlEncodedBody()); } return httpBinding; }