|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsamples.javaclient.analyzer.AnalyzerConnection
Connection to the OLAP Catalog and to the BI Beans Catalog. This class performs all the tasks related to connecting to OLAP and the BI Beans Catalog, including auto-connecting from a configuration template, presenting a dialog to get connection information from the user, connecting to the catalogs, and saving connection information in the configuration file.
As part of the connection, this class makes the following assumptions:
This class uses several helper objects to access information in the
configuration file:
a BIConfigReader
,
a PersistenceConnection
,
an OLAPConnection
,
and a DADFile
.
The main Analyzer class constructs an AnalyzerConnection in its Analyzer.jbInit()
method.
If the user is automatically connecting, then the Analyzer constructor
calls the autoConnect()
method of this class.
If the user is not automatically connecting to the database, then
the Analyzer constructor calls the showConnectDialog(javax.swing.JFrame)
method of this
class to display the dialog that collects connection information from the user.
This connection is also where other objects get the MetadataManager and
the QueryManager for the application.
For example, Analyzer.initializeUI()
calls the getMetadataManager()
method
of the AnalyzerConnection, and then sets the MetadataManager on the different
Explorers.
Field Summary | |
private static java.lang.String |
CANCEL
Text for the Cancel button: "Cancel". |
private static java.lang.String |
CATALOG_DETAILS
Text for the catalog details panel: "Catalog Details:". |
private static java.lang.String |
CATALOG_PASSWORD
Text for the BI Beans Catalog password label in the catalog details panel: "Password:" |
private static java.lang.String |
CATALOG_ROOT
Text for the BI Beans Catalog root folder label in the catalog details panel: "Root Folder:". |
private static java.lang.String |
CATALOG_TYPE
Text for the catalog type drop-down label:"Catalog Type:". |
private static java.lang.String |
CATALOG_USER
Text for the BI Beans Catalog user name label in the catalog details panel: "User Name:" |
private static java.lang.String |
CONNECT
Text for the Connect button: "Connect". |
private static java.lang.String |
DATABASE
Text for the database Catalog option in the catalog type box: "Database". |
private static java.lang.String |
FILE_SYSTEM
Text for the file-based Catalog option in the catalog type box: "File System". |
private static java.lang.String |
HOST
Text for the host name label: "Host Name:". |
(package private) Analyzer |
m_analyzer
The Analyzer application that this Connection connects to the database. |
(package private) javax.swing.JPanel |
m_catalogPanel
Panel that the "I" button displays or hides. |
(package private) javax.swing.JPasswordField |
m_catalogPassword
Field for the password for connecting to the BI Beans Catalog. |
(package private) javax.swing.JTextField |
m_catalogRootFolder
Field for the root folder in a file-based BI Beans Catalog. |
(package private) javax.swing.JComboBox |
m_catalogType
Drop-down for selecting a file-based or database BI Beans Catlog. |
(package private) javax.swing.JTextField |
m_catalogUserName
Field for the user name for connecting to the BI Beans Catalog. |
(package private) java.lang.String |
m_configFile
The configuration file to read. |
(package private) boolean |
m_connected
Whether the application is connected to the database. |
(package private) java.lang.String |
m_defaultCatalogFile
Default name of the DAD file: "analyzerCatalog.dad". |
(package private) java.lang.String |
m_defaultConfigFile
Default name of the configuration file:"AnalyzerConfig.xml". |
(package private) javax.swing.JDialog |
m_dialog
The Connection dialog. |
(package private) javax.swing.JLabel |
m_directoryLabel
Label for the Root folder name in a file-based BI Beans Catalog. |
private java.lang.String |
m_homeDirectory
The directory where the user's start-up configuration file is found |
(package private) javax.swing.JTextField |
m_host
Field for the host name. |
(package private) oracle.dss.metadataManager.client.MetadataManager |
m_metadataManager
The MetadataManager for the application. |
(package private) javax.swing.JToggleButton |
m_moreButton
"I" button for displaying more or less information. |
(package private) OLAPConnection |
m_olap
The OLAP Connection for the application. |
(package private) javax.swing.JPasswordField |
m_OLAPPassword
Field for the password. |
(package private) javax.swing.JTextField |
m_OLAPUserName
Field for the user name. |
(package private) javax.swing.JLabel |
m_passwordLabel
Label for the Catalog User password in m_catalogPanel. |
(package private) javax.swing.JTextField |
m_port
Field for the port name. |
(package private) oracle.dss.dataSource.client.QueryManager |
m_queryManager
The QueryManager for the application. |
(package private) BIConfigReader |
m_reader
The configuration file reader. |
(package private) oracle.dss.appmodule.client.BISession |
m_session
The BISession for the application. |
(package private) javax.swing.JTextField |
m_sid
Field for the SID. |
private static java.lang.String |
m_title
Text for the dialog box title: "Database Connection Information". |
(package private) boolean |
m_useDatabaseCatalog
Whether the BI Beans Catalog is database (true) or file-based (false). |
(package private) javax.swing.JLabel |
m_userLabel
Label for the Catalog UserName in m_catalogPanel. |
private static java.lang.String |
OLAP_PASSWORD
Text for the password label: "Password:". |
private static java.lang.String |
OLAP_USER
Text for the user name label: "User Name:" |
private static java.lang.String |
PORT
Text for the port label: "Port:". |
private static java.lang.String |
SID
Text for the SID label: "SID:". |
Constructor Summary | |
AnalyzerConnection(Analyzer analyzer)
Constructor. |
Method Summary | |
boolean |
autoConnect()
Auto-connects to the database. |
protected void |
connect()
Connects to the OLAP service and to the BI Beans Catalog, using connection information from the BI Configuration file and from the BIConnectionDialog. |
protected void |
disconnect()
Disconnects the application from the MetadataManager and its associated connections. |
void |
disposeConnectDialog()
Disposes of the connect dialog. |
oracle.dss.appmodule.client.BISession |
getBISession()
Gets the BISession for this connection. |
private oracle.dss.connection.client.Connection |
getCatalogConnection()
Creates and returns a Connection to the BI Beans Catalog in the database. |
private oracle.dss.connection.client.Connection |
getCatalogConnection(oracle.dss.connection.client.Connection OLAPConnection)
Creates and returns a Connection to the BI Beans Catalog. |
private oracle.dss.connection.client.Connection |
getLocalCatalogConnection()
Creates and returns a Connection to the BI Beans Catalog. |
oracle.dss.metadataManager.client.MetadataManager |
getMetadataManager()
Returns the MetadataManager that the application uses. |
private oracle.dss.connection.client.Connection |
getOLAPConnection()
Creates and returns a Connection to the OLAP Catalog. |
protected oracle.dss.dataSource.client.QueryManager |
getQueryManager()
Returns the QueryManager that the application uses. |
oracle.dss.metadataManager.common.MDRoot |
getRootFolder()
Gets the root folder name for the application. |
protected boolean |
isConnected()
Indicates whether the application is connected to the database. |
private boolean |
recoverUser()
Attempts to recover from an invalid application user. |
private void |
saveConnectionSettings()
Saves the connection settings. |
void |
showConnectDialog(javax.swing.JFrame parentFrame)
Displays the connection dialog box, which asks the user for connection information. |
private void |
showConnectionError(java.lang.Exception e)
Displays error connection information. |
void |
showDisconnectDialog(javax.swing.JFrame parentFrame)
Displays a confirmation dialog that asks if the user wants to disconnect. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
javax.swing.JToggleButton m_moreButton
javax.swing.JPanel m_catalogPanel
javax.swing.JLabel m_userLabel
javax.swing.JLabel m_passwordLabel
javax.swing.JLabel m_directoryLabel
javax.swing.JTextField m_OLAPUserName
javax.swing.JPasswordField m_OLAPPassword
javax.swing.JTextField m_host
javax.swing.JTextField m_port
javax.swing.JTextField m_sid
javax.swing.JTextField m_catalogUserName
javax.swing.JPasswordField m_catalogPassword
javax.swing.JComboBox m_catalogType
javax.swing.JTextField m_catalogRootFolder
java.lang.String m_configFile
java.lang.String m_defaultConfigFile
java.lang.String m_defaultCatalogFile
oracle.dss.appmodule.client.BISession m_session
oracle.dss.metadataManager.client.MetadataManager m_metadataManager
oracle.dss.dataSource.client.QueryManager m_queryManager
boolean m_useDatabaseCatalog
boolean m_connected
private java.lang.String m_homeDirectory
private static final java.lang.String OLAP_USER
private static final java.lang.String OLAP_PASSWORD
private static final java.lang.String m_title
private static final java.lang.String FILE_SYSTEM
private static final java.lang.String DATABASE
private static final java.lang.String CATALOG_DETAILS
private static final java.lang.String CATALOG_USER
private static final java.lang.String CATALOG_PASSWORD
private static final java.lang.String CATALOG_ROOT
private static final java.lang.String CATALOG_TYPE
private static final java.lang.String HOST
private static final java.lang.String PORT
private static final java.lang.String SID
private static final java.lang.String CONNECT
private static final java.lang.String CANCEL
javax.swing.JDialog m_dialog
Analyzer m_analyzer
BIConfigReader m_reader
OLAPConnection m_olap
Constructor Detail |
public AnalyzerConnection(Analyzer analyzer)
analyzer
- The Analyzer main application class.Method Detail |
public boolean autoConnect()
true
if the connection is successful,
false
if it is not.public void showConnectDialog(javax.swing.JFrame parentFrame)
parentFrame
- The Analyzer main application class.public void disposeConnectDialog()
public void showDisconnectDialog(javax.swing.JFrame parentFrame)
parentFrame
- The Analyzer main application class.public oracle.dss.appmodule.client.BISession getBISession()
public oracle.dss.metadataManager.client.MetadataManager getMetadataManager()
2 The Analyzer.initializeUI method calls this method to set the MetadataManager on the Explorers.
connect()
,
Analyzer.initializeUI()
,
AnalyzerUtilities#construct
protected oracle.dss.dataSource.client.QueryManager getQueryManager()
Analyzer.newPresentation()
,
AnalyzerUtilities#construct
protected boolean isConnected()
true
is connected to the database,
false
if it is not.protected void connect()
private oracle.dss.connection.client.Connection getOLAPConnection() throws oracle.dss.connection.common.ConnectionException
oracle.dss.connection.common.ConnectionException
- If the connection fails.private oracle.dss.connection.client.Connection getCatalogConnection(oracle.dss.connection.client.Connection OLAPConnection)
OLAPConnection
- The Catalog will reuse the OLAP's JDBC connection
private oracle.dss.connection.client.Connection getCatalogConnection()
private oracle.dss.connection.client.Connection getLocalCatalogConnection()
private void showConnectionError(java.lang.Exception e)
e
- The exception that contains error text.private boolean recoverUser()
This method uses a JDBC connection to execute SQL statements in the database.
true
if the user is recovered,
false
if the user cannot be recovered.private void saveConnectionSettings()
protected void disconnect()
public oracle.dss.metadataManager.common.MDRoot getRootFolder() throws java.lang.Throwable
java.lang.Throwable
- If an error occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |