com.metamatrix.vdb.runtime
Class BasicVDBDefn

java.lang.Object
  extended by com.metamatrix.vdb.runtime.BasicVDBInfo
      extended by com.metamatrix.vdb.runtime.BasicVDBDefn
All Implemented Interfaces:
VDBDefn, VDBInfo, java.io.Serializable

public class BasicVDBDefn
extends BasicVDBInfo
implements VDBDefn

Date Dec 3, 2002 To import a VDB, the following information is required: 1. VDB Jar #setVDBJar(Object). This jar will provide the model and their model info. 2. Add a model to connector binding mapping #addModelToConnectorMapping(String, String) that indicates which binding should be used for that model 3. set VDB name (version will be assign at creation time) Optional information: 1. Add a ConnectorBinding addConnectorBinding(ConnectorBinding). If this already exist in the configration, it will not be loaded. The model will reference the existing binding. If not added, the connector binding mapping will indicate an assumed already existing binding. 2. Add a ConnectorType {@link #addConnectorType(ComponentType). If already exist in the configration, it will not be loaded. The binding will reference the existing type.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.metamatrix.vdb.runtime.BasicVDBInfo
modelInfos
 
Constructor Summary
BasicVDBDefn(java.lang.String name)
           
 
Method Summary
 void addConnectorBinding(ConnectorBinding binding)
           
 void addConnectorBinding(java.lang.String modelName, ConnectorBinding binding)
          Call to add the binding to the VDBDefn set of bindings and add the binding to the model-to-binding mapping.
 void addConnectorType(ComponentType type)
           
 void determineVdbsStatus()
           
 boolean doesVDBHaveValidityError()
          Returns true if the VDBDefn was built from a .VDB file that had a validity error;
 ConnectorBinding getConnectorBindingByName(java.lang.String bindingName)
          Returns the connector binding for the specified connector binding name.
 ConnectorBinding getConnectorBindingByRouting(java.lang.String routingUUID)
          Returns the connector binding for the specified routing UUID.
 java.util.Map getConnectorBindings()
          Returns the connector bindings that are used in this VDB.
 ComponentType getConnectorType(java.lang.String componentTypeName)
          Returns the component type for the specified componentTypeName.
 java.util.Map getConnectorTypes()
          Returns the connector types that are used in this VDB.
 char[] getDataRoles()
          Get the XML contents of data roles defined for the VDB;
 java.util.Properties getHeaderProperties()
          Header Properties
 java.util.Properties getInfoProperties()
           
 ModelInfo getMatertializationModel()
          Get the Materialization model in this VDB if one exists.
 java.util.Collection getModelNames()
          Returns the collection of all the model names contained in the vdb archive.
 java.util.Map getModelToBindingMappings()
          Returns the model to connector binding mappings.
 short getStatus()
          Returns a short indicating if the status of the VirtualDatabase.
 VDBStream getVDBStream()
          This will let the uses stream the VDB contents the way they would need.
 java.lang.String[] getVDBValidityErrors()
          During the load of the VDB, if there are any validity errors reported in the VDB manifest file, they will be loaded into Defn file for observation or for the logging.
 boolean isActiveStatus()
           
 boolean isBindingInUse(ConnectorBinding binding)
           
 boolean isBindingInUse(java.lang.String bindingName)
           
 boolean isVisible(java.lang.String resourcePath)
          Is the given resource file is visible to the user.
 void removeConnectorBinding(java.lang.String bindingName)
           
 void removeConnectorBinding(java.lang.String modelName, java.lang.String bindingName)
           
 void removeConnectorBindingNameOnly(java.lang.String bindingName)
           
 void removeConnectorType(java.lang.String typeName)
           
 ModelInfo removeModelInfo(java.lang.String modelName)
           
 ModelInfo removeModelInfo(java.lang.String modelName, boolean removeBindings)
           
 void removeUnmappedBindings()
          Remove ConnectorBindings from this VDBDefn that are not referenced by any of the ModelInfos
 void renameConnectorBinding(java.lang.String existingBindingName, java.lang.String newBindingName)
           
 void renameModelInfo(java.lang.String modelName, java.lang.String newModelName)
           
 void setConnectorBinding(java.lang.String modelName, ConnectorBinding binding)
          Call to add the binding to the VDBDefn set of bindings and initializes the set of model-to-binding mappings with the binding.
protected  void setConnectorBindings(java.util.Map bindings)
           
