Configuration Variables
Goal
We use the J2EE standards to expose configuration variables to users (instead of using
.properties file). This section describes how to map new variables.
How to add and expose new variables
- In the web.xml in rpm-web-services, add the new variable definition.
Include the type and documentation.
- In the ibm-web-bnd.xmi in rpm-web-services, add the new variable mapping
- In RpmOptions.java from rpm-data, add a constant for the variable name
- In RpmOptions.java from rpm-data, add a constant for the default variable value
- In RpmOptions.java from rpm-data, add a getter method to fetch the variable
- In the API User guide, add the documentation for your parameter in chapter 4.
Here is a sample variable in the web.xml:
<resource-env-ref id="ResourceEnvRef_webServicesEnabled">
<description>This flag indicates if the web services are enabled or not.
The default value is: True.
</description>
<resource-env-ref-name>webServicesEnabled</resource-env-ref-name>
<resource-env-ref-type>java.lang.Boolean</resource-env-ref-type>
</resource-env-ref>
Here is a sample variable mapping in the ibm-web-bnd.xmi:
<resourceEnvRefBindings xmi:id="ResourceEnvRef_webServicesEnabled" jndiName="com/ibm/rpm/webServicesEnabled">
<bindingResourceEnvRef href="WEB-INF/web.xml#ResourceEnvRef_webServicesEnabled"/>
</resourceEnvRefBindings>
How to override options
Using the ServerFactory, you can get the options and call the method
overrideOption. This will bypass the JNDI data mapping and use your
override instead.
Datasource
The datasource is mapped using a J2EE resource-ref of the java.sql.Datasource.
JAAS
JAAS is used for external authentication. Internally, if JAAS is enabled, the API will
try to login on JAAS using the specified JAAS Realm. This operation will tell us
if the user is valid on the JAAS realm and that he has the security flag required
to use RPM. After that, we call SP_SECURE_LOGON on the RPM Database to make sure
that the user really exists on RPM.