Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


oracle.dss.metadataManager.client
Class MetadataManager

java.lang.Object
  |
  +--oracle.dss.metadataManager.client.MetadataManager
All Implemented Interfaces:
ConnectionListener, ErrorHandlerCallback, java.util.EventListener, Persistable, java.io.Serializable, StringXMLizable

public class MetadataManager
extends java.lang.Object
implements java.io.Serializable, Persistable, ErrorHandlerCallback, ConnectionListener

The main client-side class of the MetadataManager bean. The MetadataManager consolidates access to metadata from multiple connections. For example, you might have metadata stored in an analytic workspace and in the repository. The MetadataManager consolidates these sources of metadata to give you unified access to the metadata.

See Also:
Serialized Form

Constructor Summary
MetadataManager()
          Default constructor.

 

Method Summary
 void addErrorHandler(ErrorHandler errHandler)
          Specifies the error for this MetadataManager.
 void addListener(MetadataManagerListener listener)
          Adds a MetadataManagerListener to this MetadataManager.
 boolean areLevelIDsEquivalent(java.lang.String id1, java.lang.String id2)
          Indicates whether two unique IDs for levels refer to the same Level in the database.
 int attach()
          Attaches (opens) all analytic workspaces to which this MetadataManager has connections.
 int detach()
          Detaches (closes) all open analytic workspaces.
 int detach(boolean disconnect)
          Detaches (closes) all open analytic workspaces.
 MDDimension[] dimensionalityOfMeasures(MDMeasure[] measures, java.lang.String flags)
          Retrieves the dimensions that specified measures have.
 int free()
          Frees resources that the MetadataManager bean uses, including all the connections that are associated with this MetadataManager.
 int free(boolean freeConnection)
          Frees resources that the MetadataManager bean uses.
 int getAttachStatus()
          Retrieves information about whether the most recently-attached analytic workspace is open and attached for this MetadataManager.
 PropertyBag getAttributes(MDObject mdObj, java.lang.String[] properties)
          Retrieves the attributes of an object.
 java.lang.String getBeanName()
          Retrieves the name of this MetadataManager.
 Connection[] getConnections()
          Retrieves the connections that this MetadataManager uses.
 MDDimension getDimension(java.lang.String strPropertyName, java.lang.String strPropertyValue)
          Retrieves the first dimension that has a specified property value.
 MDDimension[] getDimensions()
          Retrieves the MDDimension objects for the MDRoot object.
 java.lang.String getDriverImpl(java.lang.String driverType)
          Retrieve the driver associated with the specified drivertype from the MetadataManager bean.
 MDFolder getFolder(java.lang.String strPropertyName, java.lang.String strPropertyValue)
          Retrieves the first MDFolder object that has a specified property value.
 MDFolder[] getFolders()
          Retrieves the MDFolder objects for the MDRoot object.
 MDHierarchy getHierarchy(java.lang.String strPropertyName, java.lang.String strPropertyValue)
          Retrieves the first hierarchy that has a specified property value.
 MDLevel getLevel(java.lang.String strPropertyName, java.lang.String strPropertyValue)
          Retrieves the first level that has a specified property value.
 java.util.Locale getLocale()
          Retrieves the locale that this MetadataManager uses.
 MDObject getMDObject(java.lang.String strPropertyName, java.lang.String strPropertyValue, java.lang.String objectType)
          Retrieves a metadata object that has the specified property values and object type.
 MDObject getMDObject(java.lang.String strPropertyName, java.util.Vector vstrPropertyValues, java.lang.String objectType)
          Retrieves a metadata object that has the specified property values and object type.
 MDRoot getMDRoot()
          Retrieve the root folder for this MetadataManager.
 MDMeasure getMeasure(java.lang.String strPropertyName, java.lang.String strPropertyValue)
          Retrieves the first measure that has a specified property value.
 MDDimension getMeasureDimension(java.lang.String dbString)
          Retrieves the measure dimension for this MetadataManager.
 MDMeasure[] getMeasures()
          Retrieves the MDMeasure objects for the MDRoot object.
 ObjectFactory getObjectFactory(boolean remoteFactory)
          Retrieves the object factory that this MetadataManager uses to create new objects when loading XML from the BI Beans Catalog.
 MDSelection getSelection(java.lang.String strPropertyName, java.lang.String strPropertyValue)
          Retrieves the first selection that has a specified property value.
 BISession getSession()
          Retrieves the session to which this MetadataManager object belongs.
 java.lang.String getXMLAsString()
          Retrieves the XML representation of this MetadataManager.
 boolean isBeanClass()
          Indicates whether this object is the client-side part of the MetadataManager.
 java.util.Hashtable listDriverImpl()
          List the drivers associated with the metadataManager bean
 MDMeasure[] measuresOfDimensions(MDDimension[] dimensions, java.lang.String flags)
          Retrieves measures that have specified dimensions.
 void removeDriverImpl(java.lang.String driverType)
          De-register the driver from the metadataManager bean.
 void removeErrorHandler()
          Removes a customized error handler for this MetadataManager.
 void removeListener(MetadataManagerListener listener)
          Removes a MetadataManagerListener from the list of listeners for this MetadataManager.
 void setBeanName(java.lang.String name)
          Specifies the name of this MetadataManager.
 int setConnection(Connection connection)
          Adds a connection to this MetadataManager.
 void setDriverImpl(java.lang.String driverType, java.lang.String driverClassName)
          Register the driver with the MetadataManager bean.
 void setLocale(java.util.Locale locale)
          Specifies the locale that this MetadataManager uses.
 void setMeasureDimensionLabels(PropertyBag propertyBag)
          Specifies labels for measure dimension for this MetadataManager.
 void setSession(BISession session)
          Specifies the session to which this MetadataManager object belongs.
 boolean setXMLAsString(java.lang.String xml)
          Specifies the XML representation of this MetadataManager.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Methods inherited from interface oracle.dss.util.persistence.Persistable
