flux.agent
Class AgentConfiguration

java.lang.Object
  extended by flux.agent.AgentConfiguration
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class AgentConfiguration
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

A specification of how to make a Flux agent.

Author:
Copyright 2014 Flux Corporation. All rights reserved.
See Also:
Serialized Form

Field Summary
static java.lang.String CONCURRENCY_THROTTLE
          The number of processes that can execute simultaneously on this agent.
static int DEFAULT_CONCURRENCY_THROTTLE
          Default value is 10.
static int DEFAULT_ENGINE_PORT
          Default value is 7520.
static boolean DEFAULT_ENGINE_SSL
          Default value is true.
static java.lang.String DEFAULT_INTERNAL_LOGGER_FILE_DIRECTORY
          The default value is "
static long DEFAULT_INTERNAL_LOGGER_FILE_ROTATION_SIZE
          The default size is 10485760 (ten megabytes, 10 * 1024 * 1024).
static java.lang.String DEFAULT_LOG_FILENAME
          Default value is flux-agent.log.
static java.lang.String ENGINE_ENCRYPTED_PASSWORD
          The encrypted password this agent uses to login to a remote Flux engine.
static java.lang.String ENGINE_HOST
          The host name of the Flux engine with which an agent intends to register.
static java.lang.String ENGINE_PASSWORD
          The password this agent uses to login to a remote Flux engine.
static java.lang.String ENGINE_PORT
          The TCP/IP port to which a remote Flux engine listens.
static java.lang.String ENGINE_SSL
          Indicates whether the remote Flux engine is secured using SSL.
static java.lang.String ENGINE_USERNAME
          The username this agent uses to login to a remote Flux engine.
static java.lang.String ID_DESCRIPTION
          A description of the agent instance intended for human consumption.
static java.lang.String ID_NAME
          The case-insensitive name of the agent instance.
static java.lang.String INTERNAL_LOGGER_FILE_DIRECTORY
          The directory where log files are placed.
static java.lang.String INTERNAL_LOGGER_FILE_ROTATION_SIZE
          The maximum size to which a log file for the internal asynchronous and internal synchronous loggers can grow before it is rotated.
static java.lang.String LOG_FILENAME
          The name of the log file to which agent logs are written.
static java.lang.String POOL
          The name of the agent pool in which this agent resides.
 
Constructor Summary
AgentConfiguration()
          Creates a new agent configuration using default configuration properties.
AgentConfiguration(java.io.InputStream propertiesInputStream)
          Creates a new agent configuration using the supplied agent configuration input stream.
AgentConfiguration(java.util.Properties properties)
          Creates a new agent configuration using the supplied agent configuration properties.
AgentConfiguration(java.lang.String propertiesFile)
          Creates a new agent configuration using the supplied agent configuration file.
 
Method Summary
 java.lang.Object clone()
          Returns a deep copy of this Configuration object.
 int getConcurrencyThrottle()
          Returns the CONCURRENCY_THROTTLE agent configuration property.
 java.lang.String getEngineEncryptedPassword()
          Returns the ENGINE_ENCRYPTED_PASSWORD agent configuration property.
 java.lang.String getEngineHost()
          Returns the ENGINE_HOST agent configuration property.
 java.lang.String getEnginePassword()
          Returns the ENGINE_PASSWORD agent configuration property.
 int getEnginePort()
          Returns the ENGINE_PORT agent configuration property.
 boolean getEngineSsl()
          Returns the ENGINE_SSL agent configuration property.
 java.lang.String getEngineUsername()
          Returns the ENGINE_USERNAME agent configuration property.
 java.lang.String getIdDescription()
          Returns the ID_DESCRIPTION agent configuration property.
 java.lang.String getIdName()
          Returns the ID_NAME agent configuration property.
 java.lang.String getInternalLoggerFileDirectory()
          Returns the INTERNAL_LOGGER_FILE_DIRECTORY agent configuration property.
 long getInternalLoggerFileRotationSize()
          Returns the INTERNAL_LOGGER_FILE_ROTATION_SIZE agent configuration property.
 java.lang.String getLogFilename()
          Returns the LOG_FILENAME agent configuration property.
 java.lang.String getPool()
          Returns the POOL agent configuration property.
 void setConcurrencyThrottle(int concurrencyThrottle)
          Sets the CONCURRENCY_THROTTLE agent configuration property.
 void setEngineEncryptedPassword(java.lang.String engineEncryptedPassword)
          Sets the ENGINE_ENCRYPTED_PASSWORD agent configuration property.
 void setEngineHost(java.lang.String engineHost)
          Sets the ENGINE_HOST agent configuration property.
 void setEnginePassword(java.lang.String enginePassword)
          Sets the ENGINE_PASSWORD agent configuration property.
 void setEnginePort(int port)
          Sets the ENGINE_PORT agent configuration property.
 void setEngineSsl(boolean ssl)
          Sets the ENGINE_SSL agent configuration property.
 void setEngineUsername(java.lang.String engineUsername)
          Sets the ENGINE_USERNAME agent configuration property.
 void setIdDescription(java.lang.String idDescription)
          Sets the ID_DESCRIPTION agent configuration property.
 void setIdName(java.lang.String idName)
          Sets the ID_NAME agent configuration property.
 void setInternalLoggerFileDirectory(java.lang.String internalLoggerFileDirectory)
          Returns the INTERNAL_LOGGER_FILE_DIRECTORY agent configuration property.
 void setInternalLoggerFileRotationSize(long internalLoggerFileRotationSize)
          Returns the INTERNAL_LOGGER_FILE_ROTATION_SIZE agent configuration property.
 void setLogFilename(java.lang.String logFilename)
          Sets the LOG_FILENAME agent configuration property.
 void setPool(java.lang.String pool)
          Sets the POOL agent configuration property.
 void verify()
          Indicates whether this agent configuration is valid.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONCURRENCY_THROTTLE

