Java Doc for DBProperties.java in  » Science » Cougaar12_4 » org » cougaar » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Cougaar12_4 » org.cougaar.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.util.Properties
   org.cougaar.util.DBProperties

DBProperties
abstract public class DBProperties extends java.util.Properties (Code)
This utility extends java.util.Properties by doing parameter substitutions after loading a .q file. q files are cached, such that they are only parsed once per VM. .q files understood by this class are different from those understood by QueryLDMPlugin and LDMSQLPlugin because the files are not divided into query handler sections. Instead query handlers are specified (when necessary) by the following convention: a property named after the generic query type (e.g. locationQuery) and suffixed with .handler is defined with a comma-separated list of handler class names. Each handler class knows the name of the query property that it uses.

Inner Class :static class Immutable extends DBProperties

Field Summary
final protected static  Loggerlog
    

Constructor Summary
protected  DBProperties(DBProperties that)
    
protected  DBProperties(String name, InputStream i)
    

Method Summary
public  voidaddQueryFile(String qfile)
     Add the queries from the given query file to this instance's collection.
public  voidaddQueryFile(String qfile, String module)
     Add the queries from the given query file to this instance's collection.
public  StringgetDBType()
     Accessor for the default database type string.
public  StringgetDBType(String dburl)
    
public  StringgetDefaultDatabase()
    
public  StringgetName()
    
public  StringgetQuery(String queryName, Map substitutions)
     Return a query with a given name.
public  StringgetQueryForDatabase(String queryName, Map substitutions, String dbspec)
     Same as DBProperties.getQuery(String,Map) above , but allows a different database to be specified.
abstract public  booleanisLocked()
    
public  voidload(InputStream i)
     Load properties from an InputStream and post-process to perform variable substitutions on the values.
abstract public  DBPropertieslock()
     Return a locked copy of this DBProperties object.
public static  DBPropertiesreReadQueryFile(String qfile)
     Force Re-Read and parse a .q file.
public static  DBPropertiesreReadQueryFile(String qfile, String module)
     Force Re-Read and parse a .q file.
public static  DBPropertiesreReadQueryFile(URL url)
     Force Re-read and parse a .q file specified as a URL.
public static  DBPropertiesreadQueryFile(String qfile)
     Read and parse a .q file.
public static  DBPropertiesreadQueryFile(String qfile, String module)
     Read and parse a .q file.
public static  DBPropertiesreadQueryFile(URL url)
     Read and parse a .q file specified as a URL.
public  voidsetDebug(boolean newDebug)
     Enable debugging.
public  voidsetDefaultDatabase(String dburl)
     Change the database specification.
public  StringtoString()
    
abstract public  DBPropertiesunlock()
     Return an unlocked copy of this DBProperties object.

Field Detail
log
final protected static Logger log(Code)




Constructor Detail
DBProperties
protected DBProperties(DBProperties that)(Code)



DBProperties
protected DBProperties(String name, InputStream i) throws IOException(Code)




Method Detail
addQueryFile
public void addQueryFile(String qfile) throws IOException(Code)
Add the queries from the given query file to this instance's collection.
Parameters:
  qfile - a String query file to parse
exception:
  IOException - if an error occurs



addQueryFile
public void addQueryFile(String qfile, String module) throws IOException(Code)
Add the queries from the given query file to this instance's collection.
Parameters:
  qfile - a String query file to parse
Parameters:
  module - the name of the module to search first for the query file
exception:
  IOException - if an error occurs



getDBType
public String getDBType()(Code)
Accessor for the default database type string. This is the string that is appended to query names (e.g. oracle) to form the name of a database-specific query (or other value).



getDBType
public String getDBType(String dburl)(Code)
Convert a db url into a database type string



getDefaultDatabase
public String getDefaultDatabase()(Code)



getName
public String getName()(Code)



getQuery
public String getQuery(String queryName, Map substitutions)(Code)
Return a query with a given name. Variable substitution is performed by looking for patterns which are the keys in a Map. By convention, variable names start with a colon and are alphanumeric, but this is not required. However, variable names must not start with the name of another variable. For example, :a and :aye are not allowed. The query is sought under two different names, first by suffixing the given name with a dot (.) and the default database type and, if that query is not found, again without the suffix.
Parameters:
  queryName - the name of the query.
Parameters:
  substitutions - The substitutions to be performed. Thequery is examined for occurances of the keys in the Map andreplaced with the corresponding value.



getQueryForDatabase
public String getQueryForDatabase(String queryName, Map substitutions, String dbspec)(Code)
Same as DBProperties.getQuery(String,Map) above , but allows a different database to be specified.
Parameters:
  queryName - the name of the query.
