|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.metadata.runtime.RuntimeMetadataCatalog
public class RuntimeMetadataCatalog
The RuntimeMetadataCatalog follows the Singleton pattern so there should be only one instance per VM of this class. All consumers of RuntimeMetadata should be calling this class.
In order to get runtime metadata, you must first request a VirtualDatabaseMetadata
object based on a specific VirtualDatabase name and version. Therefore, for each different
VirtualDatabase you need information, you will need to request a different VirtualDatabaseMetadata.
Once you have this object, the metadata for that VirtualDatabase can be interrogated.
However, the VirtualDatabaseMetadata is "READ ONLY". For creating new VirtualDatabases or updating existing ones, there are methods here that provide that functionality.
Method Summary | |
---|---|
void |
clearCache()
clear the cache. |
VirtualDatabase |
createVirtualDatabase(VDBArchive vdbArchive,
java.lang.String userName)
Call to create and return a VirtualDatabase , based on the
VDBInfo that contains a list of ModelInfo instances for that virtual database. |
void |
deleteVirtualDatabase(VirtualDatabaseID vdbID)
Call to delete a VirtualDatabase from the system. |
VirtualDatabaseID |
getActiveVirtualDatabaseID(java.lang.String vdbName,
java.lang.String vdbVersion)
Returns the id for the VirtualDatabase that is in an 'Active' state. |
java.util.Collection |
getDeletedVirtualDatabaseIDs()
Returns a collection of VirtualDatabaseID's that are marked for deletion. |
static RuntimeMetadataCatalog |
getInstance()
|
Model |
getModel(java.lang.String modelName,
VirtualDatabaseID vdbID)
Returns a Collection of type Model that represents
all the models that where deployed in the specified virtual database. |
java.util.Collection |
getModels(VirtualDatabaseID vdbID)
Returns a Collection of type Model that represents
all the models that where deployed in the specified virtual database. |
java.util.List |
getMutiSourcedModels(VirtualDatabaseID vdbID)
Returns a Collection of type String that represents
all the models that where deployed in the specified virtual database. |
QueryMetadataInterface |
getQueryMetadata(VirtualDatabaseID vdbID)
|
QueryMetadataCache |
getQueryMetadataCache()
|
byte[] |
getSystemVDBArchive()
Returns the System VDB Archive |
byte[] |
getVDBArchive(VirtualDatabaseID vdbID)
Returns the VDB Archive specified by the virtual database ID. |
VirtualDatabase |
getVirtualDatabase(VirtualDatabaseID vdbID)
Returns the virtual database specified by the virtual database ID. |
VirtualDatabaseID |
getVirtualDatabaseID(java.lang.String vdbName,
java.lang.String vdbVersion)
Returns the id for the VirtualDatabase that is in the repository. |
VirtualDatabaseMetadata |
getVirtualDatabaseMetadata(VirtualDatabaseID vdbID)
Returns a VirtualDatabaseMetadata that contains the VirtualDatabase based on the virtual database name and version. |
java.util.Collection |
getVirtualDatabases()
Returns a Collection of all the VirtualDatabase's in the system. |
void |
init(java.util.Properties runtimeProperties,
MessageBus messageBus,
CacheFactory factory)
The init method needs to be called prior to executing any other methods. |
boolean |
isVisible(java.lang.String resourcePath,
VirtualDatabaseID vdbID)
Returns the visibility for a resource path that exist in a given vdb |
static void |
refreshProperties()
call to refresh the runtime metadata properties. |
EventObjectListener |
registerRuntimeMetadataListener(RuntimeMetadataListener listener)
|
void |
removeRuntimeMetadataListener(EventObjectListener listener)
|
void |
setConnectorBindingNames(VirtualDatabaseID vdbID,
java.util.Map modelAndCBNames,
java.lang.String userName)
Set connector binding names for models in a virtual database. |
protected void |
setTransactionManager(TransactionMgr transactionMgr)
|
void |
setVDBStatus(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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static RuntimeMetadataCatalog getInstance()
public EventObjectListener registerRuntimeMetadataListener(RuntimeMetadataListener listener) throws VirtualDatabaseException
VirtualDatabaseException
public void removeRuntimeMetadataListener(EventObjectListener listener) throws VirtualDatabaseException
VirtualDatabaseException
public VirtualDatabase createVirtualDatabase(VDBArchive vdbArchive, java.lang.String userName) throws VirtualDatabaseException
VirtualDatabase
, based on the
VDBInfo that contains a list of ModelInfo instances for that virtual database.
vdbInfo
- contains the VDB information used to create the VDB.userName
- of the person creating the virtual databasevdbIndexFile
- the jar file that contains all the index files used by the models in this vdb.
VirtualDatabaseException
- is thrown if a problem occurs during the creation process.public VirtualDatabaseMetadata getVirtualDatabaseMetadata(VirtualDatabaseID vdbID) throws VirtualDatabaseException
VirtualDatabaseMetadata
that contains the VirtualDatabase
based on the virtual database name and version.
vdbID
- is the VirtualDatabase to retrieve
VirtualDatabaseException
- is thrown if a problem occurs during retrieval process.public VirtualDatabaseID getActiveVirtualDatabaseID(java.lang.String vdbName, java.lang.String vdbVersion) throws VirtualDatabaseDoesNotExistException, VirtualDatabaseException
vdbName
- is the name of the VirtualDatabasevdbVersion
- is the version. Default to latest version if it is null.
VirtualDatabaseDoesNotExistException
- is thrown if the VirtualDatabase is not found in an active state
VirtualDatabaseException
- is thrown if a problem occurs during retrieval process.public VirtualDatabaseID getVirtualDatabaseID(java.lang.String vdbName, java.lang.String vdbVersion) throws VirtualDatabaseDoesNotExistException, VirtualDatabaseException
vdbName
- is the name of the VirtualDatabasevdbVersion
- is the version
VirtualDatabaseDoesNotExistException
- is thrown if the VirtualDatabase is not found in an active state
VirtualDatabaseException
- is thrown if a problem occurs during retrieval process.public void setVDBStatus(VirtualDatabaseID virtualDBID, short status, java.lang.String userName) throws VirtualDatabaseException
VirtualDatabase
status.
The following four status are valid. They are defined in MetadataConstants
:
Incomplete: The virtual 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.
userName
- of the person requesting the changestatus
- is the state the VirtualDatabase should be set to
VirtualDatabaseException
- if unable to perform update.public java.util.Collection getVirtualDatabases() throws VirtualDatabaseException
Collection
of all the VirtualDatabase's in the system. This would include all virtual databases flagged as incomplete, active, inactive or deleted.
VirtualDatabaseException
- is thrown if a problem occurs during the retrieval process.public byte[] getVDBArchive(VirtualDatabaseID vdbID) throws VirtualDatabaseException
VirtualDatabaseException
- is thrown if a problem occurs during the retrieval process.public byte[] getSystemVDBArchive() throws VirtualDatabaseException
VirtualDatabaseException
- is thrown if a problem occurs during the retrieval process.public VirtualDatabase getVirtualDatabase(VirtualDatabaseID vdbID) throws VirtualDatabaseException
VirtualDatabaseException
- is thrown if a problem occurs during the retrieval process.public java.util.Collection getDeletedVirtualDatabaseIDs() throws VirtualDatabaseException
VirtualDatabaseException
- is thrown if a problem occurs during retrieval process.public void deleteVirtualDatabase(VirtualDatabaseID vdbID) throws VirtualDatabaseException
vdbID
- is the VirtualDatabase to be deleted
VirtualDatabaseException
- is thrown if a problem occurs during the deletion process.public static void refreshProperties() throws VirtualDatabaseException
VirtualDatabaseException
public java.util.Collection getModels(VirtualDatabaseID vdbID) throws VirtualDatabaseException
Collection
of type Model
that represents
all the models that where deployed in the specified virtual database. This method
shoud only used by Admin Console.
vdbID
- is the VirtualDatabaseID
VirtualDatabaseException
- an error occurs while trying to read the data.public java.util.List getMutiSourcedModels(VirtualDatabaseID vdbID) throws VirtualDatabaseException
Collection
of type String
that represents
all the models that where deployed in the specified virtual database. This method
shoud only used by Admin Console.
vdbID
- is the VirtualDatabaseID
VirtualDatabaseException
- an error occurs while trying to read the data.public boolean isVisible(java.lang.String resourcePath, VirtualDatabaseID vdbID) throws VirtualDatabaseException
resourcePath
- vdbID
- is the id for which the resource must exist
true
if the resource is visible.
VirtualDatabaseException
public Model getModel(java.lang.String modelName, VirtualDatabaseID vdbID) throws VirtualDatabaseException
Collection
of type Model
that represents
all the models that where deployed in the specified virtual database. This method
shoud only used by Admin Console.
vdbID
- is the VirtualDatabaseID
VirtualDatabaseException
- an error occurs while trying to read the data.public void setConnectorBindingNames(VirtualDatabaseID vdbID, java.util.Map modelAndCBNames, java.lang.String userName) throws VirtualDatabaseException
vdbID
- is the VirtualDatabaseIDmodelAndCBNames
- contains Model name and connector binding name pare.userName
- of the person setting the connection binding names for the virtual database.
VirtualDatabaseException
- an error occurs while trying to read the data.public void updateVirtualDatabase(VirtualDatabase vdb, java.lang.String userName) throws VirtualDatabaseException
VirtualDatabase.ModifiableAttributes
can be modefied. Call VirtualDatabase.update(String attribute, Object value)
to update each attribute of the VDB before calling this method.
vdb
- VDB to be updated.userName
- of the person updating the virtual database.
VirtualDatabaseException
public void init(java.util.Properties runtimeProperties, MessageBus messageBus, CacheFactory factory) throws VirtualDatabaseException, MessagingException
VirtualDatabaseException
- if the RuntimeMetadataCatalog cannot be initialized.
MessagingException
public QueryMetadataInterface getQueryMetadata(VirtualDatabaseID vdbID) throws VirtualDatabaseException
VirtualDatabaseException
public QueryMetadataCache getQueryMetadataCache() throws VirtualDatabaseException
VirtualDatabaseException
public void clearCache() throws VirtualDatabaseException
VirtualDatabaseException
protected void setTransactionManager(TransactionMgr transactionMgr)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |