com.metamatrix.server.admin.apiimpl
Class RuntimeMetadataAdminAPIImpl

java.lang.Object
  extended by com.metamatrix.platform.admin.apiimpl.SubSystemAdminAPIImpl
      extended by com.metamatrix.server.admin.apiimpl.RuntimeMetadataAdminAPIImpl
All Implemented Interfaces:
SubSystemAdminAPI, RuntimeMetadataAdminAPI, java.io.Serializable

public class RuntimeMetadataAdminAPIImpl
extends SubSystemAdminAPIImpl
implements RuntimeMetadataAdminAPI

See Also:
Serialized Form

Method Summary
 java.util.Set getAllDataNodeNames(java.lang.String vdbName, java.lang.String vdbVersion)
          Get all data element paths for a VDB version.
 java.util.Map getConnectorBindingNames(VirtualDatabaseID vdbID)
          Get connector binding names for a given virtual database.
 PermissionDataNode getDataNodes(java.lang.String vDBName, java.lang.String vDBVersion)
          Get the tree of data nodes that make op a VDB.
 PermissionDataNode getEntitlementTree(java.lang.String vDBName, java.lang.String vDBVersion, AuthorizationPolicyID policyID)
          Returns the entitlement tree for a given VDB version.
static RuntimeMetadataAdminAPI getInstance()
           
 VirtualDatabase getLatestVirtualDatabase(java.lang.String vdbName)
          Returns the latestVirtualDatabase for the specified vdbName.
 MaterializationLoadScripts getMaterializationScripts(ConnectorBinding materializationConnector, VDBDefn vdb, java.lang.String mmHost, java.lang.String mmPort, java.lang.String materializationUserName, java.lang.String materializationUserPwd, java.lang.String metamatrixUserName, java.lang.String metamatrixPwd)
          Get the MaterializationLoadScripts for all materialized views in the materialization model in this VDB.
 java.util.Map getModelVisibilityLevels(VirtualDatabaseID vdbID)
          Get the visibility levels for models in a given virtual database.
 byte[] getVDB(VirtualDatabaseID vdbID)
          Call to export a VDB to the local file system
 java.util.Collection getVDBModels(VirtualDatabaseID vdbID)
          Returns a sorted Collection of type Model that represents all the models that were deployed in the specified virtual database.
 java.util.Collection getVDBsForConnectorBinding(java.lang.String routingID)
          Given a routing ID, find all VDBs whose models use the connector binding.
 VirtualDatabase getVirtualDatabase(VirtualDatabaseID vdbID)
          Returns the VirtualDatabase specified by the VirtualDatabaseID.
 java.util.Collection getVirtualDatabases()
          Returns a Collection of the VirtualDatabases in the system.
 VirtualDatabase importVDB(byte[] vdbStream)
          Call to import a VDB
 void markVDBForDelete(VirtualDatabaseID vdbID)
          Mark a VirtualDataBase (VDB) for deletion.
 java.util.Map migrateConnectorBindingNames(VirtualDatabase sourceVDB, VDBDefn vdb)
          Migrate connector binding names from models in a virtual database, filling in connector binding names possible for the models in the DTCInfo.
 EntitlementMigrationReport migrateEntitlements(VirtualDatabase targetVDB, char[] dataRoleContents, boolean overwriteExisting)
          Migrate as many existing entitlements as possible to a newly deployed VDB from a supplied roles xml file.
 EntitlementMigrationReport migrateEntitlements(VirtualDatabase sourceVDB, VirtualDatabase targetVDB)
          Migrate as many existing entitlements as possible to a newly deployed VDB.
 void setConnectorBindingNames(VirtualDatabaseID vdbID, java.util.Map modelAndCBNames)
          Set connector binding names for models in a virtual database.
 void setVDBState(VirtualDatabaseID vdbID, short state)
          Updates the VirtualDatabase state.
 void updateVirtualDatabase(VirtualDatabase vdb)
          Update a modified VirtualDataBase.
 boolean validateConnectorBindingForMaterialization(ConnectorBinding materializationConnector)
          Validate the given connector binding is capable for connectivity to a Materialization.
 
Methods inherited from class com.metamatrix.platform.admin.apiimpl.SubSystemAdminAPIImpl
getSessionID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RuntimeMetadataAdminAPI getInstance()
                                           throws MetaMatrixComponentException
Throws:
MetaMatrixComponentException

updateVirtualDatabase

public void updateVirtualDatabase(VirtualDatabase vdb)
                           throws AuthorizationException,
                                  InvalidSessionException,
                                  VirtualDatabaseException,
                                  MetaMatrixComponentException
Update a modified VirtualDataBase.

Specified by:
updateVirtualDatabase in interface RuntimeMetadataAdminAPI
Parameters:
vdb - the modified VirtualDatabase.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
VirtualDatabaseException - if an error occurs while setting the state.
MetaMatrixComponentException - if an error occurs in communicating with a component.

markVDBForDelete

public void markVDBForDelete(VirtualDatabaseID vdbID)
                      throws AuthorizationException,
                             InvalidSessionException,
                             VirtualDatabaseException,
                             MetaMatrixComponentException
Mark a VirtualDataBase (VDB) for deletion.

The VDB will not actually be deleted until there are no more users using it.

Specified by:
markVDBForDelete in interface RuntimeMetadataAdminAPI
Parameters:
callerSessionID - ID of the caller's current session.
vdbID - the ID of the VirtualDatabase that is to be deleted.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
VirtualDatabaseException - if an error occurs while updating vdb.
MetaMatrixComponentException - if an error occurs in communicating with a component.

migrateConnectorBindingNames

public java.util.Map migrateConnectorBindingNames(VirtualDatabase sourceVDB,
                                                  VDBDefn vdb)
                                           throws AuthorizationException,
                                                  InvalidSessionException,
                                                  VirtualDatabaseException,
                                                  MetaMatrixComponentException
Migrate connector binding names from models in a virtual database, filling in connector binding names possible for the models in the DTCInfo.

Specified by:
migrateConnectorBindingNames in interface RuntimeMetadataAdminAPI
Parameters:
callerSessionID - ID of the caller's current session.
sourceVDB - The source VirtualDatabase from which to search for models and thus, connector binding names.
dtc - The DTC that contains the models for which to attach String Connector Binding names. This param gets modified.
Returns:
A Map of ModelNames to RoutingIDs.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
VirtualDatabaseException - if an error occurs while setting the state.
MetaMatrixComponentException - if an error occurs in communicating with a component.

setConnectorBindingNames

public void setConnectorBindingNames(VirtualDatabaseID vdbID,
                                     java.util.Map modelAndCBNames)
                              throws AuthorizationException,
                                     InvalidSessionException,
                                     VirtualDatabaseException,
                                     MetaMatrixComponentException
Set connector binding names for models in a virtual database.

Specified by:
setConnectorBindingNames in interface RuntimeMetadataAdminAPI
Parameters:
callerSessionID -
vdbID - ID of the VirtualDatabase.
modelAndCBNames - Map of ModelIDs to String Connector Binding names.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
VirtualDatabaseException - if an error occurs while setting the state.
MetaMatrixComponentException - if an error occurs in communicating with a component.

getConnectorBindingNames

public java.util.Map getConnectorBindingNames(VirtualDatabaseID vdbID)
                                       throws AuthorizationException,
                                              InvalidSessionException,
                                              VirtualDatabaseException,
                                              MetaMatrixComponentException
Get connector binding names for a given virtual database.

Specified by:
getConnectorBindingNames in interface RuntimeMetadataAdminAPI
Parameters:
vdbID - ID of the VirtualDatabase.
Returns:
Map of ModelIDs and String connector binding names.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
VirtualDatabaseException - if an error occurs while setting the state.
MetaMatrixComponentException - if an error occurs in communicating with a component.

getVDBsForConnectorBinding

public java.util.Collection getVDBsForConnectorBinding(java.lang.String routingID)
                                                throws AuthorizationException,
                                                       InvalidSessionException,
                                                       VirtualDatabaseException,
                                                       MetaMatrixComponentException
Given a routing ID, find all VDBs whose models use the connector binding.

Specified by:
getVDBsForConnectorBinding in interface RuntimeMetadataAdminAPI
Parameters:
callerSessionID - The caller's session ID.
routingID - ID of the connector binding.
Returns:
Collection of VDBs where at least one Model is using given connector binding.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
VirtualDatabaseException - if an error occurs while setting the state.
MetaMatrixComponentException - if an error occurs in communicating with a component.

getVirtualDatabase

public VirtualDatabase getVirtualDatabase(VirtualDatabaseID vdbID)
                                   throws AuthorizationException,
                                          InvalidSessionException,
                                          VirtualDatabaseException,
                                          MetaMatrixComponentException
Returns the VirtualDatabase specified by the VirtualDatabaseID.

Specified by:
getVirtualDatabase in interface RuntimeMetadataAdminAPI
Parameters:
callerSessionID - ID of the caller's current session.
vdbID - ID of the VirtualDatabase.
Returns:
VirtualDatabase
Throws:
VirtualDatabaseException - if an error occurs while setting the state.
MetaMatrixComponentException - if an error occurs in communicating with a component.
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.

getLatestVirtualDatabase

public VirtualDatabase getLatestVirtualDatabase(java.lang.String vdbName)
                                         throws AuthorizationException,
                                                InvalidSessionException,
                                                VirtualDatabaseException,
                                                MetaMatrixComponentException
Returns the latestVirtualDatabase for the specified vdbName.

Specified by:
getLatestVirtualDatabase in interface RuntimeMetadataAdminAPI
Parameters:
callerSessionID - ID of the caller's current session.
vdbName - is the name of the VirtualDatabase.
Returns:
VirtualDatabase
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
VirtualDatabaseException - if an error occurs during retrieval process.
MetaMatrixComponentException - if an error occurs in communicating with a component.

getVirtualDatabases

public java.util.Collection getVirtualDatabases()
                                         throws AuthorizationException,
                                                InvalidSessionException,
                                                VirtualDatabaseException,
                                                MetaMatrixComponentException
Returns a Collection of the VirtualDatabases in the system. This would include all virtual databases flagged as incomplete, active, inactive or deleted.

Specified by:
getVirtualDatabases in interface RuntimeMetadataAdminAPI
Parameters:
callerSessionID - ID of the caller's current session.
Returns:
a Collection of all Virtualdatabases in the system.
Throws:
VirtualDatabaseException - if an error occurs while setting the state.
MetaMatrixComponentException - if an error occurs in communicating with a component.
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.

getVDBModels

public java.util.Collection getVDBModels(VirtualDatabaseID vdbID)
                                  throws AuthorizationException,
                                         InvalidSessionException,
                                         VirtualDatabaseException,
                                         MetaMatrixComponentException
Returns a sorted Collection of type Model that represents all the models that were deployed in the specified virtual database.

Specified by:
getVDBModels in interface RuntimeMetadataAdminAPI
Parameters:
callerSessionID - ID of the caller's current session.
vdbID - ID of the VirtualDatabase.
Returns:
a Collection of all Models deployed in the VirtualDatabase.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
MetaMatrixComponentException - if an error occurs in communicating with a component.
InvalidSessionException - if the callerSessionID is not valid or is expired.
VirtualDatabaseException - if an error occurs while setting the state.

setVDBState

public void setVDBState(VirtualDatabaseID vdbID,
                        short state)
                 throws AuthorizationException,
                        InvalidSessionException,
                        VirtualDatabaseException,
                        MetaMatrixComponentException
Updates the VirtualDatabase state. The following four states are valid.

Incomplete: The virtula database is not fully created yet. Set by runtime metadata during the creation of a new virtual database.

Inactive: Not ready for use.

Active: Ready for use.

Deleted: Ready for deletion.

Specified by:
setVDBState in interface RuntimeMetadataAdminAPI
Parameters:
callerSessionID - ID of the caller's current session.
vdbID - ID of the VirtualDatabase.
state - the state the VirtualDatabase should be set to.
Throws:
VirtualDatabaseException - if an error occurs while setting the state.
MetaMatrixComponentException - if an error occurs in communicating with a component.
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.

migrateEntitlements

public EntitlementMigrationReport migrateEntitlements(VirtualDatabase sourceVDB,
                                                      VirtualDatabase targetVDB)
                                               throws AuthorizationException,
                                                      InvalidSessionException,
                                                      MetaMatrixComponentException
