blob: 29cb06dc2f605cbcc8f374dd229e542648ab3752 [file] [log] [blame]
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.component.sparkrest.springboot;
import org.apache.camel.component.sparkrest.SparkBinding;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
/**
* The spark-rest component is used for hosting REST services which has been
* defined using Camel rest-dsl.
*
* Generated by camel-package-maven-plugin - do not edit this file!
*/
@ConfigurationProperties(prefix = "camel.component.spark-rest")
public class SparkComponentConfiguration {
/**
* Port number. Will by default use 4567
*/
private Integer port;
/**
* Set the IP address that Spark should listen on. If not called the default
* address is '0.0.0.0'.
*/
private String ipAddress;
/**
* Minimum number of threads in Spark thread-pool (shared globally)
*/
private Integer minThreads;
/**
* Maximum number of threads in Spark thread-pool (shared globally)
*/
private Integer maxThreads;
/**
* Thread idle timeout in millis where threads that has been idle for a
* longer period will be terminated from the thread pool
*/
private Integer timeOutMillis;
/**
* Configures connection to be secure to use the keystore file
*/
private String keystoreFile;
/**
* Configures connection to be secure to use the keystore password
*/
private String keystorePassword;
/**
* Configures connection to be secure to use the truststore file
*/
private String truststoreFile;
/**
* Configures connection to be secure to use the truststore password
*/
private String truststorePassword;
/**
* To use the shared SparkConfiguration
*/
private SparkConfigurationNestedConfiguration sparkConfiguration;
/**
* To use a custom SparkBinding to map to/from Camel message.
*/
@NestedConfigurationProperty
private SparkBinding sparkBinding;
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
public Integer getMinThreads() {
return minThreads;
}
public void setMinThreads(Integer minThreads) {
this.minThreads = minThreads;
}
public Integer getMaxThreads() {
return maxThreads;
}
public void setMaxThreads(Integer maxThreads) {
this.maxThreads = maxThreads;
}
public Integer getTimeOutMillis() {
return timeOutMillis;
}
public void setTimeOutMillis(Integer timeOutMillis) {
this.timeOutMillis = timeOutMillis;
}
public String getKeystoreFile() {
return keystoreFile;
}
public void setKeystoreFile(String keystoreFile) {
this.keystoreFile = keystoreFile;
}
public String getKeystorePassword() {
return keystorePassword;
}
public void setKeystorePassword(String keystorePassword) {
this.keystorePassword = keystorePassword;
}
public String getTruststoreFile() {
return truststoreFile;
}
public void setTruststoreFile(String truststoreFile) {
this.truststoreFile = truststoreFile;
}
public String getTruststorePassword() {
return truststorePassword;
}
public void setTruststorePassword(String truststorePassword) {
this.truststorePassword = truststorePassword;
}
public SparkConfigurationNestedConfiguration getSparkConfiguration() {
return sparkConfiguration;
}
public void setSparkConfiguration(
SparkConfigurationNestedConfiguration sparkConfiguration) {
this.sparkConfiguration = sparkConfiguration;
}
public SparkBinding getSparkBinding() {
return sparkBinding;
}
public void setSparkBinding(SparkBinding sparkBinding) {
this.sparkBinding = sparkBinding;
}
public static class SparkConfigurationNestedConfiguration {
public static final Class CAMEL_NESTED_CLASS = org.apache.camel.component.sparkrest.SparkConfiguration.class;
/**
* If this option is enabled, then during binding from Spark to Camel
* Message then the headers will be mapped as well (eg added as header
* to the Camel Message as well). You can turn off this option to
* disable this. The headers can still be accessed from the
* org.apache.camel.component.sparkrest.SparkMessage message with the
* method getRequest() that returns the Spark HTTP request instance.
*/
private Boolean mapHeaders;
/**
* Determines whether or not the raw input stream from Spark
* HttpRequest#getContent() is cached or not (Camel will read the stream
* into a in light-weight memory based Stream caching) cache. By default
* Camel will cache the Netty input stream to support reading it
* multiple times to ensure Camel can retrieve all data from the stream.
* However you can set this option to true when you for example need to
* access the raw stream, such as streaming it directly to a file or
* other persistent store. Mind that if you enable this option, then you
* cannot read the Netty stream multiple times out of the box, and you
* would need manually to reset the reader index on the Spark raw
* stream.
*/
private Boolean disableStreamCache;
/**
* If this option is enabled, then during binding from Spark to Camel
* Message then the header values will be URL decoded (eg %20 will be a
* space character.)
*/
private Boolean urlDecodeHeaders;
/**
* If enabled and an Exchange failed processing on the consumer side,
* and if the caused Exception was send back serialized in the response
* as a application/x-java-serialized-object content type.
* <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.
*/
private Boolean transferException;
/**
* Whether or not the consumer should try to find a target consumer by
* matching the URI prefix if no exact match is found.
*/
private Boolean matchOnUriPrefix;
public Boolean getMapHeaders() {
return mapHeaders;
}
public void setMapHeaders(Boolean mapHeaders) {
this.mapHeaders = mapHeaders;
}
public Boolean getDisableStreamCache() {
return disableStreamCache;
}
public void setDisableStreamCache(Boolean disableStreamCache) {
this.disableStreamCache = disableStreamCache;
}
public Boolean getUrlDecodeHeaders() {
return urlDecodeHeaders;
}
public void setUrlDecodeHeaders(Boolean urlDecodeHeaders) {
this.urlDecodeHeaders = urlDecodeHeaders;
}
public Boolean getTransferException() {
return transferException;
}
public void setTransferException(Boolean transferException) {
this.transferException = transferException;
}
public Boolean getMatchOnUriPrefix() {
return matchOnUriPrefix;
}
public void setMatchOnUriPrefix(Boolean matchOnUriPrefix) {
this.matchOnUriPrefix = matchOnUriPrefix;
}
}
}