Configuring a plugin environment
A plugin operates in the context of one or more environments. For example, an installation might define separate environments for production and test. In a clustered environment, a plugin operates on one or more servers.
Specifying plugin operation for environments and servers
Specify the environments in which a plugin operates by using the Plugins Registry editor to set the Environment property. Multiple environments can be specified in the Environment property by separating each environment with a comma. For example, if environments have been defined for production and test, a plugin operates in either environment or both of them depending on the value you set for the environment property. If you specify any value in the environment property, the plugin only operates in an environment that matches the value of that property.
By default, a plugin can operate on any server. If PolicyCenter is running in a clustered environment, to restrict the plugin so that it operates only on a specific server, specify the server ID in the Server property.
If you do not specify a value for the environment property, the plugin operates in all environments. If you do not specify a value for the server property, the plugin operates on all servers.
Configuring parameter values for environments and servers
To configure a plugin's operation for a particular environment, you can specify parameter values that apply to that environment. During its execution, the plugin uses a parameter's value to determine the actions to perform. Environment values are specified for particular parameter Name and Value property pairs.
If the plugin operates in an environment that is not specified for a particular parameter, you can provide a default value for the parameter by adding a line containing a value for the parameter but leaving the environment property for the parameter empty. Alternatively, the plugin code can provide a default value for the parameter.
For example, consider a plugin that operates in an environment called
production. The plugin provides a parameter called
loglevel. For the production environment, the
parameter's value is error. If the plugin is running in the
production environment, retrieving the value of the
loglevel parameter instructs the plugin to log events of type
error.
| Name | Value | Environment |
|---|---|---|
| loglevel | error | production |
To extend the example, assume the plugin also operates in an environment called
test. If both environments are specified in a single, comma-separated
Environment value, the value of error is used for
the loglevel parameter if the plugin operates in either environment.
| Name | Value | Environment |
|---|---|---|
| loglevel | error | production,test |
To assign a different loglevel value for each environment, specify the
environments on separate lines in the list of plugin parameters. The
loglevel parameter can then provide different values specific to each
environment. The plugin retrieves a different loglevel value based on the
environment in which it is operating.
| Name | Value | Environment |
|---|---|---|
| loglevel | error | production |
| loglevel | debug | test |
| loglevel | warning |
A parameter that does not specify the environment property uses the same value for all
environments. In the following context, the incomingFileDir parameter uses
the value /tmp/inbound/incoming for both the
production and test environments.
| Name | Value | Environment |
|---|---|---|
| loglevel | error | production |
| loglevel | debug | test |
| incomingFileDir | /tmp/inbound/incoming |
By default, a plugin uses the same value for a parameter on any server. If PolicyCenter is running in a clustered environment, you can assign different values for a plugin parameter for specific servers by specifying the server ID in the Server property. You can provide a default value for a plugin parameter by adding a line containing a value for the parameter but leaving the server property for the parameter empty. Alternatively, the plugin code can provide a default value for the parameter.
| Name | Value | Environment | Server |
|---|---|---|---|
| transferTimeoutSec | 15 | messaging | |
| transferTimeoutSec | 10 | shorttimeout | |
| transferTimeoutSec | 120 |
A parameter that does not specify the server property uses the same value on all servers.
See also