getPersistableAttributes, getPersistableComponents, initialize, setPersistableAttributes, setPersistableComponents

 

Methods inherited from interface oracle.dss.connection.common.ConnectionListener
connected, connecting, disconnected, disconnecting

 

Constructor Detail

MetadataManager

public MetadataManager()
                throws MetadataManagerException
Default constructor.
Throws:
MetadataManagerException - If a problem occurs during the initialization of this MetadataManager.
Method Detail

setSession

public void setSession(BISession session)
Specifies the session to which this MetadataManager object belongs.
Parameters:
session - The BISession to which this MetadataManager object belongs.

getSession

public BISession getSession()
Retrieves the session to which this MetadataManager object belongs.
Returns:
The BISession to which this MetadataManager object belongs.

setConnection

public int setConnection(Connection connection)
                  throws MetadataManagerException
Adds a connection to this MetadataManager. The MetadataManager uses the connection to connect to the source of metadata. A MetadataManager can have more than one connection. Each connection provides information for connecting to a different source of metadata.
Parameters:
connection - The connection to add.
Returns:
A constant that represents success or failure. Possible constants are listed in the See Also section.
Throws:
MetadataManagerException - If the connection cannot be set.
See Also:
MDU.SUCCESS, MDU.FAILURE

getConnections

public Connection[] getConnections()
Retrieves the connections that this MetadataManager uses.
Returns:
The connections that have been set for this MetadataManager.

getAttachStatus

public int getAttachStatus()
Retrieves information about whether the most recently-attached analytic workspace is open and attached for this MetadataManager.
Returns:
A constant that represents attach status. Possible values are listed in the See Also section.
See Also:
MM.ATTACHED, MM.NOT_ATTACHED, MM.ATTACHING

attach

public int attach()
           throws MetadataManagerException
Attaches (opens) all analytic workspaces to which this MetadataManager has connections.
Returns:
A constant that represents attach status. Possible values are listed in the See Also section.
Throws:
MetadataManagerException - If the process of attaching workspaces fails.
See Also:
MM.ATTACHED, MDU.FAILURE, MDU.NO_REMOTE

detach

public int detach()
           throws MetadataManagerException
Detaches (closes) all open analytic workspaces. This method also disconnects all connections that are associated with this MetadataManager.
Returns:
A constant that represents detach status. Possible values are listed in the See Also section.
Throws:
MetadataManagerException - If the process of closing the workspaces fails.
See Also:
MM.ATTACHED, MDU.FAILURE, MDU.NO_REMOTE

