net.sf.farrago.catalog
Interface FarragoRepos

All Superinterfaces:
ClosableAllocation, FarragoAllocation, FarragoMetadataFactory
All Known Implementing Classes:
FarragoMdrReposImpl, FarragoReposImpl, JmiMemTest.FarragoMemRepos

public interface FarragoRepos
extends FarragoAllocation, FarragoMetadataFactory

FarragoRepos represents a loaded repository containing Farrago metadata.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/catalog/FarragoRepos.java#36 $
Author:
John V. Sichi

Method Summary
 void addResourceBundles(List<ResourceBundle> bundles)
          Defines localization for this repository.
<T extends RefObject>
Collection<T>
allOfClass(Class<T> clazz)
          Returns a collection of all instances of a given class.
<T extends RefObject>
Collection<T>
allOfType(Class<T> clazz)
          Returns a collection of all instances of a given type.
 void beginReposSession()
          Begins a session on the metadata repository.
 void beginReposTxn(boolean writable)
          Begins a metadata transaction on the repository.
 void endReposSession()
          Ends a session on the metadata repository.
 void endReposTxn(boolean rollback)
          Ends a metadata transaction on the repository.
 String expandProperties(String value)
          Returns the input string with property values substituted for variables of the form ${VARNAME}, such as that done by FarragoProperties.expandProperties(String)..
 CwmCatalog getCatalog(String catalogName)
          Looks up a catalog by name.
 FemFarragoConfig getCurrentConfig()
           
 String getDefaultCharsetName()
           
 String getDefaultCollationName()
           
 EnkiMDRepository getEnkiMdrRepos()
          Returns an EnkiMDRepository storing this Farrago repository.
 int getIdentifierPrecision()
           
 String getLocalizedClassName(RefClass refClass)
          Looks up the localized name for a class of metadata.
 String getLocalizedObjectName(CwmModelElement modelElement)
          Formats the fully-qualified localized name for an existing object, including its type.
 String getLocalizedObjectName(CwmModelElement modelElement, RefClass refClass)
          Formats the fully-qualified localized name for an existing object.
 String getLocalizedObjectName(String name)
          Formats the localized name for an unqualified typeless object.
 String getLocalizedObjectName(String qualifierName, String objectName, RefClass refClass)
          Formats the fully-qualified localized name for an object that may not exist yet.
 MDRepository getMdrRepos()
           
 Object getMetadataFactory(String prefix)
          Returns the metadata factory for a particular plugin.
 JmiModelGraph getModelGraph()
           
 FarragoModelLoader getModelLoader()
          Returns the FarragoModelLoader for this repos.
 JmiModelView getModelView()
           
 CwmCatalog getSelfAsCatalog()
           
 FarragoSequenceAccessor getSequenceAccessor(String mofId)
          Returns the an accessor for a sequence stored in the repository
 CwmTaggedValue getTag(CwmModelElement element, String tagName)
          Deprecated. use getTagAnnotation instead
 FemTagAnnotation getTagAnnotation(FemAnnotatedElement element, String tagName)
          Gets an element's annotation tag.
 String getTagAnnotationValue(FemAnnotatedElement element, String tagName)
          Gets a value tagged to an annotated element.
 String getTagValue(CwmModelElement element, String tagName)
          Deprecated. use getTagAnnotationValue instead
 FarragoPackage getTransientFarragoPackage()
           
 boolean isFennelEnabled()
           
 FarragoReposTxnContext newTxnContext()
          Returns an instance of FarragoReposTxnContext for use in executing transactions against this repository without automatic repository session management.
 FarragoReposTxnContext newTxnContext(boolean manageReposSession)
          Returns an instance of FarragoReposTxnContext for use in executing transactions against this repository.
 void setTagAnnotationValue(FemAnnotatedElement element, String tagName, String tagValue)
          Tags an annotated element.
 void setTagValue(CwmModelElement element, String tagName, String tagValue)
          Deprecated. use setTagAnnotationValue instead
 List<FarragoReposIntegrityErr> verifyIntegrity(RefObject refObj)
          Verifies the integrity of the repository.
 
Methods inherited from interface org.eigenbase.util.ClosableAllocation
closeAllocation
 
Methods inherited from interface net.sf.farrago.FarragoMetadataFactory
getBehavioralPackage, getCompiledModelTimestamp, getConfigPackage, getCorePackage, getCwmPackage, getDataTypesPackage, getEnumerationsPackage, getFarragoPackage, getFemPackage, getFennelPackage, getInstancePackage, getKeysIndexesPackage, getMedPackage, getPrimitiveTypesPackage, getRelationalPackage, getRootPackage, getSecurityPackage, getSql2003Package, newCwmArgument, newCwmAttribute, newCwmBooleanExpression, newCwmCallAction, newCwmCatalog, newCwmCheckConstraint, newCwmClass, newCwmColumn, newCwmColumnSet, newCwmColumnValue, newCwmConstraint, newCwmDataType, newCwmDataValue, newCwmDependency, newCwmEnumeration, newCwmEnumerationLiteral, newCwmEvent, newCwmExpression, newCwmExtent, newCwmForeignKey, newCwmIndex, newCwmIndexedFeature, newCwmInterface, newCwmKeyRelationship, newCwmMethod, newCwmModel, newCwmMultiplicity, newCwmMultiplicityRange, newCwmNamedColumnSet, newCwmObject, newCwmOperation, newCwmPackage, newCwmParameter, newCwmPrimaryKey, newCwmProcedure, newCwmProcedureExpression, newCwmQueryColumnSet, newCwmQueryExpression, newCwmRow, newCwmRowSet, newCwmSchema, newCwmSlot, newCwmSqldistinctType, newCwmSqlindex, newCwmSqlindexColumn, newCwmSqlparameter, newCwmSqlsimpleType, newCwmSqlstructuredType, newCwmStereotype, newCwmSubsystem, newCwmTable, newCwmTaggedValue, newCwmTrigger, newCwmTypeAlias, newCwmUnion, newCwmUnionMember, newCwmUniqueConstraint, newCwmUniqueKey, newCwmView, newFemAggInvocation, newFemAggStreamDef, newFemBarrierStreamDef, newFemBeginTxnCmd, newFemBernoulliSamplingStreamDef, newFemBufferingTupleStreamDef, newFemBufferReaderStreamDef, newFemBufferWriterStreamDef, newFemCalcTupleStreamDef, newFemCartesianProductStreamDef, newFemCmdAbandonBackup, newFemCmdAlterSystemDeallocate, newFemCmdBeginTxn, newFemCmdBeginTxnWithCsn, newFemCmdCheckpoint, newFemCmdCloseDatabase, newFemCmdCommit, newFemCmdCompleteBackup, newFemCmdCreateExecutionStreamGraph, newFemCmdCreateIndex, newFemCmdCreateStreamHandle, newFemCmdDropIndex, newFemCmdGetLastCommittedTxnId, newFemCmdGetTxnCsn, newFemCmdInitiateBackup, newFemCmdOpenDatabase, newFemCmdPrepareExecutionStreamGraph, newFemCmdRestoreFromBackup, newFemCmdRollback, newFemCmdSavepoint, newFemCmdSetParam, newFemCmdTruncateIndex, newFemCmdVerifyIndex, newFemCmdVersionIndexRoot, newFemCollectTupleStreamDef, newFemColumnHistogram, newFemColumnHistogramBar, newFemColumnListRoutineParameter, newFemColumnName, newFemCorrelation, newFemCorrelationJoinStreamDef, newFemCsnHandle, newFemCsnHandleReturningCmd, newFemDatabaseParam, newFemDataServer, newFemDataWrapper, newFemDbHandle, newFemDynamicParameter, newFemDynamicParamUse, newFemElementWithStorageOptions, newFemExecStreamDataFlow, newFemFarragoConfig, newFemFennelConfig, newFemFlatFileTupleStreamDef, newFemForeignTable, newFemGenericStreamDef, newFemGrant, newFemIndexLoaderDef, newFemIndexScanDef, newFemIndexSearchDef, newFemIndexStatistics, newFemIndexWriterDef, newFemJar, newFemJavaSinkStreamDef, newFemJavaTransformStreamDef, newFemKeyComponent, newFemLabel, newFemLbmBitOpStreamDef, newFemLbmChopperStreamDef, newFemLbmGeneratorStreamDef, newFemLbmIntersectStreamDef, newFemLbmMinusStreamDef, newFemLbmNormalizerStreamDef, newFemLbmSearchStreamDef, newFemLbmSortedAggStreamDef, newFemLbmSplicerStreamDef, newFemLbmUnionStreamDef, newFemLcsClusterAppendStreamDef, newFemLcsClusterReplaceStreamDef, newFemLcsClusterScanDef, newFemLcsRowScanStreamDef, newFemLhxAggStreamDef, newFemLhxJoinStreamDef, newFemLocalCatalog, newFemLocalIndex, newFemLocalIndexColumn, newFemLocalSchema, newFemLocalTable, newFemLocalView, newFemMergeStreamDef, newFemMockTupleStreamDef, newFemMultiUseBufferingStreamDef, newFemNestedLoopJoinStreamDef, newFemPrimaryKeyConstraint, newFemRecoveryReference, newFemReshapeParameter, newFemReshapeStreamDef, newFemRole, newFemRoutine, newFemRoutineParameter, newFemRowCountStatistics, newFemSampleDataset, newFemSequenceGenerator, newFemSortedAggStreamDef, newFemSortingStreamDef, newFemSplicerIndexAccessorDef, newFemSplitterStreamDef, newFemSqlarrayType, newFemSqldistinguishedType, newFemSqlmultisetType, newFemSqlobjectType, newFemSqlpathElement, newFemSqlrowType, newFemSqltypeAttribute, newFemStorageOption, newFemStoredColumn, newFemStreamGraphHandle, newFemStreamHandle, newFemSvptHandle, newFemSystemBackup, newFemTableDeleterDef, newFemTableInserterDef, newFemTableUpdaterDef, newFemTagAnnotation, newFemTimestamp, newFemTupleAccessor, newFemTupleAttrAccessor, newFemTupleAttrDescriptor, newFemTupleAttrProjection, newFemTupleDescriptor, newFemTupleProjection, newFemTxnHandle, newFemUncollectTupleStreamDef, newFemUniqueKeyConstraint, newFemUser, newFemUserDefinedOrdering, newFemUserDefinedType, newFemValuesStreamDef, newFemViewColumn, newFemWindowDef, newFemWindowPartitionDef, newFemWindowStreamDef, setRootPackage
 