public static final java.lang.String CONCURRENCY_THROTTLE
The number of processes that can execute simultaneously on this agent.

See Also:
Constant Field Values

DEFAULT_CONCURRENCY_THROTTLE

public static final int DEFAULT_CONCURRENCY_THROTTLE
Default value is 10.

See Also:
Constant Field Values

ENGINE_ENCRYPTED_PASSWORD

public static final java.lang.String ENGINE_ENCRYPTED_PASSWORD
The encrypted password this agent uses to login to a remote Flux engine.

This property cannot be set if ENGINE_PASSWORD contains a non-null value.

See Also:
ENGINE_PASSWORD, Constant Field Values

ENGINE_HOST

public static final java.lang.String ENGINE_HOST
The host name of the Flux engine with which an agent intends to register. When an agent registers with an engine, the agent effectively registers with all engines in that cluster.

See Also:
Constant Field Values

ENGINE_PASSWORD

public static final java.lang.String ENGINE_PASSWORD
The password this agent uses to login to a remote Flux engine.

This property cannot be set if ENGINE_ENCRYPTED_PASSWORD contains a non-null value.

See Also:
ENGINE_ENCRYPTED_PASSWORD, Constant Field Values

ENGINE_PORT

public static final java.lang.String ENGINE_PORT
The TCP/IP port to which a remote Flux engine listens. An agent uses this port when registering with a Flux engine.

See Also:
Constant Field Values

DEFAULT_ENGINE_PORT

public static final int DEFAULT_ENGINE_PORT
Default value is 7520.

See Also:
Configuration.DEFAULT_PORT, Constant Field Values

ENGINE_SSL

public static final java.lang.String ENGINE_SSL
Indicates whether the remote Flux engine is secured using SSL.

See Also:
Constant Field Values

DEFAULT_ENGINE_SSL

public static final boolean DEFAULT_ENGINE_SSL
Default value is true.

See Also:
Configuration.DEFAULT_SSL, Constant Field Values

ENGINE_USERNAME

public static final java.lang.String ENGINE_USERNAME
The username this agent uses to login to a remote Flux engine.

See Also:
Constant Field Values

ID_DESCRIPTION

public static final java.lang.String ID_DESCRIPTION
A description of the agent instance intended for human consumption.

See Also:
Constant Field Values

ID_NAME

public static final java.lang.String ID_NAME
The case-insensitive name of the agent instance. Used to differentiate agent instances in the logs and the audit trail. If the name is not set explicitly in a configuration, the configuration will generate a name using:

1. The host name of the local computer but not "localhost". For example, "foo" or "foo.bar.com".

2. Failing that, the IP address of the local computer but not "127.0.0.1". For example, "12.34.56.78".

3. Failing that, "unknown".

If there is more than one active agent in a JVM, each generated name is made unique. To make a generated name unique, a ":" symbol is first appended to the name that is generated as described above. Second, a number, starting from one, is appended to ensure that the generated name is unique within the JVM.

See Also:
Constant Field Values

LOG_FILENAME

public static final java.lang.String LOG_FILENAME
The name of the log file to which agent logs are written.

See Also:
Constant Field Values

DEFAULT_LOG_FILENAME

public static final java.lang.String DEFAULT_LOG_FILENAME
Default value is flux-agent.log.

See Also:
Constant Field Values

INTERNAL_LOGGER_FILE_DIRECTORY

public static final java.lang.String INTERNAL_LOGGER_FILE_DIRECTORY
The directory where log files are placed.

See Also:
Constant Field Values

DEFAULT_INTERNAL_LOGGER_FILE_DIRECTORY

