com.metamatrix.metadata.runtime.spi.jdbc
Class JDBCConnector

java.lang.Object
  extended by com.metamatrix.common.connection.BaseTransaction
      extended by com.metamatrix.metadata.runtime.spi.jdbc.JDBCConnector
All Implemented Interfaces:
TransactionInterface, MetaBaseConnector, RuntimeBaseConnector

public class JDBCConnector
extends BaseTransaction
implements MetaBaseConnector


Method Summary
 void deleteVirtualDatabase(VirtualDatabaseID vdbID)
          Delete the VirtualDatabase.
 VirtualDatabaseID getActiveVirtualDatabaseID(java.lang.String vdbName, java.lang.String vdbVersion)
          Used only by the RuntimeMetadataCatalog to find the active id.
 java.util.Collection getDeletedVirtualDatabaseIDs()
          returns a Collection of type VirtualDatabaseID that represents all the virtual databases marked for deletion in the system.
 java.util.Collection getModelIDsOnlyInVDB(VirtualDatabaseID vdbID)
           
 java.util.Collection getModels(VirtualDatabaseID vdbID)
          returns a Collection of type Model that represents all the data sources tthat where deployed in the specified virtual database id
 VirtualDatabase getVirtualDatabase(VirtualDatabaseID virtualDatabaseID)
          returns the VirtualDatabase based on the virtual database id.
 VirtualDatabaseID getVirtualDatabaseID(java.lang.String fullName, java.lang.String version)
          returns the VirtualDatabaseID for the specified full name and version.
 java.util.Collection getVirtualDatabases()
          returns a Collection of type VirtualDatabase that represents all the virtual databases in the system.
 void insertModels(java.util.Collection metadataObjects, VirtualDatabaseID vdbID)
          Insert models into the VirtualDatabase.
 void insertVirtualDatabase(VirtualDatabase vdb)
          Insert the VirtualDatabase.
 void setConnectorBindingNames(VirtualDatabaseID vdbID, java.util.Collection models, java.util.Map modelAndCBNames)
           
 void setStatus(VirtualDatabaseID virtualDBID, short status, java.lang.String userName)
          Updates the VirtualDatabase status.
 void updateVirtualDatabase(VirtualDatabase vdb, java.lang.String userName)
          Update VDB attributes.
 
Methods inherited from class com.metamatrix.common.connection.BaseTransaction
close, commit, finalize, getConnection, getRollbackOnFinalize, isClosed, isEnded, isReadonly, rollback, setRollbackOnFinalize
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.metamatrix.metadata.runtime.spi.RuntimeBaseConnector
commit, rollback
 
Methods inherited from interface com.metamatrix.common.connection.TransactionInterface
close, isClosed, isReadonly
 

Method Detail

getVirtualDatabase

public VirtualDatabase getVirtualDatabase(VirtualDatabaseID virtualDatabaseID)
                                   throws VirtualDatabaseException
returns the VirtualDatabase based on the virtual database id.

Specified by:
getVirtualDatabase in interface MetaBaseConnector
Parameters:
virtualDatabaseID - is the VirtualDatabase to be returned.
Returns:
VirtualDatabase
Throws:
VirtualDatabaseException - if an error occurs while trying to read the data.

getVirtualDatabaseID

public VirtualDatabaseID getVirtualDatabaseID(java.lang.String fullName,
                                              java.lang.String version)
                                       throws VirtualDatabaseDoesNotExistException,
                                              VirtualDatabaseException
returns the VirtualDatabaseID for the specified full name and version. This method does validate the existance of the virtual database by reading from the persistance storage before creating the id.

Specified by:
getVirtualDatabaseID in interface MetaBaseConnector
Returns:
VirtualDatabaseID
Throws:
VirtualDatabaseDoesNotExistException - exception if the virtual database does not exist
VirtualDatabaseException - if an error occurs while trying to read the data.

getVirtualDatabases

public java.util.Collection getVirtualDatabases()
                                         throws VirtualDatabaseException
returns a Collection of type VirtualDatabase that represents all the virtual databases in the system.

Specified by:
getVirtualDatabases in interface MetaBaseConnector
Returns:
Collection of type VirtualDatabase
Throws:
VirtualDatabaseException - an error occurs while trying to read the data.

getDeletedVirtualDatabaseIDs

public java.util.Collection getDeletedVirtualDatabaseIDs()
                                                  throws VirtualDatabaseException
