org.rhq.enterprise.communications.command.client
Class ClientCommandSenderConfiguration

java.lang.Object
  extended by org.rhq.enterprise.communications.command.client.ClientCommandSenderConfiguration
All Implemented Interfaces:
Serializable

public class ClientCommandSenderConfiguration
extends Object
implements Serializable

This is a simple object that encapsulates initial configuration settings for the client command sender. Its purpose is to make the ClientCommandSender constructor less prone to change as new configuration items are added in future versions. There are no getter/setter methods - this object provides public access to all data members. There is a copy() method should you wish to make a copy of these values.

Author:
John Mazzitelli
See Also:
Serialized Form

Field Summary
 String commandPreprocessors
          A fully qualified class name of a CommandPreprocessor implementation that will be used to preprocess all commands that are to be queued and sent by the client command sender.
 boolean commandSpoolFileCompressData
          If this flag is true, the commands stored in the spool file will be compressed.
 long commandSpoolFileMaxSize
          This is the maximum size of the command spool file.
 String commandSpoolFileName
          The name of the command spool file (to be located in the dataDirectory}.
 int commandSpoolFilePurgePercentage
          If the command spool file crosses its max size threshold and a purge is initiated, this is the percentage of bytes the command spool file will be allowed to be after the purge completes.
 File dataDirectory
          A path to a data directory where this sender can store things on the file system - like persisted commands.
 long defaultTimeoutMillis
          milliseconds to wait for a command to be sent before timing out (commands can override this in their configuration).
 boolean enableQueueThrottling
          If true, the sender will be initialized with queue throttling enabled.
 boolean enableSendThrottling
          If true, then "send throttling" will be enabled.
 int maxConcurrent
          the maximum number of commands that can concurrently be sent.
 int maxRetries
          If a guaranteed delivery message is sent, but the sender fails to connect to the server and deliver the message, it will always be retried.
 int queueSize
          the maximum number of commands that can be queued up (if 0 or less, its unbounded).
 long queueThrottleBurstPeriodMillis
          The number of milliseconds the queue throttling mechanism will wait before allowing more commands (over the maxConcurrent) to be dequeued.
 long queueThrottleMaxCommands
          The maximum number of commands that can be dequeued during a burst period.
 long retryInterval
          This is the time period the sender will wait before retrying to send a guaranteed command that previously failed.
 String securityKeystoreAlgorithm
          The key management algorithm used in the keystore file.
 String securityKeystoreAlias
          The alias of the client key within the keystore file.
 String securityKeystoreFile
          The path to the keystore file (that contain's the client's key).
 String securityKeystoreKeyPassword
          The password that gains access to the client key within the keystore file.
 String securityKeystorePassword
          The password that gains access to the keystore file.
 String securityKeystoreType
          The type of file that the keystore file is.
 String securitySecureSocketProtocol
          The secure protocol used when connecting to the remote server's socket.
 boolean securityServerAuthMode
          When sending over an SSL socket, this will determine if the server must be authenticated in order for the handshake to be successful.
 String securityTruststoreAlgorithm
          The key management algorithm used in the truststore file.
 String securityTruststoreFile
          The path to the truststore that contains the public keys of all trusted remote endpoints.
 String securityTruststorePassword
          The password that gains access to the truststore file.
 String securityTruststoreType
          The type of file that the truststore file is.
 long sendThrottleMaxCommands
          The maximum number of commands that are allowed to be sent before the send throttling's quiet period starts.
 long sendThrottleQuietPeriodDurationMillis
          The duration of the send throttling's quiet period.
 long serverPollingIntervalMillis
          If larger than 0, this indicates the sender should periodically poll the server to make sure its still up or (if it was down) see when it comes back up.
 