protected  void setConnectorTypes(java.util.Map types)
           
 void setDataRoles(char[] roles)
           
 void setHeaderProperties(java.util.Properties props)
           
 void setInfoProperties(java.util.Properties props)
           
 void setStatus(short status)
          Set the status of the VDB see MetadataConstants.VDB_STATUS
 void setVDBStream(VDBStream stream)
           
 void setVDBValidityError(boolean hasError)
           
 void setVDBValidityError(boolean hasError, java.lang.String msg)
           
 void setVisibility(java.lang.String resoucePath, boolean visible)
           
 
Methods inherited from class com.metamatrix.vdb.runtime.BasicVDBInfo
addModelInfo, getCreatedBy, getDateCreated, getDescription, getFileName, getModel, getModels, getName, getUUID, getVersion, hasWSDLDefined, setCreatedBy, setDateCreated, setDescription, setFileName, setHasWSDLDefined, setModelInfos, setName, setUUID, setVersion, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.metamatrix.common.vdb.api.VDBDefn
getVersion
 
Methods inherited from interface com.metamatrix.common.vdb.api.VDBInfo
getCreatedBy, getDateCreated, getDescription, getFileName, getModel, getModels, getName, getUUID, hasWSDLDefined
 

Constructor Detail

BasicVDBDefn

public BasicVDBDefn(java.lang.String name)
Method Detail

getVDBStream

public VDBStream getVDBStream()
Description copied from interface: VDBDefn
This will let the uses stream the VDB contents the way they would need. hanging on to whole byte[] may be costly in terms of memory.

Specified by:
getVDBStream in interface VDBDefn
Returns:
Since:
4.3
See Also:
VDBDefn.getVDBStream()

setVDBStream

public void setVDBStream(VDBStream stream)

doesVDBHaveValidityError

public boolean doesVDBHaveValidityError()
Description copied from interface: VDBDefn
Returns true if the VDBDefn was built from a .VDB file that had a validity error;

Specified by:
doesVDBHaveValidityError in interface VDBDefn
Returns:

addConnectorBinding

public void addConnectorBinding(java.lang.String modelName,
                                ConnectorBinding binding)
Call to add the binding to the VDBDefn set of bindings and add the binding to the model-to-binding mapping.

Parameters:
modelName -
binding -
Since:
4.2

addConnectorBinding

public void addConnectorBinding(ConnectorBinding binding)

renameConnectorBinding

public void renameConnectorBinding(java.lang.String existingBindingName,
                                   java.lang.String newBindingName)

removeConnectorBinding

public void removeConnectorBinding(java.lang.String bindingName)

removeConnectorBindingNameOnly

public void removeConnectorBindingNameOnly(java.lang.String bindingName)

removeConnectorBinding

public void removeConnectorBinding(java.lang.String modelName,
                                   java.lang.String bindingName)

isBindingInUse

public boolean isBindingInUse(ConnectorBinding binding)

isBindingInUse

public boolean isBindingInUse(java.lang.String bindingName)

setConnectorBinding

public void setConnectorBinding(java.lang.String modelName,
                                ConnectorBinding binding)
Call to add the binding to the VDBDefn set of bindings and initializes the set of model-to-binding mappings with the binding.

Parameters:
modelName -
binding -
Since:
4.2

setConnectorBindings

protected void setConnectorBindings(java.util.Map bindings)

setConnectorTypes

protected void setConnectorTypes(java.util.Map types)

removeConnectorType

public void removeConnectorType(java.lang.String typeName)

addConnectorType

public void addConnectorType(ComponentType type)

getConnectorTypes

public java.util.Map getConnectorTypes()
Description copied from interface: VDBDefn
Returns the connector types that are used in this VDB. The connector types are optional, if not specified on the import, then the connector type(s) is assumed to already exist in configuration connector type name ComponentType ComponentType

Specified by:
getConnectorTypes in interface VDBDefn

getConnectorType

public ComponentType getConnectorType(java.lang.String componentTypeName)
Description copied from interface: VDBDefn
Returns the component type for the specified componentTypeName. This is a helper method for mapping the connector binding type to its respective connector component type

Specified by:
getConnectorType in interface VDBDefn
Returns:
ComponentType

getConnectorBindings

public java.util.Map getConnectorBindings()
Description copied from interface: VDBDefn
Returns the connector bindings that are used in this VDB. The connector bindings are optional, if not specified on the import, then the connector binding(s) is assumed to already exist in configuration connector binding name ConnectorBinding ConnectorBinding

Specified by:
getConnectorBindings in interface VDBDefn
Returns:
Map of connector types

getConnectorBindingByRouting

