com.metamatrix.metadata.runtime.model
Class UpdateController

java.lang.Object
  extended by com.metamatrix.metadata.runtime.model.UpdateController

public class UpdateController
extends java.lang.Object

The UpdateController is responsible for controlling all updates for the Runtime Metadata. It manages one connection for all updates to pass through.


Field Summary
static java.lang.String FIRST_VERSION
           
 
Constructor Summary
UpdateController(TransactionMgr transactionMgr)
           
 
Method Summary
protected  BasicVirtualDatabase buildVirtualDatabaseObject(VDBArchive vdbArchive, java.lang.String userName, boolean inMemory)
          Create a new instance of a VirtualDatabase object using the supplied information.
 VirtualDatabase createVirtualDatabase(VDBArchive vdbArchive, java.lang.String userName)
           
protected  long createVirtualDatabaseID()
           
 void deleteVirtualDatabase(VirtualDatabaseID vdbID)
           
protected  MetaBaseConnector getReadTransaction()
           
 byte[] getVDBArchive(java.lang.String fileName)
           
protected  MetaBaseConnector getWriteTransaction()
           
 void setConnectorBindingNames(VirtualDatabaseID vdbID, java.util.Map modelAndCBNames, java.lang.String userName)
          Set connector binding names for models in a virtual database.
 void setVBDStatus(VirtualDatabaseID virtualID, 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST_VERSION

public static final java.lang.String FIRST_VERSION
See Also:
Constant Field Values
Constructor Detail

UpdateController

public UpdateController(TransactionMgr transactionMgr)
Method Detail

setVBDStatus

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

Parameters:
virtualID - representss the VirtualDatabase to be updated
userName - of the person requesting the change
status - is the state the VirtualDatabase should be set to
Throws:
RuntimeMetadataException - if unable to perform update.
InvalidStateException - if the status to be set is invalid.
VirtualDatabaseException

deleteVirtualDatabase

public void deleteVirtualDatabase(VirtualDatabaseID vdbID)
                           throws InvalidStateException,
                                  VirtualDatabaseException
Throws:
InvalidStateException
VirtualDatabaseException

setConnectorBindingNames

public void setConnectorBindingNames(VirtualDatabaseID vdbID,
                                     java.util.Map modelAndCBNames,
                                     java.lang.String userName)
                              throws VirtualDatabaseException
Set connector binding names for models in a virtual database. If the names are set for all the models, the virtual database status is changed to Inactive.

Parameters:
vdbID - is the VirtualDatabaseID
modelAndCBNames - contains ModelID and connector binding name pare.
Throws:
VirtualDatabaseException - an error occurs while trying to read the data.

updateVirtualDatabase

public void updateVirtualDatabase(VirtualDatabase vdb,
                                  java.lang.String userName)
                           throws VirtualDatabaseException
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.

Parameters:
vdb - VDB to be updated.
userName - of the person updating the virtual database.
Throws:
VirtualDatabaseException

getReadTransaction

protected MetaBaseConnector getReadTransaction()
                                        throws ManagedConnectionException
Throws:
ManagedConnectionException

getWriteTransaction

protected MetaBaseConnector getWriteTransaction()
                                         throws ManagedConnectionException
Throws:
ManagedConnectionException

buildVirtualDatabaseObject

protected BasicVirtualDatabase buildVirtualDatabaseObject(VDBArchive vdbArchive,
                                                          java.lang.String userName,
                                                          boolean inMemory)
                                                   throws VirtualDatabaseException
Create a new instance of a VirtualDatabase object using the supplied information.

Parameters:
vdbID - the MetadataID of the virtual database
vdbUUID - the UUID for the virtual database (typically matches the project's UUID)
vdbName - the name for the new VDB
userName - the name of the user that is creating the VDB
description - the description for the VDB
inMemory - true if the VirtualDatabase is to be used only in memory, or false if VirtualDatabase instances are persisted in a repository. If set to false, then this method ensures that the version number of the VDB will be incremented over what is already in the persistent store.
Returns:
the new VirtualDatabase object
Throws:
VirtualDatabaseException - if there is an error

createVirtualDatabaseID

protected long createVirtualDatabaseID()
                                throws VirtualDatabaseException
Throws:
VirtualDatabaseException

createVirtualDatabase

public VirtualDatabase createVirtualDatabase(VDBArchive vdbArchive,
                                             java.lang.String userName)
                                      throws VirtualDatabaseException
Parameters:
vdbName -
dtcInfo -
userName -
vdbIndexFile -
vdm -
Returns:
Throws:
VirtualDatabaseException

getVDBArchive

public byte[] getVDBArchive(java.lang.String fileName)
                     throws VirtualDatabaseException
Throws:
VirtualDatabaseException


Copyright © 2009. All Rights Reserved.