Constructor Summary
ClientCommandSenderConfiguration()
           
 
Method Summary
 void clearSecuritySettings()
          If the caller knows this configuration will be assigned to a client command sender that will never need SSL security, the caller can clear (i.e.
 ClientCommandSenderConfiguration copy()
          Makes a copy of this object; use this if you wish to isolate the caller from seeing changes made to the original object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queueSize

public int queueSize
the maximum number of commands that can be queued up (if 0 or less, its unbounded).


maxConcurrent

public int maxConcurrent
the maximum number of commands that can concurrently be sent.


defaultTimeoutMillis

public long defaultTimeoutMillis
milliseconds to wait for a command to be sent before timing out (commands can override this in their configuration). If this is less than or equal to 0, by default a command is never timed out (while this could conceivably cause a thread to hang waiting for a rogue command to never finish, it also reduces the amount of short-lived threads created by the system and increases throughput).


enableQueueThrottling

public boolean enableQueueThrottling
If true, the sender will be initialized with queue throttling enabled. The throttling parameters are defined by queueThrottleMaxCommands and queueThrottleBurstPeriodMillis. If false, the sender will disable its queue throttling mechanism and dequeue commands as fast as it can.


queueThrottleMaxCommands

public long queueThrottleMaxCommands
The maximum number of commands that can be dequeued during a burst period. This defines the size of each "burst".

This will be ignored if enableQueueThrottling is false.


queueThrottleBurstPeriodMillis

public long queueThrottleBurstPeriodMillis
The number of milliseconds the queue throttling mechanism will wait before allowing more commands (over the maxConcurrent) to be dequeued. This is the time period of each "burst".

This will be ignored if enableQueueThrottling is false.


enableSendThrottling

public boolean enableSendThrottling
If true, then "send throttling" will be enabled. This means that messages will not be sent during a quiet period defined by the send throttling parameters sendThrottleMaxCommands and sendThrottleQuietPeriodDurationMillis. If false then all messages that are asked to be sent will be sent immediately without a quiet period being enforced. Note that only commands that are configured for "send-throtting" will be affected by this setting.


sendThrottleMaxCommands

public long sendThrottleMaxCommands
The maximum number of commands that are allowed to be sent before the send throttling's quiet period starts.

This will be ignored if enableSendThrottling is false.


sendThrottleQuietPeriodDurationMillis

public long sendThrottleQuietPeriodDurationMillis
The duration of the send throttling's quiet period. Commands will not be sent during this quiet period, unless the commands are configured to explicitly ignore the send throttling quiet period.

This will be ignored if enableSendThrottling is false.


serverPollingIntervalMillis

public long serverPollingIntervalMillis
If larger than 0, this indicates the sender should periodically poll the server to make sure its still up or (if it was down) see when it comes back up. The value is the number of milliseconds to wait in between polls.


dataDirectory

public File dataDirectory
A path to a data directory where this sender can store things on the file system - like persisted commands.


retryInterval

public long retryInterval
This is the time period the sender will wait before retrying to send a guaranteed command that previously failed. Note: if the sender is currently waiting in this retry period, the agent will not be able to be shutdown. If the agent is asked to shutdown, it will wait until any current retries are completed. This is to help ensure those commands are not lost.


maxRetries

public int maxRetries
If a guaranteed delivery message is sent, but the sender fails to connect to the server and deliver the message, it will always be retried. However, if the error was something other than a "cannot connect" error, the command will only be retried this amount of times before the command is dropped. When this happens, the guaranteed command will never be delivered. This will normally happen under very odd and rare circumstances (bugs in the software is one cause).


commandSpoolFileName

public String commandSpoolFileName
The name of the command spool file (to be located in the dataDirectory}. If this value is null, it will be assumed that commands should not be persisted (this means guaranteed delivery will be implicitly unsupported).


commandSpoolFileMaxSize

public long commandSpoolFileMaxSize
This is the maximum size of the command spool file. If the file grows beyond this, it will be purged in order to shrink its size down.


commandSpoolFilePurgePercentage

public int commandSpoolFilePurgePercentage
If the command spool file crosses its max size threshold and a purge is initiated, this is the percentage of bytes the command spool file will be allowed to be after the purge completes. This is a percentage of commandSpoolFileMaxSize. See PersistentFifo for more info on this parameter.


commandSpoolFileCompressData

public boolean commandSpoolFileCompressData
If this flag is true, the commands stored in the spool file will be compressed. This can potentially save about 30%-40% in disk space (give or take), however, it slows down the persistence considerably. Recommended setting for this should be false unless something on the agent's deployment box warrants disk-saving over persistence performance. The performance hit will only appear when unusual conditions occur, such as shutting down while some guaranteed commands haven't been sent yet or while the server is down. It will not affect the agent under normal conditions (while running with the server up and communicating with the agent). In those unusual/rare conditions, having performance degradation may not be as important.


commandPreprocessors

public String commandPreprocessors
A fully qualified class name of a CommandPreprocessor implementation that will be used to preprocess all commands that are to be queued and sent by the client command sender. May be null or empty string in which case no preprocessor is specified. You may optionally specify multiple class names, separating each class name with a colon (e.g. org.foo.Preproc1:org.foo.Preproc2).


securityServerAuthMode

public boolean securityServerAuthMode
When sending over an SSL socket, this will determine if the server must be authenticated in order for the handshake to be successful.


securityKeystoreFile

public String securityKeystoreFile
The path to the keystore file (that contain's the client's key).


securityKeystoreType

public String securityKeystoreType
The type of file that the keystore file is.


securityKeystoreAlgorithm

public String securityKeystoreAlgorithm
The key management algorithm used in the keystore file.


securityKeystorePassword

public String securityKeystorePassword
The password that gains access to the keystore file.


securityKeystoreKeyPassword

public String securityKeystoreKeyPassword
The password that gains access to the client key within the keystore file.


securityKeystoreAlias

public String securityKeystoreAlias
The alias of the client key within the keystore file.


securityTruststoreFile

public String securityTruststoreFile
The path to the truststore that contains the public keys of all trusted remote endpoints.


securityTruststoreType

public String securityTruststoreType
The type of file that the truststore file is.


securityTruststoreAlgorithm

public String securityTruststoreAlgorithm
The key management algorithm used in the truststore file.


securityTruststorePassword

public String securityTruststorePassword
The password that gains access to the truststore file.


securitySecureSocketProtocol

public String securitySecureSocketProtocol
The secure protocol used when connecting to the remote server's socket.

Constructor Detail

ClientCommandSenderConfiguration

public ClientCommandSenderConfiguration()
Method Detail

copy

public ClientCommandSenderConfiguration copy()
Makes a copy of this object; use this if you wish to isolate the caller from seeing changes made to the original object.

Returns:
a copy of the configuration values

clearSecuritySettings

public void clearSecuritySettings()
If the caller knows this configuration will be assigned to a client command sender that will never need SSL security, the caller can clear (i.e. set to null) all the security-related configuration settings.

This is useful because if JBoss/Remoting sees security configuration, it will attempt to create an SSL socket factory even if the transport won't actually need it. See org.jboss.remoting.AbstractInvoker.needsCustomSSLConfiguration().



Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.