/** * 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); } }
/** * 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); }
/** * 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); }
/** * Create a handler that will send requests to the provided URI. * * @param uri The URI. */ public HttpRequestExecutingMessageHandler(URI uri) { this(new ValueExpression<URI>(uri)); }
/** * 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); }
/** * 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 longExpression(String expression) { try { return new ValueExpression<>(Long.parseLong(expression)); } catch (NumberFormatException e) { // empty } return EXPRESSION_PARSER.parseExpression(expression); }
/** * Specify a {@link ParameterizedTypeReference} for the expected response type for the REST request. * @param expectedResponseType The {@link ParameterizedTypeReference} for expected type. * @return the spec */ public S expectedResponseType(ParameterizedTypeReference<?> expectedResponseType) { return expectedResponseTypeExpression(new ValueExpression<ParameterizedTypeReference<?>>(expectedResponseType)); }
/** * Set the maximum number of results expression. It has be a non null value * Not setting one will default to the behavior of fetching all the records * @param maxResults the maximum number of results to retrieve * @return the spec */ public JpaInboundChannelAdapterSpec maxResults(int maxResults) { return maxResultsExpression(new ValueExpression<>(maxResults)); }
/** * @param key the key. * @param value the value. * @param <V> the value type. * @return the enricher spec. * @see ContentEnricher#setPropertyExpressions(Map) */ public <V> EnricherSpec property(String key, V value) { this.propertyExpressions.put(key, new ValueExpression<>(value)); return _this(); }
/** * Specify a first result in the query executed. * @param firstResult the first result to use. * @return the spec */ public JpaRetrievingOutboundGatewaySpec firstResult(int firstResult) { return firstResultExpression(new ValueExpression<>(firstResult)); }
/** * Set the maximum number of results expression. It has be a non null value * Not setting one will default to the behavior of fetching all the records * @param maxResults the maximum number of results to retrieve * @return the spec */ public JpaRetrievingOutboundGatewaySpec maxResults(int maxResults) { return maxResultsExpression(new ValueExpression<>(maxResults)); }
/** * Configure the handler with a group timeout expression that evaluates to * this constant value. * @param groupTimeout the group timeout in milliseconds. * @return the handler spec. * @see AbstractCorrelatingMessageHandler#setGroupTimeoutExpression * @see ValueExpression */ public S groupTimeout(long groupTimeout) { this.handler.setGroupTimeoutExpression(new ValueExpression<>(groupTimeout)); return _this(); }
@Bean public ReactiveStreamsConsumer rawHandlerConsumer() { return new ReactiveStreamsConsumer(rawChannel(), (MessageHandler) new ExpressionEvaluatingMessageHandler(new ValueExpression<>("test"))); }