detach

public int detach(boolean disconnect)
           throws MetadataManagerException
Detaches (closes) all open analytic workspaces. You can specify whether to disconnect all associated connections.
Parameters:
disconnect - true to disconnect all connections, false to detach without disconnecting.
Returns:
A constant that represents detach status. Possible values are listed in the See Also section.
Throws:
MetadataManagerException - If the process of closing the workspaces fails.
See Also:
MM.ATTACHED, MDU.FAILURE, MDU.NO_REMOTE

getMDRoot

public MDRoot getMDRoot()
Retrieve the root folder for this MetadataManager.
Returns:
The root folder for this MetadataManager.

getBeanName

public java.lang.String getBeanName()
Retrieves the name of this MetadataManager.
Returns:
The name of this MetadataManager.

setBeanName

public void setBeanName(java.lang.String name)
Specifies the name of this MetadataManager.
Parameters:
name - The name of this MetadataManager.

addListener

public void addListener(MetadataManagerListener listener)
Adds a MetadataManagerListener to this MetadataManager.
Parameters:
listener - The listener to add.

removeListener

public void removeListener(MetadataManagerListener listener)
Removes a MetadataManagerListener from the list of listeners for this MetadataManager.
Parameters:
listener - The listener to remove.

isBeanClass

public boolean isBeanClass()
Indicates whether this object is the client-side part of the MetadataManager. Because this MetadataManager is the main client component, this method always returns true.
Returns:
true.

free

public int free()
         throws MetadataManagerException
Frees resources that the MetadataManager bean uses, including all the connections that are associated with this MetadataManager. Call this method before you close your application.
Returns:
A constant that represents success or failure. The valid constants are: SUCCESS FAILURE
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem storing the object on the server.
See Also:
MDU.SUCCESS, MDU.FAILURE

free

public int free(boolean freeConnection)
         throws MetadataManagerException
Frees resources that the MetadataManager bean uses. You can specify whether to free all associated connections.
Parameters:
freeConnection - true to free connections, false to free resources but not connections.
Returns:
A constant that represents success or failure. The valid constants are: SUCCESS FAILURE
Throws:
MetadataManagerException - If the connection fails during the execution of this method

getFolders

public MDFolder[] getFolders()
                      throws MetadataManagerException
Retrieves the MDFolder objects for the MDRoot object.
Returns:
The MDFolder objects.

getMeasures

public MDMeasure[] getMeasures()
                        throws MetadataManagerException
Retrieves the MDMeasure objects for the MDRoot object.
Returns:
The MDMeasure objects.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem storing the object on the server.

getDimensions

public MDDimension[] getDimensions()
                            throws MetadataManagerException
Retrieves the MDDimension objects for the MDRoot object.
Returns:
The MDDimension objects.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem storing the object on the server.

getMDObject

public MDObject getMDObject(java.lang.String strPropertyName,
                            java.util.Vector vstrPropertyValues,
                            java.lang.String objectType)
                     throws MetadataManagerException
Retrieves a metadata object that has the specified property values and object type.
Parameters:
strPropertyName - The property name to find.
vstrPropertyValues - A list of property values to find.
strObjectType - The type of object to retrieve.
Returns:
An object of strObjectType that has all of the specified property values, or null if the object could not be found.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem retrieving objects from the server.

getMDObject

public MDObject getMDObject(java.lang.String strPropertyName,
                            java.lang.String strPropertyValue,
                            java.lang.String objectType)
                     throws MetadataManagerException
Retrieves a metadata object that has the specified property values and object type.
Parameters:
strPropertyName - The property name to find.
vstrPropertyValues - A list of property values to find.
strObjectType - The type of object to retrieve.
Returns:
An object of strObjectType that has all of the specified property values, or null if the object could not be found.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem retrieving objects from the server.

getFolder

public MDFolder getFolder(java.lang.String strPropertyName,
                          java.lang.String strPropertyValue)
                   throws MetadataManagerException
Retrieves the first MDFolder object that has a specified property value.
Parameters:
strPropertyName - a String value that represents the property name to find.
strPropertyValue - a String value that contains a property value to find.e.
Returns:
The first folder that has the strPropertyValue value for the strPropertyName property, or null if no folder can be found that has the property value.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem retrieving objects from the server.