Migrate as many existing entitlements as possible to a newly deployed VDB.

Specified by:
migrateEntitlements in interface RuntimeMetadataAdminAPI
Parameters:
sourceVDB - The existing VDB from which to copy entitlements.
targetVDB - The new VDB to which to copy entitlements.
Returns:
The report that contains a result for each attempted copy.
Throws:
InvalidSessionException - if the administrative session is invalid
AuthorizationException - if admninistrator does not have the authority to perform the requested operation.
MetaMatrixComponentException - if this service has trouble communicating.

migrateEntitlements

public EntitlementMigrationReport migrateEntitlements(VirtualDatabase targetVDB,
                                                      char[] dataRoleContents,
                                                      boolean overwriteExisting)
                                               throws AuthorizationException,
                                                      InvalidSessionException,
                                                      MetaMatrixComponentException
Migrate as many existing entitlements as possible to a newly deployed VDB from a supplied roles xml file.

Specified by:
migrateEntitlements in interface RuntimeMetadataAdminAPI
Parameters:
sourceVDB - The existing VDB from which to copy entitlements.
dataRoleContents - The contents of the Data Roles xml File.
overwriteExisting - flag to determine if existing entitlements should be overwritten.
Returns:
The report that contains a result for each attempted copy.
Throws:
InvalidSessionException - if the administrative session is invalid
AuthorizationException - if admninistrator does not have the authority to perform the requested operation.
MetaMatrixComponentException - if this service has trouble communicating.

getEntitlementTree

public PermissionDataNode getEntitlementTree(java.lang.String vDBName,
                                             java.lang.String vDBVersion,
                                             AuthorizationPolicyID policyID)
                                      throws AuthorizationException,
                                             InvalidSessionException,
                                             MetaMatrixComponentException
Returns the entitlement tree for a given VDB version.

Specified by:
getEntitlementTree in interface RuntimeMetadataAdminAPI
Parameters:
vDBName - The name of a VDB for which to get its model info.
vDBVersion - The name of a VDB version for which to get its model info.
policyID - The policy (entitlement) for which to constrain the search for permissions.
Returns:
The root of the entitlement tree for the given VEB version.
Throws:
InvalidSessionException - if the administrative session is invalid
AuthorizationException - if admninistrator does not have the authority to perform the requested operation.
MetaMatrixComponentException - if this service has trouble communicating.

getDataNodes

public PermissionDataNode getDataNodes(java.lang.String vDBName,
                                       java.lang.String vDBVersion)
                                throws AuthorizationException,
                                       InvalidSessionException,
                                       MetaMatrixComponentException
Get the tree of data nodes that make op a VDB. This tree represents just the data node hierarchy and does not contain authorization information.

Specified by:
getDataNodes in interface RuntimeMetadataAdminAPI
Parameters:
vDBName - The name of the VDB for which data nodes are sought.
vDBVersion - The version of the VDB for which data nodes are sought.
Returns:
The root of the data node tree for the VDB and version.
Throws:
InvalidSessionException - if the administrative session is invalid
AuthorizationException - if admninistrator does not have the authority to perform the requested operation.
MetaMatrixComponentException - if this service has trouble communicating.

getAllDataNodeNames

public java.util.Set getAllDataNodeNames(java.lang.String vdbName,
                                         java.lang.String vdbVersion)
                                  throws InvalidSessionException,
                                         MetaMatrixComponentException
Get all data element paths for a VDB version.

Specified by:
getAllDataNodeNames in interface RuntimeMetadataAdminAPI
Parameters:
callerSessionID - The session ID of the administrator making the call.
vdbName - The VDB name.
vdbVersion - The version for the VDB.
Returns:
All element paths in the given VDB version.
Throws:
InvalidSessionException
MetaMatrixComponentException

getVDB

public byte[] getVDB(VirtualDatabaseID vdbID)
              throws AuthorizationException,
                     InvalidSessionException,
                     VirtualDatabaseException,
                     MetaMatrixComponentException
Call to export a VDB to the local file system