returns a Collection of type VirtualDatabaseID that represents all the virtual databases marked for deletion in the system.

Specified by:
getDeletedVirtualDatabaseIDs in interface MetaBaseConnector
Returns:
Collection of type VirtualDatabase
Throws:
VirtualDatabaseException - an error occurs while trying to read the data.

getModels

public java.util.Collection getModels(VirtualDatabaseID vdbID)
                               throws VirtualDatabaseException
returns a Collection of type Model that represents all the data sources tthat where deployed in the specified virtual database id

Specified by:
getModels in interface MetaBaseConnector
Parameters:
vdbID - is the VirtualDatabaseID
Returns:
Collection of type Model
Throws:
VirtualDatabaseException - an error occurs while trying to read the data.

getActiveVirtualDatabaseID

public VirtualDatabaseID getActiveVirtualDatabaseID(java.lang.String vdbName,
                                                    java.lang.String vdbVersion)
                                             throws VirtualDatabaseException,
                                                    VirtualDatabaseDoesNotExistException
Used only by the RuntimeMetadataCatalog to find the active id.

Specified by:
getActiveVirtualDatabaseID in interface MetaBaseConnector
Throws:
VirtualDatabaseException
VirtualDatabaseDoesNotExistException

getModelIDsOnlyInVDB

public java.util.Collection getModelIDsOnlyInVDB(VirtualDatabaseID vdbID)
                                          throws VirtualDatabaseException
Throws:
VirtualDatabaseException

setStatus

public void setStatus(VirtualDatabaseID virtualDBID,
                      short status,
                      java.lang.String userName)
               throws InvalidStateException,
                      VirtualDatabaseException
Updates the VirtualDatabase status.

Specified by:
setStatus in interface MetaBaseConnector
Parameters:
virtualDBID - represents the VirtualDatabase to be updated
status - is the state the VirtualDatabase should be set to
userName - of the person requesting the change
Throws:
VirtualDatabaseException - if unable to perform update.
InvalidStateException - if the status to be set is invalid.

insertModels

public void insertModels(java.util.Collection metadataObjects,
                         VirtualDatabaseID vdbID)
                  throws VirtualDatabaseException
Description copied from interface: MetaBaseConnector
Insert models into the VirtualDatabase.

Specified by:
insertModels in interface MetaBaseConnector
Parameters:
metadataObjects - is a collection of models to be inserted.
Throws:
VirtualDatabaseException - if unable to perform insertion.

insertVirtualDatabase

public void insertVirtualDatabase(VirtualDatabase vdb)
                           throws VirtualDatabaseException
Description copied from interface: MetaBaseConnector
Insert the VirtualDatabase.

Specified by:
insertVirtualDatabase in interface MetaBaseConnector
Parameters:
vdb - is the virtual database to be inserted.
Throws:
VirtualDatabaseException - if unable to perform insertion.
InvalidStateException - is thrown if the VirtualDatabase is not in the proper state to change to active state.

deleteVirtualDatabase

public void deleteVirtualDatabase(VirtualDatabaseID vdbID)
                           throws VirtualDatabaseException
Description copied from interface: MetaBaseConnector
Delete the VirtualDatabase.

Specified by:
deleteVirtualDatabase in interface MetaBaseConnector
Parameters:
vdbID - is the ID of the virtual database to be deleted.
Throws:
VirtualDatabaseException - an error occurs while trying to delete the data.

setConnectorBindingNames

public void setConnectorBindingNames(VirtualDatabaseID vdbID,
                                     java.util.Collection models,
                                     java.util.Map modelAndCBNames)
                              throws VirtualDatabaseException
Specified by:
setConnectorBindingNames in interface MetaBaseConnector
Throws:
VirtualDatabaseException

updateVirtualDatabase

public void updateVirtualDatabase(VirtualDatabase vdb,
                                  java.lang.String userName)
                           throws VirtualDatabaseException
Description copied from interface: MetaBaseConnector
Update VDB attributes. Only the attributes defined in VirtualDatabase.ModifiableAttributes can be modefied. Call VirtualDatabase.update(String attribute, Object value) to update each attribute of the VDB before calling this method.

Specified by:
updateVirtualDatabase in interface MetaBaseConnector
Parameters:
vdb - VDB to be updated.
userName - of the person updating the virtual database.
Throws:
VirtualDatabaseException


Copyright © 2009. All Rights Reserved.