public static final java.lang.String DEFAULT_INTERNAL_LOGGER_FILE_DIRECTORY
The default value is ".", which is equivalent to the system property "user.dir", the user's current working directory.

See Also:
Constant Field Values

INTERNAL_LOGGER_FILE_ROTATION_SIZE

public static final java.lang.String INTERNAL_LOGGER_FILE_ROTATION_SIZE
The maximum size to which a log file for the internal asynchronous and internal synchronous loggers can grow before it is rotated. At most, there are seven log files, which include the current log file and up to six previously rotated log files. The rotation size is specified in bytes.

See Also:
Constant Field Values

DEFAULT_INTERNAL_LOGGER_FILE_ROTATION_SIZE

public static final long DEFAULT_INTERNAL_LOGGER_FILE_ROTATION_SIZE
The default size is 10485760 (ten megabytes, 10 * 1024 * 1024).

See Also:
Constant Field Values

POOL

public static final java.lang.String POOL
The name of the agent pool in which this agent resides. The name is case-insensitive. The name of the pool may not be "*", which has special meaning for Process Actions that set pool names. For a Process Action, a pool name of "*" indicates that a process may run on any agent.

See Also:
Constant Field Values
Constructor Detail

AgentConfiguration

public AgentConfiguration()
Creates a new agent configuration using default configuration properties.


AgentConfiguration

public AgentConfiguration(java.io.InputStream propertiesInputStream)
                   throws AgentException
Creates a new agent configuration using the supplied agent configuration input stream. The input stream will not be closed.

Parameters:
propertiesInputStream - A specification of how to make an agent. The input stream will not be closed.
Throws:
AgentException - If a system error occurs.

AgentConfiguration

public AgentConfiguration(java.util.Properties properties)
                   throws AgentException
Creates a new agent configuration using the supplied agent configuration properties.

Parameters:
properties - A specification of how to make an agent.
Throws:
AgentException - If a system error occurs.
java.lang.IllegalArgumentException - If the specified properties object is null.

AgentConfiguration

public AgentConfiguration(java.lang.String propertiesFile)
                   throws AgentException
Creates a new agent configuration using the supplied agent configuration file.

Parameters:
propertiesFile - A specification of how to make an agent.
Throws:
AgentException - If a system error occurs.
Method Detail

getConcurrencyThrottle

public int getConcurrencyThrottle()
Returns the CONCURRENCY_THROTTLE agent configuration property.

Returns:
The CONCURRENCY_THROTTLE agent configuration property.
See Also:
CONCURRENCY_THROTTLE

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a deep copy of this Configuration object.

Overrides:
clone in class java.lang.Object
Returns:
A deep copy of this Configuration object.
Throws:
java.lang.CloneNotSupportedException - If an error occurs.

getEngineEncryptedPassword

public java.lang.String getEngineEncryptedPassword()
Returns the ENGINE_ENCRYPTED_PASSWORD agent configuration property.

Returns:
The ENGINE_ENCRYPTED_PASSWORD agent configuration property.
See Also:
ENGINE_ENCRYPTED_PASSWORD

getEngineHost

public java.lang.String getEngineHost()
Returns the ENGINE_HOST agent configuration property.

Returns:
The ENGINE_HOST agent configuration property.
See Also:
ENGINE_HOST

getEnginePassword

public java.lang.String getEnginePassword()
Returns the ENGINE_PASSWORD agent configuration property.

Returns:
The ENGINE_PASSWORD agent configuration property.
See Also:
ENGINE_PASSWORD

getEnginePort

public int getEnginePort()
Returns the ENGINE_PORT agent configuration property.

Returns:
The ENGINE_PORT agent configuration property.
See Also:
ENGINE_PORT

getEngineSsl

public boolean getEngineSsl()
Returns the ENGINE_SSL agent configuration property.

Returns:
The ENGINE_SSL agent configuration property.
See Also:
ENGINE_SSL

getEngineUsername

public java.lang.String getEngineUsername()
Returns the ENGINE_USERNAME agent configuration property.

Returns:
The ENGINE_USERNAME agent configuration property.
See Also:
ENGINE_USERNAME

getIdDescription

public java.lang.String getIdDescription()
Returns the ID_DESCRIPTION agent configuration property.

Returns:
The ID_DESCRIPTION agent configuration property.
See Also:
ID_DESCRIPTION

getIdName

public java.lang.String getIdName()
Returns the ID_NAME agent configuration property.

Returns:
The ID_NAME agent configuration property.
See Also:
ID_NAME

getLogFilename

public java.lang.String getLogFilename()
Returns the LOG_FILENAME agent configuration property.

Returns:
The LOG_FILENAME agent configuration property.
See Also:
LOG_FILENAME

getInternalLoggerFileDirectory

public java.lang.String getInternalLoggerFileDirectory()
Returns the INTERNAL_LOGGER_FILE_DIRECTORY agent configuration property.