Specified by:
getVDB in interface RuntimeMetadataAdminAPI
Parameters:
vdbID - ID of the VirtualDatabase.
dirLocation - is the path where the files will be saved
vdbDefnFileName - is the name of the VDB Definition file to be saved. Visibility levels are defined in MetadataConstants.VISIBILITY_TYPES.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
VirtualDatabaseException - if an error occurs while setting the state.
MetaMatrixComponentException - if an error occurs in communicating with a component.

importVDB

public VirtualDatabase importVDB(byte[] vdbStream)
                          throws AuthorizationException,
                                 InvalidSessionException,
                                 VirtualDatabaseException,
                                 MetaMatrixComponentException
Description copied from interface: RuntimeMetadataAdminAPI
Call to import a VDB

Specified by:
importVDB in interface RuntimeMetadataAdminAPI
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
VirtualDatabaseException - if an error occurs while setting the state.
MetaMatrixComponentException - if an error occurs in communicating with a component.

getModelVisibilityLevels

public java.util.Map getModelVisibilityLevels(VirtualDatabaseID vdbID)
                                       throws AuthorizationException,
                                              InvalidSessionException,
                                              VirtualDatabaseException,
                                              MetaMatrixComponentException
Get the visibility levels for models in a given virtual database.

Specified by:
getModelVisibilityLevels in interface RuntimeMetadataAdminAPI
Parameters:
vdbID - ID of the VirtualDatabase.
Returns:
Map of ModelIDs and String connector binding names.
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
VirtualDatabaseException - if an error occurs while setting the state.
MetaMatrixComponentException - if an error occurs in communicating with a component.

validateConnectorBindingForMaterialization

public boolean validateConnectorBindingForMaterialization(ConnectorBinding materializationConnector)
                                                   throws AuthorizationException,
                                                          InvalidSessionException,
                                                          VirtualDatabaseException,
                                                          MetaMatrixComponentException
Description copied from interface: RuntimeMetadataAdminAPI
Validate the given connector binding is capable for connectivity to a Materialization.

Specified by:
validateConnectorBindingForMaterialization in interface RuntimeMetadataAdminAPI
Parameters:
materializationConnector - The connector that will be validated.
Returns:
true iff the given connector binding passes validation.
Throws:
AuthorizationException
InvalidSessionException
VirtualDatabaseException
MetaMatrixComponentException
Since:
4.2
See Also:
com.metamatrix.server.admin.apiimpl.RuntimeMetadataAdminAPIInterface#validateConnectorBindingForMaterialization(ConnectorBinding)

getMaterializationScripts

public MaterializationLoadScripts getMaterializationScripts(ConnectorBinding materializationConnector,
                                                            VDBDefn vdb,
                                                            java.lang.String mmHost,
                                                            java.lang.String mmPort,
                                                            java.lang.String materializationUserName,
                                                            java.lang.String materializationUserPwd,
                                                            java.lang.String metamatrixUserName,
                                                            java.lang.String metamatrixPwd)
                                                     throws AuthorizationException,
                                                            InvalidSessionException,
                                                            VirtualDatabaseException,
                                                            MetaMatrixComponentException
Description copied from interface: RuntimeMetadataAdminAPI
Get the MaterializationLoadScripts for all materialized views in the materialization model in this VDB.

Specified by:
getMaterializationScripts in interface RuntimeMetadataAdminAPI
Parameters:
materializationConnector - the connector that will be used to connect to the Materialization.
vdb - the VDB to which the Materialization belongs.
mmHost - The host that the MetaMatrix server is running on.
mmPort - The MetaMatrix server port.
materializationUserName - The name of the user that will be logging in to the database that holds this particular materialization and the user that the load/refresh scripts will run under.
materializationUserPwd - The password of the materialization user.
metamatrixUserName - User that will log into the MetaMatrix server to perform the refresh.
metamatrixPwd - Password of the MetaMatrix user.
Returns:
The object that represents all information nessecary to save the materialization load scripts.
Throws:
AuthorizationException
InvalidSessionException
VirtualDatabaseException
MetaMatrixComponentException
Since:
4.2
See Also:
com.metamatrix.server.admin.apiimpl.RuntimeMetadataAdminAPIInterface#getMaterializationScripts(com.metamatrix.common.config.api.ConnectorBinding, RMCVersionEntry, String, String, String, String, String, String)


Copyright © 2009. All Rights Reserved.