Parameters:
  substitutions - a map of translations of substitution variables
Parameters:
  dbspec - the key under which to find the database url forthis query.



isLocked
abstract public boolean isLocked()(Code)



load
public void load(InputStream i) throws IOException(Code)
Load properties from an InputStream and post-process to perform variable substitutions on the values. Substitution is done using Parameters.replaceParameters. This method should not normally be used and is defined only to override the base class version and interpose parameter replacements from cougaar.rc.



lock
abstract public DBProperties lock()(Code)
Return a locked copy of this DBProperties object.



reReadQueryFile
public static DBProperties reReadQueryFile(String qfile) throws IOException(Code)
Force Re-Read and parse a .q file. If the .q file contains value for "database" (case-sensitive) the default database type is set accordingly. The default database type may be set or changed manually with the setDefaultDatabase method.
Parameters:
  qfile - the name of the query file



reReadQueryFile
public static DBProperties reReadQueryFile(String qfile, String module) throws IOException(Code)
Force Re-Read and parse a .q file. If the .q file contains value for "database" (case-sensitive) the default database type is set accordingly. The default database type may be set or changed manually with the setDefaultDatabase method.
Parameters:
  qfile - the name of the query file
Parameters:
  module - the name of the module to search first for the query file



reReadQueryFile
public static DBProperties reReadQueryFile(URL url) throws IOException(Code)
Force Re-read and parse a .q file specified as a URL. Even if the file was previously read, re-read. If the .q file contains a value for "database" (case-sensitive) the default database type is set accordingly. The default database type may be set or changed manually with the setDefaultDatabase method.
Parameters:
  url - the url to be opened to read the query file contents.



readQueryFile
public static DBProperties readQueryFile(String qfile) throws IOException(Code)
Read and parse a .q file. If the file was previously parsed, do not re-read. If the .q file contains value for "database" (case-sensitive) the default database type is set accordingly. The default database type may be set or changed manually with the setDefaultDatabase method.
Parameters:
  qfile - the name of the query file



readQueryFile
public static DBProperties readQueryFile(String qfile, String module) throws IOException(Code)
Read and parse a .q file. If the file was previously parsed, do not re-read. If the .q file contains value for "database" (case-sensitive) the default database type is set accordingly. The default database type may be set or changed manually with the setDefaultDatabase method.
Parameters:
  qfile - the name of the query file
Parameters:
  module - the name of the module to search first for the query file



readQueryFile
public static DBProperties readQueryFile(URL url) throws IOException(Code)
Read and parse a .q file specified as a URL. If the file was previously read, do not re-read. If the .q file contains a value for "database" (case-sensitive) the default database type is set accordingly. The default database type may be set or changed manually with the setDefaultDatabase method.
Parameters:
  url - the url to be opened to read the query filecontents.



setDebug
public void setDebug(boolean newDebug)(Code)
Enable debugging. When debugging is enabled, the queries are printed after substitution has been performed



setDefaultDatabase
public void setDefaultDatabase(String dburl)(Code)
Change the database specification. The database specification is the name of a database url parameter found using in this DBProperties.
Parameters:
  dburl - the jdbc url of the database in which the queriesare to be executed. The database type is extracted from the urland used for getting queries tailored for that database.



toString
public String toString()(Code)



unlock
abstract public DBProperties unlock()(Code)
Return an unlocked copy of this DBProperties object.



Fields inherited from java.util.Properties
protected Properties defaults(Code)(Java Doc)

Methods inherited from java.util.Properties
public String getProperty(String key)(Code)(Java Doc)
public String getProperty(String key, String defaultValue)(Code)(Java Doc)
public void list(PrintStream out)(Code)(Java Doc)
public void list(PrintWriter out)(Code)(Java Doc)
public synchronized void load(Reader reader) throws IOException(Code)(Java Doc)
public synchronized void load(InputStream inStream) throws IOException(Code)(Java Doc)
public synchronized void loadFromXML(InputStream in) throws IOException, InvalidPropertiesFormatException(Code)(Java Doc)
public Enumeration propertyNames()(Code)(Java Doc)
public synchronized void save(OutputStream out, String comments)(Code)(Java Doc)
public synchronized Object setProperty(String key, String value)(Code)(Java Doc)
public void store(Writer writer, String comments) throws IOException(Code)(Java Doc)
public void store(OutputStream out, String comments) throws IOException(Code)(Java Doc)
public synchronized void storeToXML(OutputStream os, String comment) throws IOException(Code)(Java Doc)
public synchronized void storeToXML(OutputStream os, String comment, String encoding) throws IOException(Code)(Java Doc)
public Set<String> stringPropertyNames()(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.