getSelection

public MDSelection getSelection(java.lang.String strPropertyName,
                                java.lang.String strPropertyValue)
                         throws MetadataManagerException
Retrieves the first selection that has a specified property value.
Parameters:
strPropertyName - The name of the property to find.
strPropertyValue - The property value to find.
Returns:
The first selection that has the specified property value, or null if no selection can be found.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem retrieving objects from the server.

getMeasure

public MDMeasure getMeasure(java.lang.String strPropertyName,
                            java.lang.String strPropertyValue)
                     throws MetadataManagerException
Retrieves the first measure that has a specified property value.
Parameters:
strPropertyName - The name of the property to find.
strPropertyValue - The property value to find.
Returns:
The first measurethat has the specified property value, or null if no measure can be found.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem retrieving objects from the server.

getDimension

public MDDimension getDimension(java.lang.String strPropertyName,
                                java.lang.String strPropertyValue)
                         throws MetadataManagerException
Retrieves the first dimension that has a specified property value.
Parameters:
strPropertyName - The name of the property to find.
strPropertyValue - The property value to find.
Returns:
The first dimension that has the specified property value, or null if no dimension can be found.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem retrieving objects from the server.

getHierarchy

public MDHierarchy getHierarchy(java.lang.String strPropertyName,
                                java.lang.String strPropertyValue)
                         throws MetadataManagerException
Retrieves the first hierarchy that has a specified property value.
Parameters:
strPropertyName - The name of the property to find.
strPropertyValue - The property value to find.
Returns:
The first hierarchy that has the specified property value, or null if no hierarchy can be found.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem retrieving objects from the server.

getLevel

public MDLevel getLevel(java.lang.String strPropertyName,
                        java.lang.String strPropertyValue)
                 throws MetadataManagerException
Retrieves the first level that has a specified property value.
Parameters:
strPropertyName - The name of the property to find.
strPropertyValue - The property value to find.
Returns:
The first level that has the specified property value, or null if no level can be found.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem retrieving objects from the server.

areLevelIDsEquivalent

public boolean areLevelIDsEquivalent(java.lang.String id1,
                                     java.lang.String id2)
Indicates whether two unique IDs for levels refer to the same Level in the database.
Parameters:
id1 - First ID string to compare
id2 - Second ID string to compare
Returns:
true if they are equivalent, false if they are not equivalent.

measuresOfDimensions

public MDMeasure[] measuresOfDimensions(MDDimension[] dimensions,
                                        java.lang.String flags)
                                 throws MetadataManagerException
Retrieves measures that have specified dimensions. To retrieve measures that have any of the specified dimensions, pass MM.UNION as the flags parameter. To retrieve only the measures that have all of the specified dimensions, pass MM.INTERSECTION.
Parameters:
dimensions - The dimensions that the retrieved measures should have.
flags - A constant that indicates whether to retrieve measures that have any of the dimensions or only the measures that have all of the dimensions. Valid constants are listed in the See Also section.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem retrieving objects from the server.
See Also:
MM.UNION, MM.INTERSECTION

dimensionalityOfMeasures

public MDDimension[] dimensionalityOfMeasures(MDMeasure[] measures,
                                              java.lang.String flags)
                                       throws MetadataManagerException
Retrieves the dimensions that specified measures have. To retrieve the dimensions that any of the measures has, pass MM.UNION as the flags parameter. To retrieve only the dimensions that all of the measures have, pass MM.INTERSECTION.
Parameters:
measures - The measures whose dimensions you want.
flags - A constant that indicates whether to include the dimensions that any of the measures has or the dimensions that are common to all measures. Valid constants are listed in the See Also section.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem retrieving objects from the server.
See Also:
MM.UNION, MM.INTERSECTION

getMeasureDimension

public MDDimension getMeasureDimension(java.lang.String dbString)
                                throws MetadataManagerException
Retrieves the measure dimension for this MetadataManager. The measure dimension is the dimension that lists available measures.
Parameters:
dbString - The analytic workspace whose measure dimension you want.
Returns:
The measure dimension.
Throws:
MetadataManagerException - If the connection fails during the execution of this method or if there is a problem retrieving objects from the server.

