/** * Specify a directory path where remote files will be transferred to. * @param localDirectory the localDirectory to set */ public void setLocalDirectory(File localDirectory) { if (localDirectory != null) { this.localDirectoryExpression = new ValueExpression<>(localDirectory); } }
@Override public <T> T getValue(Object rootObject, Class<T> desiredResultType) throws EvaluationException { return getValue(desiredResultType); }
@Override public void setValue(Object rootObject, Object value) throws EvaluationException { setValue(null, rootObject, value); }
/** * Set the default timeout value for receiving reply messages. If not explicitly * configured with an annotation, or on a method element, this value will be used. * * @param defaultReplyTimeout the timeout value in milliseconds */ public void setDefaultReplyTimeout(Long defaultReplyTimeout) { this.defaultReplyTimeout = new ValueExpression<>(defaultReplyTimeout); }
@Override public void setValue(EvaluationContext context, Object value) throws EvaluationException { setValue(context, null, value); }
@Override public <T> T getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType) throws EvaluationException { return getValue(context, desiredResultType); }
/** * Set the value to set in the {@code x-delay} header when using the * RabbitMQ delayed message exchange plugin. By default, the {@link AmqpHeaders#DELAY} * header (if present) is mapped; setting the delay here overrides that value. * @param delay the delay. * @since 4.3.5 */ public void setDelay(int delay) { this.delayExpression = new ValueExpression<>(delay); }
@Override public void setValue(Object rootObject, Object value) throws EvaluationException { setValue(null, rootObject, value); }
@Override public <T> T getValue(Object rootObject, Class<T> desiredResultType) throws EvaluationException { return getValue(desiredResultType); }
/** * Create a handler that will send requests to the provided URI. * * @param uri The URI. */ public HttpRequestExecutingMessageHandler(URI uri) { this(new ValueExpression<URI>(uri)); }
@Override public void setValue(EvaluationContext context, Object value) throws EvaluationException { setValue(context, null, value); }
@Override public <T> T getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType) throws EvaluationException { return getValue(context, desiredResultType); }
/** * Create a handler that will send requests to the provided URI. * @param uri The URI. */ public WebFluxRequestExecutingMessageHandler(URI uri) { this(new ValueExpression<>(uri)); }
/** * Set the default timeout value for sending request messages. If not explicitly * configured with an annotation, or on a method element, this value will be used. * * @param defaultRequestTimeout the timeout value in milliseconds */ public void setDefaultRequestTimeout(Long defaultRequestTimeout) { this.defaultRequestTimeout = new ValueExpression<>(defaultRequestTimeout); }
WebFluxMessageHandlerSpec(URI uri, WebClient webClient) { this(new ValueExpression<>(uri), webClient); }
HttpMessageHandlerSpec(URI uri, RestTemplate restTemplate) { this(new ValueExpression<>(uri), restTemplate); }
/** * Specify the {@link HttpMethod} for requests. * The default method is {@code POST}. * @param httpMethod The method. */ public void setHttpMethod(HttpMethod httpMethod) { Assert.notNull(httpMethod, "'httpMethod' must not be null"); this.httpMethodExpression = new ValueExpression<HttpMethod>(httpMethod); }
public void setDestination(String destination) { Assert.hasText(destination, "'destination' must not be empty."); this.destinationExpression = new ValueExpression<String>(destination); }
/** * Specify the expected response type for the REST request * otherwise the default response type is {@link ResponseEntity} and will * be returned as a payload of the reply Message. * To take advantage of the HttpMessageConverters * registered on this adapter, provide a different type). * * @param expectedResponseType The expected type. * * Also see {@link #setExpectedResponseTypeExpression(Expression)} */ public void setExpectedResponseType(Class<?> expectedResponseType) { Assert.notNull(expectedResponseType, "'expectedResponseType' must not be null"); this.expectedResponseTypeExpression = new ValueExpression<Class<?>>(expectedResponseType); }
/** * Return a {@link ValueExpression} for a simple literal, otherwise * a {@link org.springframework.expression.spel.standard.SpelExpression}. * @param expression the expression string. * @return the expression. * @since 5.0 */ public static Expression intExpression(String expression) { try { return new ValueExpression<>(Integer.parseInt(expression)); } catch (NumberFormatException e) { // empty } return EXPRESSION_PARSER.parseExpression(expression); }