Package org.apache.camel.component.mina
Class MinaConfiguration
- java.lang.Object
-
- org.apache.camel.component.mina.MinaConfiguration
-
-
Constructor Summary
Constructors Constructor Description MinaConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MinaConfigurationcopy()Returns a copy of this configurationStringgetCharsetName()org.apache.mina.filter.codec.ProtocolCodecFactorygetCodec()intgetDecoderMaxLineLength()intgetEncoderMaxLineLength()StringgetEncoding()List<org.apache.mina.core.filterchain.IoFilter>getFilters()StringgetHost()intgetMaximumPoolSize()org.apache.camel.LoggingLevelgetNoReplyLogLevel()intgetPort()StringgetProtocol()org.apache.camel.support.jsse.SSLContextParametersgetSslContextParameters()MinaTextLineDelimitergetTextlineDelimiter()longgetTimeout()StringgetUriString()longgetWriteTimeout()booleanisAllowDefaultCodec()booleanisAutoStartTls()booleanisCachedAddress()booleanisClientMode()booleanisDatagramProtocol()booleanisDisconnect()booleanisDisconnectOnNoReply()booleanisLazySessionCreation()booleanisMinaLogger()booleanisOrderedThreadPoolExecutor()booleanisSync()booleanisTextline()booleanisTransferExchange()voidsetAllowDefaultCodec(boolean allowDefaultCodec)The mina component installs a default codec if both, codec is null and textline is false.voidsetAutoStartTls(boolean autoStartTls)Whether to auto start SSL handshake.voidsetCachedAddress(boolean shouldCacheAddress)Whether to create the InetAddress once and reuse.voidsetClientMode(boolean clientMode)If the clientMode is true, mina consumer will connect the address as a TCP client.voidsetCodec(org.apache.mina.filter.codec.ProtocolCodecFactory codec)To use a custom minda codec implementation.voidsetDecoderMaxLineLength(int decoderMaxLineLength)To set the textline protocol decoder max line length.voidsetDisconnect(boolean disconnect)Whether to disconnect(close) from Mina session right after use.voidsetDisconnectOnNoReply(boolean disconnectOnNoReply)If sync is enabled then this option dictates MinaConsumer if it should disconnect where there is no reply to send back.voidsetEncoderMaxLineLength(int encoderMaxLineLength)To set the textline protocol encoder max line length.voidsetEncoding(String encoding)You can configure the encoding (a charset name) to use for the TCP textline codec and the UDP protocol.voidsetFilters(List<org.apache.mina.core.filterchain.IoFilter> filters)You can set a list of Mina IoFilters to use.voidsetHost(String host)Hostname to use.voidsetLazySessionCreation(boolean lazySessionCreation)Sessions can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started.voidsetMaximumPoolSize(int maximumPoolSize)Number of worker threads in the worker pool for TCP and UDPvoidsetMinaLogger(boolean minaLogger)You can enable the Apache MINA logging filter.voidsetNoReplyLogLevel(org.apache.camel.LoggingLevel noReplyLogLevel)If sync is enabled this option dictates MinaConsumer which logging level to use when logging a there is no reply to send back.voidsetOrderedThreadPoolExecutor(boolean orderedThreadPoolExecutor)Whether to use ordered thread pool, to ensure events are processed orderly on the same channel.voidsetPort(int port)Port numbervoidsetProtocol(String protocol)Protocol to usevoidsetSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)To configure SSL security.voidsetSync(boolean sync)Setting to set endpoint as one-way or request-response.voidsetTextline(boolean textline)Only used for TCP.voidsetTextlineDelimiter(MinaTextLineDelimiter textlineDelimiter)Only used for TCP and if textline=true.voidsetTimeout(long timeout)You can configure the timeout that specifies how long to wait for a response from a remote server.voidsetTransferExchange(boolean transferExchange)Only used for TCP.voidsetWriteTimeout(long writeTimeout)Maximum amount of time it should take to send data to the MINA session.
-
-
-
Method Detail
-
copy
public MinaConfiguration copy()
Returns a copy of this configuration
-
getCharsetName
public String getCharsetName()
-
getProtocol
public String getProtocol()
-
setProtocol
public void setProtocol(String protocol)
Protocol to use
-
getHost
public String getHost()
-
setHost
public void setHost(String host)
Hostname to use. Use localhost or 0.0.0.0 for local server as consumer. For producer use the hostname or ip address of the remote server.
-
getPort
public int getPort()
-
setPort
public void setPort(int port)
Port number
-
isSync
public boolean isSync()
-
setSync
public void setSync(boolean sync)
Setting to set endpoint as one-way or request-response.
-
isTextline
public boolean isTextline()
-
setTextline
public void setTextline(boolean textline)
Only used for TCP. If no codec is specified, you can use this flag to indicate a text line based codec; if not specified or the value is false, then Object Serialization is assumed over TCP.
-
getTextlineDelimiter
public MinaTextLineDelimiter getTextlineDelimiter()
-
setTextlineDelimiter
public void setTextlineDelimiter(MinaTextLineDelimiter textlineDelimiter)
Only used for TCP and if textline=true. Sets the text line delimiter to use. If none provided, Camel will use DEFAULT. This delimiter is used to mark the end of text.
-
getCodec
public org.apache.mina.filter.codec.ProtocolCodecFactory getCodec()
-
setCodec
public void setCodec(org.apache.mina.filter.codec.ProtocolCodecFactory codec)
To use a custom minda codec implementation.
-
getEncoding
public String getEncoding()
-
setEncoding
public void setEncoding(String encoding)
You can configure the encoding (a charset name) to use for the TCP textline codec and the UDP protocol. If not provided, Camel will use the JVM default Charset
-
getWriteTimeout
public long getWriteTimeout()
-
setWriteTimeout
public void setWriteTimeout(long writeTimeout)
Maximum amount of time it should take to send data to the MINA session. Default is 10000 milliseconds.
-
getTimeout
public long getTimeout()
-
setTimeout
public void setTimeout(long timeout)
You can configure the timeout that specifies how long to wait for a response from a remote server. The timeout unit is in milliseconds, so 60000 is 60 seconds.
-
isLazySessionCreation
public boolean isLazySessionCreation()
-
setLazySessionCreation
public void setLazySessionCreation(boolean lazySessionCreation)
Sessions can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started.
-
isTransferExchange
public boolean isTransferExchange()
-
setTransferExchange
public void setTransferExchange(boolean transferExchange)
Only used for TCP. You can transfer the exchange over the wire instead of just the body. The following fields are transferred: In body, Out body, fault body, In headers, Out headers, fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level.
-
setEncoderMaxLineLength
public void setEncoderMaxLineLength(int encoderMaxLineLength)
To set the textline protocol encoder max line length. By default the default value of Mina itself is used which are Integer.MAX_VALUE.
-
getEncoderMaxLineLength
public int getEncoderMaxLineLength()
-
setDecoderMaxLineLength
public void setDecoderMaxLineLength(int decoderMaxLineLength)
To set the textline protocol decoder max line length. By default the default value of Mina itself is used which are 1024.
-
getDecoderMaxLineLength
public int getDecoderMaxLineLength()
-
isMinaLogger
public boolean isMinaLogger()
-
setMinaLogger
public void setMinaLogger(boolean minaLogger)
You can enable the Apache MINA logging filter. Apache MINA uses slf4j logging at INFO level to log all input and output.
-
getFilters
public List<org.apache.mina.core.filterchain.IoFilter> getFilters()
-
setFilters
public void setFilters(List<org.apache.mina.core.filterchain.IoFilter> filters)
You can set a list of Mina IoFilters to use.
-
isDatagramProtocol
public boolean isDatagramProtocol()
-
setAllowDefaultCodec
public void setAllowDefaultCodec(boolean allowDefaultCodec)
The mina component installs a default codec if both, codec is null and textline is false. Setting allowDefaultCodec to false prevents the mina component from installing a default codec as the first element in the filter chain. This is useful in scenarios where another filter must be the first in the filter chain, like the SSL filter.
-
isAllowDefaultCodec
public boolean isAllowDefaultCodec()
-
isDisconnect
public boolean isDisconnect()
-
setDisconnect
public void setDisconnect(boolean disconnect)
Whether to disconnect(close) from Mina session right after use. Can be used for both consumer and producer.
-
isDisconnectOnNoReply
public boolean isDisconnectOnNoReply()
-
setDisconnectOnNoReply
public void setDisconnectOnNoReply(boolean disconnectOnNoReply)
If sync is enabled then this option dictates MinaConsumer if it should disconnect where there is no reply to send back.
-
getNoReplyLogLevel
public org.apache.camel.LoggingLevel getNoReplyLogLevel()
-
setNoReplyLogLevel
public void setNoReplyLogLevel(org.apache.camel.LoggingLevel noReplyLogLevel)
If sync is enabled this option dictates MinaConsumer which logging level to use when logging a there is no reply to send back.
-
getSslContextParameters
public org.apache.camel.support.jsse.SSLContextParameters getSslContextParameters()
-
setSslContextParameters
public void setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
To configure SSL security.
-
isAutoStartTls
public boolean isAutoStartTls()
-
setAutoStartTls
public void setAutoStartTls(boolean autoStartTls)
Whether to auto start SSL handshake.
-
getMaximumPoolSize
public int getMaximumPoolSize()
-
setMaximumPoolSize
public void setMaximumPoolSize(int maximumPoolSize)
Number of worker threads in the worker pool for TCP and UDP
-
isOrderedThreadPoolExecutor
public boolean isOrderedThreadPoolExecutor()
-
setOrderedThreadPoolExecutor
public void setOrderedThreadPoolExecutor(boolean orderedThreadPoolExecutor)
Whether to use ordered thread pool, to ensure events are processed orderly on the same channel.
-
setCachedAddress
public void setCachedAddress(boolean shouldCacheAddress)
Whether to create the InetAddress once and reuse. Setting this to false allows to pickup DNS changes in the network.
-
isCachedAddress
public boolean isCachedAddress()
-
setClientMode
public void setClientMode(boolean clientMode)
If the clientMode is true, mina consumer will connect the address as a TCP client.
-
isClientMode
public boolean isClientMode()
-
getUriString
public String getUriString()
-
-