|
12.1 Supported Storage Types for MBeans : An Overview
12.2 Configuring Storage Types for MBeans
12.1 Supported Storage Types for MBeans : An Overview
Data held by the Multi-Protocol agent may either be stored in Text files, or in XML files, or in databases or be retrieved from external applications using system calls or from internal applications. The storage options depend on the data held by the run time agent. The AdventNet Multi-Protocol agent supports to provide the following storage options for the data held by agent.
Text
File : Provides a text file for all the attributes of tabular
MBeans at agent startup. When the agent is restarted, the agent API reads
the data in the text file and stores all the data in memory. For Scalar
MBeans, the text files are created for each attribute only after processing
the request and not at agent startup.
The text file is generated in the <Agent Toolkit Home>/jmxprojects/projectname/agent/bin/fileToScalar
directory, only when a get/set is made on its value. This file will
have the latest value of the scalar node and the agent will read the same
when it is restarted. Entries can be modified or included in the text
file during run time and these entries take effect only when the agent
is restarted.
XML
File : Provides a xml file for all the attributes of tabular MBeans
at agent startup. When the agent is restarted, the agent API reads the
data in the text file and stores all the data in memory. XML can be a
persistent storage type only for Tabular MBeans.
The XML file is generated in the <Agent Toolkit Home>/jmxprojects/projectname/agent/bin/xmlToVector
directory, at agent startup. This file will have the latest value of the
tables node and the agent will read the same when it is restarted. Entries
can be modified or included in the XML file during run time and these
entries take effect only when the agent is restarted.
Database
: Provides storage in databases. Usually, databases are used to hold large
volumes of data . In some cases, the data may also be dynamic in nature.
If storage type in database is enabled, the agent API establishes
the connection between agent and the database at agent startup.
The Database name, URL, driver, user name, password, and
table name can be specified in the Database Settings option provided in
the JMX Compiler.
Runtime Memory : Does not provide storage of data in text files, XML files, or databases. The entire data maintained by the agent will be stored in memory at agent startup.
User
Defined: This option can be used if you wish to store
the tabular data values in a different place and would like the table
to respond only when the request reaches the Agent. This option makes
use of the User Storage Model, wherein a JmxTableModelListener Interface
is implemented. The interface, when initialized, calls the respective
methods present in the interface.
Please refer to the topic "JMXTableModelListener"
for more details.
|
|
Note: For non-tabular data, only Runtime Memory and Text File storage are supported. |
12.2 Configuring Storage Types for MBeans
You can configure the required storage option for the MBean attributes using the JMX Compiler UI. Code is generated based on the options specified.
Using JMX Compiler UI
Select Project
-> Settings option. In the Settings Tree Structure, select Source
Code Generation -> Storage Model. This displays the dialog for
the Storage Model on the right side.
Storage Option for Tables
For tabular data, select the storage option from the list provided for Tables. This provides the specified storage type for all the tables present in the MIB. If storage is provided in Database, configure the database settings, using the Configure -> Database option.
To customize the storage option for all or any of the Table nodes in the MIB, select Node Storage Type. From the tables listed in the MIB tree, select a table and define the storage type for that table.
For
example, you want to provide storage in Database for the adiskTable
and storage in text file for all other tables in the AGNT-SAMPLE-MIB.
To do this, select Text File option for Tables. Then, click adiskTable
in the MIB tree and select Node Storage Type as Database.
Storage Option for Scalars
For nontabular data, select the required storage option from the list specified for Scalars. This provides the specified storage type for all the scalars present in the MIB.
Node Storage Type. From the scalars listed in the MIB tree, select a scalar node and define its storage type.
For example, you want to provide storage in text file for all scalar nodes in the MIB, except the node agentLocation in agentSystem of AGENT-SAMPLE-MIB. To do this select Text File option for Scalars. Then, click scalar node agentLocation in the MIB tree and select Node Storage Type as RAM.
If storage in Database is provided for all or any of Tables of a MIB, the following Database parameters have to be provided to access the database. Select the Database option for configuring the following :
Database Name
url
Driver
UserName
Password
For example, let us assume that we have to provide storage in Database for the adiskTable of the AGENT-SAMPLE-MIB. In order to proceed with this, do the following :
Add the database file, (from an application which provides a ODBC driver) to the ODBC Data Source Administrator. Provide a unique name for the file as "DatabaseTest".
Once this is done, you have to associate this data source to the adiskTable object in the MIB file. In this case, the DATABASE-URL should be "jdbc:odbc:DatabaseTest".
Specify the Database driver name as "sun.jdbc.odbc.JdbcOdbcDriver".
Specify a User Name and a Password. For Example, the User Name can be "AdventNet" and the Password can be "adventnet".
|
|
Note: The Database Name, URL, Driver, UserName, and Password must be the same for all the Tables, which provide database storage |
|