| org.cougaar.mlm.plugin.ldm.LDMEssentialPlugin org.cougaar.mlm.plugin.ldm.LDMSQLPlugin
All known Subclasses: org.cougaar.mlm.plugin.ldm.SQLOplanPlugin,
LDMSQLPlugin | public class LDMSQLPlugin extends LDMEssentialPlugin (Code) | | Provide a JDBC binding to an COUGAAR cluster using MB5.0 interfaces.
This class replaces the JDBCPlugin. Current use involves runtime
creation of LDMObjects at Cluster startup. Future use will involve
dynamic, runtime creation of LDMObjects indirectly, via LDMFactory
methods.
On one side, we present a normal plugin API. On the other side,
we parse a "Query file" and talk to JDBC and a set of QueryHandler
objects.
The plugin expects at least one Plugin parameter
(via Plugin.getParameters). The first parameter is
interpreted as the name of a "query file". We look for this file
first in the current directory and then in $alphome/demo/queries/.
Any other parameters are interpreted as query parameter settings,
as though they were parsed from a global section of the query file.
plugin=org.cougaar.mlm.plugin.sql.LDMSQLPlugin(foo.q, NSN=12345669)
The query file is a description of one or more queries to execute
on behalf of the plugin. Comment lines (lines starting with '#') and
empty lines are ignored. Lines starting with '%' indicate the start
of a "query section" and the rest of the line names the QueryHandler
class to use. All other lines are of the form "parameter=value" where
the parameter values are made available to the current query. Initial
parameter settings (before a '%' line) are considered global and are
inherited by all following queries. In addition, a special case
pseudo-query of "%Global" allows additional entries into the global table.
A QueryHandler (for now) names a java class to instantiate for the
constructing an SQL expression and then parsing the rows of the results.
If the QueryHandler name does not include a '.' character, the parser
will prepend the value of the "Package" parameter (which defaults to
"org.cougaar.mlm.plugin.sql") in order to resolve the class.
See QueryHandler for more information.
Reserved QueryFile Parameters:
Package Default package for QueryHandler classnames
QueryFile the QueryFile of the current Query
Driver JDBC driver to use (oracle is already loaded)
Database JDBC database descriptor (used in getConnection)
Username JDBC Username (also "user")
Password JDBC Password (also "password")
Also support parameter substitutions in the sql query string.
If the QueryHandler returns
"select nsn, quantity from nsns where nsn = ':NSN'"
the JDBC plugin will substitute the value of parameter NSN
for the string :NSN. A colon character may be escaped with
a backslash.
|
LDMSQLPlugin | public LDMSQLPlugin()(Code) | | |
execute | public void execute()(Code) | | |
fillProperties | public void fillProperties(Asset anAsset)(Code) | | |
getLDMPlugin | public LDMServesPlugin getLDMPlugin()(Code) | | This method exposes the protected LDM in the plugin Adapter
to the QueryHandler. Had to name it differently than
getLDM() because the plugin adapter version of getLDM() is final.
|
grokArguments | protected void grokArguments()(Code) | | |
grokQueries | protected void grokQueries()(Code) | | sort queryhandlers into categories.
PeriodicQueries will get executed synchronously for the first
time here.
|
initProperties | protected void initProperties()(Code) | | |
parseQueryFile | protected void parseQueryFile()(Code) | | |
setupSubscriptions | protected void setupSubscriptions()(Code) | | |
Methods inherited from org.cougaar.mlm.plugin.ldm.LDMEssentialPlugin | public void execute()(Code)(Java Doc)
|
|
|