public ConnectorBinding getConnectorBindingByRouting(java.lang.String routingUUID)
Description copied from interface: VDBDefn
Returns the connector binding for the specified routing UUID. This is a helper method for mapping the modelBindingMappings between the model and the connector binding.

Specified by:
getConnectorBindingByRouting in interface VDBDefn
Returns:
ConnectorBinding

getConnectorBindingByName

public ConnectorBinding getConnectorBindingByName(java.lang.String bindingName)
Description copied from interface: VDBDefn
Returns the connector binding for the specified connector binding name.

Specified by:
getConnectorBindingByName in interface VDBDefn
Returns:
ConnectorBinding

getModelToBindingMappings

public java.util.Map getModelToBindingMappings()
Description copied from interface: VDBDefn
Returns the model to connector binding mappings. Model Name List of ConnectorBinding routing UUIDs.

Specified by:
getModelToBindingMappings in interface VDBDefn
Returns:
Map

getModelNames

public java.util.Collection getModelNames()
Returns the collection of all the model names contained in the vdb archive.

Specified by:
getModelNames in interface VDBDefn
Returns:
Collection

removeModelInfo

public ModelInfo removeModelInfo(java.lang.String modelName,
                                 boolean removeBindings)

removeModelInfo

public ModelInfo removeModelInfo(java.lang.String modelName)
Overrides:
removeModelInfo in class BasicVDBInfo

getMatertializationModel

public ModelInfo getMatertializationModel()
Description copied from interface: VDBDefn
Get the Materialization model in this VDB if one exists.

Specified by:
getMatertializationModel in interface VDBDefn
Returns:
the Materialization model or null if none exists.
Since:
4.2
See Also:
VDBDefn.getMatertializationModel()

getStatus

public short getStatus()
Description copied from interface: VDBDefn
Returns a short indicating if the status of the VirtualDatabase. There are four status of the VirtualDatabase: "Incomplete", "Inactive", "Active", and "Deleted".

Specified by:
getStatus in interface VDBDefn
Returns:
boolean true indicates marked for deletion
See Also:
MetadataConstants.VDB_STATUS VDB_STATUS}

setStatus

public void setStatus(short status)
Set the status of the VDB see MetadataConstants.VDB_STATUS

Parameters:
status -
Since:
4.2

isActiveStatus

public boolean isActiveStatus()
Specified by:
isActiveStatus in interface VDBDefn

setVDBValidityError

public void setVDBValidityError(boolean hasError)

setVDBValidityError

public void setVDBValidityError(boolean hasError,
                                java.lang.String msg)

getVDBValidityErrors

public java.lang.String[] getVDBValidityErrors()
Description copied from interface: VDBDefn
During the load of the VDB, if there are any validity errors reported in the VDB manifest file, they will be loaded into Defn file for observation or for the logging.

Specified by:
getVDBValidityErrors in interface VDBDefn
Returns:
list of errors, empty list if none logged.

determineVdbsStatus

public void determineVdbsStatus()

removeUnmappedBindings

public void removeUnmappedBindings()
Remove ConnectorBindings from this VDBDefn that are not referenced by any of the ModelInfos

Since:
4.3

isVisible

public boolean isVisible(java.lang.String resourcePath)
Description copied from interface: VDBDefn
Is the given resource file is visible to the user.

Specified by:
isVisible in interface VDBDefn
Parameters:
resourcePath - - path in the VDB file
Returns:
true if visible; false otherwise
See Also:
VDBDefn.isVisible(java.lang.String)

setVisibility

public void setVisibility(java.lang.String resoucePath,
                          boolean visible)

getDataRoles

public char[] getDataRoles()
Description copied from interface: VDBDefn
Get the XML contents of data roles defined for the VDB;

Specified by:
getDataRoles in interface VDBDefn
Returns:
xml contents; null if data roles not defined.
See Also:
VDBDefn.getDataRoles()

setDataRoles

public void setDataRoles(char[] roles)

renameModelInfo

public void renameModelInfo(java.lang.String modelName,
                            java.lang.String newModelName)

getHeaderProperties

public java.util.Properties getHeaderProperties()
Description copied from interface: VDBDefn
Header Properties

Specified by:
getHeaderProperties in interface VDBDefn
Returns:

setHeaderProperties

public void setHeaderProperties(java.util.Properties props)

getInfoProperties

public java.util.Properties getInfoProperties()

setInfoProperties

public void setInfoProperties(java.util.Properties props)


Copyright © 2009. All Rights Reserved.