Method Detail

getMdrRepos

MDRepository getMdrRepos()
Returns:
MDRepository storing this Farrago repository

getEnkiMdrRepos

EnkiMDRepository getEnkiMdrRepos()
Returns an EnkiMDRepository storing this Farrago repository. This method returns the same instance of getMdrRepos().

Returns:
EnkiMDRepository storing this Farrago repository

getModelGraph

JmiModelGraph getModelGraph()
Returns:
model graph for repository metamodel

getModelView

JmiModelView getModelView()
Returns:
model view for repository metamodel

getTransientFarragoPackage

FarragoPackage getTransientFarragoPackage()
Returns:
root package for transient metadata

getSelfAsCatalog

CwmCatalog getSelfAsCatalog()
Returns:
CwmCatalog representing this FarragoRepos

getIdentifierPrecision

int getIdentifierPrecision()
Returns:
maximum identifier length in characters

getCurrentConfig

FemFarragoConfig getCurrentConfig()
Returns:
element describing the configuration parameters

getDefaultCharsetName

String getDefaultCharsetName()
Returns:
the name of the default Charset for this repository

getDefaultCollationName

String getDefaultCollationName()
Returns:
the name of the default collation name for this repository. The value is of the form charset$locale$strength, as per SqlParserUtil.parseCollation(String). The default is "ISO-8859-1$en_US".

isFennelEnabled

boolean isFennelEnabled()
Returns:
true iff Fennel support should be used

getLocalizedObjectName

String getLocalizedObjectName(CwmModelElement modelElement)
Formats the fully-qualified localized name for an existing object, including its type.

Calling getLocalizedObjectName(e) is identical to calling getLocalizedObjectName(e, e.refClass()).

Parameters:
modelElement - catalog object
Returns:
localized name

getLocalizedObjectName

String getLocalizedObjectName(String name)
Formats the localized name for an unqualified typeless object.

Parameters:
name - object name
Returns:
localized name

getLocalizedObjectName

String getLocalizedObjectName(CwmModelElement modelElement,
                              RefClass refClass)
Formats the fully-qualified localized name for an existing object.

Parameters:
modelElement - catalog object
refClass - if non-null, use this as the type of the object, e.g. "table SCHEMA.TABLE"; if null, don't include type (e.g. just "SCHEMA.TABLE")
Returns:
localized name

getLocalizedObjectName

String getLocalizedObjectName(String qualifierName,
                              String objectName,
                              RefClass refClass)
Formats the fully-qualified localized name for an object that may not exist yet.

Parameters:
qualifierName - name of containing object, or null for unqualified name
objectName - name of object
refClass - if non-null, the object type to use in the name; if null, no type is prepended
Returns:
localized name

getLocalizedClassName

String getLocalizedClassName(RefClass refClass)
Looks up the localized name for a class of metadata.

Parameters:
refClass - class of metadata, e.g. CwmTableClass
Returns:
localized name, e.g. "table"

getCatalog

CwmCatalog getCatalog(String catalogName)
Looks up a catalog by name.

Parameters:
catalogName - name of catalog to find
Returns:
catalog definition, or null if not found

getTag

CwmTaggedValue getTag(CwmModelElement element,
                      String tagName)
Deprecated. use getTagAnnotation instead

Gets an element's tag.

Parameters:
element - the tagged element
tagName - name of tag to find
Returns:
tag, or null if not found

setTagValue

void setTagValue(CwmModelElement element,
                 String tagName,
                 String tagValue)
Deprecated. use setTagAnnotationValue instead

Tags an element.

Parameters:
element - the element to tag
tagName - name of tag to create; if a tag with this name already exists, it will be updated
tagValue - value to set

getTagValue

String getTagValue(CwmModelElement element,
                   String tagName)
Deprecated. use getTagAnnotationValue instead

Gets a value tagged to an element.

Parameters:
element - the tagged element
tagName - name of tag to find
Returns:
tag value, or null if not found

getTagAnnotation

FemTagAnnotation getTagAnnotation(FemAnnotatedElement element,
                                  String tagName)
Gets an element's annotation tag.

Parameters:
element - the tagged element
tagName - name of tag to find
Returns:
tag, or null if not found

setTagAnnotationValue

void setTagAnnotationValue(FemAnnotatedElement element,
                           String tagName,
                           String tagValue)
Tags an annotated element.

Parameters:
element - the element to tag
tagName - name of tag to create; if a tag with this name already exists, it will be updated
tagValue - value to set

getTagAnnotationValue

String getTagAnnotationValue(FemAnnotatedElement element,
                             String tagName)
Gets a value tagged to an annotated element.

Parameters:
element - the tagged element
tagName - name of tag to find
Returns:
tag value, or null if not found

addResourceBundles

void addResourceBundles(List<ResourceBundle> bundles)
Defines localization for this repository.

Parameters:
bundles - list of ResourceBundle instances to add for

newTxnContext

FarragoReposTxnContext newTxnContext()
Returns an instance of FarragoReposTxnContext for use in executing transactions against this repository without automatic repository session management. Equivalent to newTxnContext(false).

Returns:
an instance of FarragoReposTxnContext for use in executing transactions against this repository

newTxnContext

FarragoReposTxnContext newTxnContext(boolean manageReposSession)
Returns an instance of FarragoReposTxnContext for use in executing transactions against this repository. If the manageReposSession parameter is true, the returned FarragoReposTxnContext is responsible for managing repository sessions. Otherwise the caller is responsible for managing the repository session.

Parameters:
manageReposSession - if true, the FarragoReposTxnContext manages the repository session
Returns:
an instance of FarragoReposTxnContext for use in executing transactions against this repository

beginReposSession

void beginReposSession()
Begins a session on the metadata repository.

See Also:
newTxnContext(boolean)

beginReposTxn

void beginReposTxn(boolean writable)
Begins a metadata transaction on the repository. In most cases, this should be done by creating and manipulating an instance of FarragoReposTxnContext instead.

Parameters:
writable - true for read/write; false for read-only

endReposTxn

void endReposTxn(boolean rollback)
Ends a metadata transaction on the repository.

Parameters:
rollback - true to rollback; false to commit

endReposSession

void endReposSession()
Ends a session on the metadata repository.

See Also:
newTxnContext(boolean)

getMetadataFactory

Object getMetadataFactory(String prefix)
Returns the metadata factory for a particular plugin. In particular, getMetadataFactory("Fem") returns this.

Parameters:
prefix - The name of the prefix which identifies the metadata factory

getSequenceAccessor

FarragoSequenceAccessor getSequenceAccessor(String mofId)
Returns the an accessor for a sequence stored in the repository

Parameters:
mofId - the identifier for the sequence

expandProperties

String expandProperties(String value)
Returns the input string with property values substituted for variables of the form ${VARNAME}, such as that done by FarragoProperties.expandProperties(String)..

Parameters:
value - String we want to expand
Returns:
expanded string, if value(s) were known

allOfClass

<T extends RefObject> Collection<T> allOfClass(Class<T> clazz)
Returns a collection of all instances of a given class.

This method has the same effect as RefClass.refAllOfClass(), but is preferable because it returns a typed collection.


allOfType

<T extends RefObject> Collection<T> allOfType(Class<T> clazz)
Returns a collection of all instances of a given type.

This method has the same effect as RefClass.refAllOfType(), but is preferable because it returns a typed collection.


verifyIntegrity

List<FarragoReposIntegrityErr> verifyIntegrity(RefObject refObj)
Verifies the integrity of the repository.

Parameters:
refObj - a single object to check (independent of related objects) or null to check the entire repository
Returns:
list of violations (empty list indicates integrity check passed)

getModelLoader

FarragoModelLoader getModelLoader()
Returns the FarragoModelLoader for this repos. May return null if not supported by implementation.