setMeasureDimensionLabels

public void setMeasureDimensionLabels(PropertyBag propertyBag)
                               throws MetadataManagerException
Specifies labels for measure dimension for this MetadataManager.
Parameters:
propertyBag - PropertyBag that contains labels settings.
Throws:
MetadataManagerException - If there is a problem retrieving Measure Dimension object or if propertyBag contains a property that is a nonlabel property, such as MM.OBJECT_NAME.

setLocale

public void setLocale(java.util.Locale locale)
Specifies the locale that this MetadataManager uses.
Parameters:
locale - The Locale for this MetadataManager.

getLocale

public java.util.Locale getLocale()
Retrieves the locale that this MetadataManager uses.
Returns:
The locale for this MetadataManager uses.

getXMLAsString

public java.lang.String getXMLAsString()
                                throws BIPersistenceException
Retrieves the XML representation of this MetadataManager. This method is called by the persistence service when you save the MetadataManager to the repository. Application developers should not need to call this method.
Specified by:
getXMLAsString in interface StringXMLizable
Returns:
The XML representation of this MetadataManager.
Throws:
BIPersistenceException - If a problem occurs in getting the XML.

setXMLAsString

public boolean setXMLAsString(java.lang.String xml)
                       throws BIPersistenceException
Specifies the XML representation of this MetadataManager. The persistence service calls this method when the MetadataManager is restored from the repository. Application developers should not need to call this method.
Specified by:
setXMLAsString in interface StringXMLizable
Parameters:
name - The XML representation of this MetadataManager.
Returns:
true the XML was successfully set, false if not.
Throws:
BIPersistenceException - If a problem occurs in setting the XML.

addErrorHandler

public void addErrorHandler(ErrorHandler errHandler)
Specifies the error for this MetadataManager. The MetadataManager can have one and only one error handler. The default handler prints messages to the console.
Specified by:
addErrorHandler in interface ErrorHandlerCallback
Parameters:
errHandler - The error handler to use.

removeErrorHandler

public void removeErrorHandler()
Removes a customized error handler for this MetadataManager. This method replaces the current error handler with a default error handler. The default error handler prints information to the console.
Specified by:
removeErrorHandler in interface ErrorHandlerCallback

getObjectFactory

public ObjectFactory getObjectFactory(boolean remoteFactory)
Retrieves the object factory that this MetadataManager uses to create new objects when loading XML from the BI Beans Catalog.
Parameters:
remoteFactory - true to retrieve the middle-tier object factory, false to retrieve an object factory for the client.
Returns:
The object factory for the MetadataManager.

getAttributes

public PropertyBag getAttributes(MDObject mdObj,
                                 java.lang.String[] properties)
                          throws MetadataManagerException
Retrieves the attributes of an object.
Parameters:
mdObj - The object whose attributes you want to get.
properties - An array of properties that you want.
Returns:
A PropertyBag that has the properties and their values.
Throws:
MetadataManagerException -  

setDriverImpl

public void setDriverImpl(java.lang.String driverType,
                          java.lang.String driverClassName)
Register the driver with the MetadataManager bean. This driver will be used to retrieve the metadata through the connection. The driverType associate with the connection should be same as the driverType specified here.
Parameters:
driverType - String associated with the MetadataDriver.
driverImpl - String representing the fully qualified class name of the MetadataDriver implementation. The MetadataManager bean will instantiate the class at attach time.

getDriverImpl

public java.lang.String getDriverImpl(java.lang.String driverType)
Retrieve the driver associated with the specified drivertype from the MetadataManager bean.
Parameters:
driverType - String associated with the MetadataDriver.
Returns:
String representing the class driver class name

listDriverImpl

public java.util.Hashtable listDriverImpl()
List the drivers associated with the metadataManager bean
Returns:
Hashtable containing properties where the driverType is the key and driverImpl class name is the value.

removeDriverImpl

public void removeDriverImpl(java.lang.String driverType)
De-register the driver from the metadataManager bean.
Parameters:
driverType - String associated with the MetadataDriver that should be removed.

Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


Copyright © 2003, Oracle. All Rights Reserved.