A Java™ agent can
connect to an external system to send or retrieve data or events.
If the connection requires authentication credentials such as user
name and password, you can store the authentication information as
custom solution properties. The Java agent
uses the getConnection and getproperty APIs
to connect to and authenticate with the external system.
Before you begin
Custom solution properties, such as user authentication credentials
for connecting to an external system, are stored in the
solution_properties.xml file
in the root folder of the solution project. To store user authentication
information in a solution property, edit an existing
solution_properties.xml file,
or create a new properties file.
Procedure
- Add a property element with a name and value pair for each
authentication credential. For example:
<?xml version="1.1" encoding="UTF-8"?>
<properties>
<property name="db_username">JoeSmith</property>
<property name="db_password" override_required="true"></property>
</properties>
where JoeSmith is the
value of the user name authentication credential. The password
credential must be secure, so it is not stored in the properties file
in plain text form. The override_required parameter
in the db_password property indicates that the
property value must be modified by the administrator who runs the solutionManager setproperty command.
- The Java agent retrieves
the value of the password credential by calling the getSolutionProperty method. If the property value is not set for the db_password property,
the getproperty method returns a null value. See Overriding solution properties.