Returns:
The INTERNAL_LOGGER_FILE_DIRECTORY agent configuration property.
See Also:
INTERNAL_LOGGER_FILE_DIRECTORY

getInternalLoggerFileRotationSize

public long getInternalLoggerFileRotationSize()
Returns the INTERNAL_LOGGER_FILE_ROTATION_SIZE agent configuration property.

Returns:
The INTERNAL_LOGGER_FILE_ROTATION_SIZE agent configuration property.
See Also:
INTERNAL_LOGGER_FILE_ROTATION_SIZE

getPool

public java.lang.String getPool()
Returns the POOL agent configuration property.

Returns:
The POOL agent configuration property.
See Also:
POOL

setConcurrencyThrottle

public void setConcurrencyThrottle(int concurrencyThrottle)
Sets the CONCURRENCY_THROTTLE agent configuration property.

Parameters:
concurrencyThrottle - The CONCURRENCY_THROTTLE agent configuration property.
See Also:
CONCURRENCY_THROTTLE

setEngineEncryptedPassword

public void setEngineEncryptedPassword(java.lang.String engineEncryptedPassword)
Sets the ENGINE_ENCRYPTED_PASSWORD agent configuration property.

Parameters:
engineEncryptedPassword - The ENGINE_ENCRYPTED_PASSWORD agent configuration property.
See Also:
ENGINE_ENCRYPTED_PASSWORD

setEngineHost

public void setEngineHost(java.lang.String engineHost)
Sets the ENGINE_HOST agent configuration property.

Parameters:
engineHost - The ENGINE_HOST agent configuration property.
See Also:
ENGINE_HOST

setEnginePassword

public void setEnginePassword(java.lang.String enginePassword)
Sets the ENGINE_PASSWORD agent configuration property.

Parameters:
enginePassword - The ENGINE_PASSWORD agent configuration property.
See Also:
ENGINE_PASSWORD

setEnginePort

public void setEnginePort(int port)
Sets the ENGINE_PORT agent configuration property.

Parameters:
port - The ENGINE_PORT agent configuration property.
See Also:
ENGINE_PORT

setEngineSsl

public void setEngineSsl(boolean ssl)
Sets the ENGINE_SSL agent configuration property.

Parameters:
ssl - The ENGINE_SSL agent configuration property.
See Also:
ENGINE_SSL

setEngineUsername

public void setEngineUsername(java.lang.String engineUsername)
Sets the ENGINE_USERNAME agent configuration property.

Parameters:
engineUsername - The ENGINE_USERNAME agent configuration property.
See Also:
ENGINE_USERNAME

setIdDescription

public void setIdDescription(java.lang.String idDescription)
Sets the ID_DESCRIPTION agent configuration property.

Parameters:
idDescription - The ID_DESCRIPTION agent configuration property.
See Also:
ID_DESCRIPTION

setIdName

public void setIdName(java.lang.String idName)
Sets the ID_NAME agent configuration property.

Parameters:
idName - The ID_NAME agent configuration property.
See Also:
ID_NAME

setLogFilename

public void setLogFilename(java.lang.String logFilename)
Sets the LOG_FILENAME agent configuration property.

Parameters:
logFilename - The LOG_FILENAME agent configuration property.
See Also:
LOG_FILENAME

setInternalLoggerFileDirectory

public void setInternalLoggerFileDirectory(java.lang.String internalLoggerFileDirectory)
Returns the INTERNAL_LOGGER_FILE_DIRECTORY agent configuration property.

Parameters:
internalLoggerFileDirectory - The INTERNAL_LOGGER_FILE_DIRECTORY agent configuration property.
See Also:
INTERNAL_LOGGER_FILE_DIRECTORY

setInternalLoggerFileRotationSize

public void setInternalLoggerFileRotationSize(long internalLoggerFileRotationSize)
Returns the INTERNAL_LOGGER_FILE_ROTATION_SIZE agent configuration property.

Parameters:
internalLoggerFileRotationSize - The INTERNAL_LOGGER_FILE_ROTATION_SIZE agent configuration property.
See Also:
INTERNAL_LOGGER_FILE_ROTATION_SIZE

setPool

public void setPool(java.lang.String pool)
             throws java.lang.IllegalArgumentException
Sets the POOL agent configuration property.

Parameters:
pool - The POOL agent configuration property.
Throws:
java.lang.IllegalArgumentException - If the name of the pool is "*". Pool names of "*" have special meaning for Process Actions that set pool names. For a Process Action, a pool name of "*" indicates that a process may run on any agent.
See Also:
POOL

verify

public void verify()
            throws AgentException
Indicates whether this agent configuration is valid.

Throws:
AgentException - If this agent configuration is not valid.


© 2014 Flux Corporation. All rights reserved.