/** * Specify a {@link Function} to determine {@link HttpMethod} at runtime. * @param httpMethodFunction The HTTP method {@link Function}. * @param <P> the payload type. * @return the spec */ public <P> S httpMethodFunction(Function<Message<P>, ?> httpMethodFunction) { return httpMethodExpression(new FunctionExpression<>(httpMethodFunction)); }
/** * Configure the {@link ExpressionFileListFilter}. * @param filterFunction the {@link Function} for files filtering. * @return the spec. * @see AbstractRemoteFileStreamingMessageSource#setFilter(FileListFilter) * @see ExpressionFileListFilter */ public S filterFunction(Function<F, Boolean> filterFunction) { this.expressionFileListFilter = new ExpressionFileListFilter<>(new FunctionExpression<>(filterFunction)); return filter(this.expressionFileListFilter); }
/** * A {@link Function} which should resolve to a {@link Query} instance. * @param queryFunction the {@link Function} to use. * @param <P> the type of the message payload. * @return the spec */ public <P> MongoDbOutboundGatewaySpec queryFunction(Function<Message<P>, Query> queryFunction) { this.target.setQueryExpression(new FunctionExpression<>(queryFunction)); return this; }
/** * Configure a {@link Function} to be invoked to generate the local file name; * argument passed to the {@code apply} method is the remote file name. * @param localFilenameFunction the localFilenameFunction. * @return the spec. * @see FunctionExpression */ public S localFilename(Function<String, String> localFilenameFunction) { return localFilenameExpression(new FunctionExpression<>(localFilenameFunction)); }
/** * Set a function that will be invoked to return the subject based on the message. * @param subject the function. * @param <P> the message payload type. * @return the builder. */ public <P> MailHeadersBuilder subjectFunction(Function<Message<P>, String> subject) { return put(MailHeaders.SUBJECT, new FunctionExpression<Message<P>>(subject)); }
/** * Set a function that will be invoked to determine the To: addresses based on the * message. * @param to the function. * @param <P> the message payload type. * @return the builder. */ public <P> MailHeadersBuilder toFunction(Function<Message<P>, String[]> to) { return put(MailHeaders.TO, new FunctionExpression<Message<P>>(to)); }
/** * Set a function that will be invoked to determine the cc: addresses based on the * message. * @param cc the function. * @param <P> the message payload type. * @return the builder. */ public <P> MailHeadersBuilder ccFunction(Function<Message<P>, String[]> cc) { return put(MailHeaders.CC, new FunctionExpression<Message<P>>(cc)); }
/** * Set a function that will be invoked to determine the ReplyTo: address based on the * message. * @param replyTo the function. * @param <P> the message payload type. * @return the builder. */ public <P> MailHeadersBuilder replyToFunction(Function<Message<P>, String> replyTo) { return put(MailHeaders.REPLY_TO, new FunctionExpression<Message<P>>(replyTo)); }
/** * @param key the key. * @param function the function (usually a JDK8 lambda). * @param <P> the payload type. * @return the enricher spec. * @see ContentEnricher#setPropertyExpressions(Map) * @see FunctionExpression */ public <P> EnricherSpec propertyFunction(String key, Function<Message<P>, Object> function) { this.propertyExpressions.put(key, new FunctionExpression<>(function)); return _this(); }
/** * Specify a {@link Function} for local files renaming after downloading. * @param localFilenameFunction the {@link Function} to use. * @param <P> the expected payload type. * @return the Spec. */ public <P> S localFilename(Function<Message<P>, String> localFilenameFunction) { return localFilenameExpression(new FunctionExpression<>(localFilenameFunction)); }
/** * Create an {@link HttpMessageHandlerSpec} builder for one-way adapter based on provided {@code Function} * to evaluate target {@code uri} against request message. * @param uriFunction the {@code Function} to evaluate {@code uri} at runtime. * @param <P> the expected payload type. * @return the HttpMessageHandlerSpec instance */ public static <P> HttpMessageHandlerSpec outboundChannelAdapter(Function<Message<P>, ?> uriFunction) { return outboundChannelAdapter(new FunctionExpression<>(uriFunction)); }
/** * Configure the {@link ExpressionFileListFilter}. * @param filterFunction the {@link Function} for files filtering. * @return the spec. * @see FileReadingMessageSource#setFilter(FileListFilter) * @see ExpressionFileListFilter */ public FileInboundChannelAdapterSpec filterFunction(Function<File, Boolean> filterFunction) { this.expressionFileListFilter = new ExpressionFileListFilter<>(new FunctionExpression<>(filterFunction)); return filter(this.expressionFileListFilter); }
/** * Configure a {@link Function} to select messages. The argument for the function * is a {@link javax.mail.internet.MimeMessage}; {@code apply} returns a boolean * result (true means select the message). * @param selectorFunction the selectorFunction. * @return the spec. * @see FunctionExpression */ public ImapIdleChannelAdapterSpec selector(Function<MimeMessage, Boolean> selectorFunction) { return selectorExpression(new FunctionExpression<>(selectorFunction)); }
/** * Specify a {@link Function} for provided header to populate. * @param header the header name to add. * @param headerFunction the function to evaluate the header value against {@link HttpEntity}. * @param <P> the expected HTTP body type. * @return the current Spec. * @see org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport#setHeaderExpressions(Map) */ public <P> S headerFunction(String header, Function<HttpEntity<P>, ?> headerFunction) { return headerExpression(header, new FunctionExpression<>(headerFunction)); }
/** * Set a function that will be invoked to determine the From: address based on the * message. * @param from the function. * @param <P> the message payload type. * @return the builder. */ public <P> MailHeadersBuilder fromFunction(Function<Message<P>, String> from) { return put(MailHeaders.FROM, new FunctionExpression<Message<P>>(from)); }
/** * Set a function that will be invoked to determine the filename for the attachment. * @param attachmentFilename the function. * @param <P> the message payload type. * @return the builder. */ public <P> MailHeadersBuilder attachmentFilenameFunction(Function<Message<P>, String> attachmentFilename) { return put(MailHeaders.ATTACHMENT_FILENAME, new FunctionExpression<Message<P>>(attachmentFilename)); }
/** * Configure the {@link ExpressionFileListFilter}. * @param filterFunction the {@link Function} for files filtering. * @return the spec. * @see AbstractRemoteFileOutboundGateway#setFilter(FileListFilter) * @see ExpressionFileListFilter */ public S filterFunction(Function<F, Boolean> filterFunction) { this.expressionFileListFilter = new ExpressionFileListFilter<>(new FunctionExpression<>(filterFunction)); return filter(this.expressionFileListFilter); }
/** * Specify a {@link Function} to resolve a {@code deliveryMode} for JMS message to send. * @param deliveryModeFunction to use * @param <P> the expected payload type. * @return the spec * @since 5.1 * @see FunctionExpression */ public <P> S deliveryModeFunction(Function<Message<P>, ?> deliveryModeFunction) { this.target.setDeliveryModeExpression(new FunctionExpression<>(deliveryModeFunction)); return _this(); }
/** * Specify a {@link Function} to resolve a {@code timeToLive} for JMS message to send. * @param timeToLiveFunction to use * @param <P> the expected payload type. * @return the spec * @see FunctionExpression * @since 5.1 */ public <P> S timeToLiveFunction(Function<Message<P>, ?> timeToLiveFunction) { this.target.setTimeToLiveExpression(new FunctionExpression<>(timeToLiveFunction)); return _this(); }
/** * Specify a remote temporary directory path {@link Function}. * @param temporaryRemoteDirectoryFunction the temporary remote directory {@link Function} * @param <P> the expected payload type. * @return the current Spec */ public <P> S temporaryRemoteDirectory(Function<Message<P>, String> temporaryRemoteDirectoryFunction) { this.target.setTemporaryRemoteDirectoryExpression(new FunctionExpression<>(temporaryRemoteDirectoryFunction)); return _this(); }