|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.farrago.catalog.FarragoCatalogUtil
public abstract class FarragoCatalogUtil
Static utilities for accessing the Farrago catalog.
Nested Class Summary | |
---|---|
static class |
FarragoCatalogUtil.BackupData
Helper class used to represent backup information stored in the backup catalog. |
private static class |
FarragoCatalogUtil.RowCountStat
Helper class used to represent a specific type of row count statistic |
private static class |
FarragoCatalogUtil.RowCountStatType
Enumeration of the different type of row count statistics |
Constructor Summary | |
---|---|
FarragoCatalogUtil()
|
Method Summary | ||
---|---|---|
private static void |
addKeyCols(List<FemAbstractColumn> keyCols,
BitSet keys)
|
|
private static void |
addNewPendingRestoreRecord(FarragoRepos repos,
BackupTypeEnum type)
|
|
static void |
addPendingRestore(FarragoRepos repos)
Adds or updates records in the system backup catalog, indicating that a partial restore has been completed. |
|
static void |
addPendingSystemBackup(FarragoRepos repos,
String type,
Long csn,
String startTime)
Adds new records to the system backup catalog corresponding to a pending backup. |
|
static FemRecoveryReference |
createRecoveryReference(FarragoRepos repos,
RecoveryType recoveryType,
CwmModelElement modelElement)
Creates a new recovery reference for a recoverable action on an object. |
|
static String |
createTimestamp()
Creates a timestamp reflecting the current time |
|
static
|
filterTypedModelElements(Collection<? extends CwmModelElement> inCollection,
Collection<OutT> outCollection,
Class<AskT> type)
Filters a collection for all CwmModelElement s of a given type. |
|
static void |
generateConstraintIndexName(FarragoRepos repos,
FemAbstractUniqueConstraint constraint,
CwmSqlindex index)
Sets the generated name for an index used to implement a constraint. |
|
static void |
generateConstraintName(FarragoRepos repos,
FemAbstractUniqueConstraint constraint)
Sets the generated name for an anonymous constraint. |
|
private static String |
generateUniqueConstraintColumnList(FemAbstractUniqueConstraint constraint)
|
|
static FemAuthId |
getAuthIdByName(FarragoRepos repos,
String authName)
Finds the FemAuthId for a specified Authorization name. |
|
static FemLocalIndex |
getClusteredIndex(FarragoRepos repos,
CwmClass table)
Finds the clustered index storing a table's data. |
|
static List<FemLocalIndex> |
getClusteredIndexes(FarragoRepos repos,
CwmClass table)
Finds all clustered indexes storing a table's data. |
|
static List<FarragoCatalogUtil.BackupData> |
getCurrentBackupData(FarragoRepos repos)
Retrieves current backup data stored in the catalog. |
|
static FemLocalIndex |
getDeletionIndex(FarragoRepos repos,
CwmClass table)
Returns the index corresponding to the internal deletion index |
|
static FemColumnHistogram |
getHistogram(FemAbstractColumn column,
Timestamp labelTimestamp)
Retrieves the histogram for a column based on a label setting. |
|
static FemColumnHistogram |
getHistogramForUpdate(FarragoRepos repos,
FemAbstractColumn column,
boolean createNewHistogram)
Determines which histogram record should be updated. |
|
static CwmTable |
getIndexTable(CwmSqlindex index)
Gets the table on which an index is defined. |
|
static FemLocalTable |
getIndexTable(FemLocalIndex index)
Gets the FemLocalTable on which a FemLocalIndex is
defined. |
|
static String |
getJarUrl(FemJar femJar)
Returns the URL for a jar with all properties expanded. |
|
private static List<Timestamp> |
getLabelBounds(FemLabel referenceLabel,
FarragoRepos repos)
Retrieves the creation timestamp of the labels that bound a specified label. |
|
private static Timestamp |
getMaxTimestamp(FemAbstractColumnSet table,
FemRowCountStatistics stats)
Returns the max of the dml and analyze timestamps stored in a row count statistics record. |
|
static
|
getModelElementByName(Collection<T> collection,
String name)
Searches a collection of CwmModelElement s (or a subtype) by name. |
|
static
|
getModelElementByNameAndType(Collection<? extends CwmModelElement> collection,
String name,
Class<T> clazz)
Searches a collection for a CwmModelElement by name and type. |
|
static CwmModelElement |
getModelElementByNameAndType(Collection collection,
String name,
RefClass type)
Deprecated. use typesafe version instead |
|
static Timestamp |
getNewestLabelCreationTimestamp(FarragoRepos repos)
Retrieves the creation timestamp of the most recently created label stored in the catalog. |
|
static Long |
getOldestLabelCsn(FarragoRepos repos)
Retrieves the csn of the oldest label stored in the catalog. |
|
static Long |
getPageCount(FemLocalIndex index,
Timestamp labelTimestamp)
Retrieves the page count statistic for a local index, taking into consideration the current label setting. |
|
static FemPrimaryKeyConstraint |
getPrimaryKey(CwmClassifier table)
Finds the primary key for a table. |
|
static SqlIdentifier |
getQualifiedName(CwmModelElement element)
Constructs a fully qualified name for an object. |
|
static FemRole |
getRoleByName(FarragoRepos repos,
String roleName)
Looks up a role by name in a catalog. |
|
static FemRoutine |
getRoutineForOrdering(FemUserDefinedOrdering udo)
Gets the routine which implements a particular user-defined ordering, or null if the ordering does not invoke a routine. |
|
static int |
getRoutineParamCount(FemRoutine routine)
Calculates the number of parameters expected by a routine. |
|
static void |
getRowCounts(FemAbstractColumnSet table,
Timestamp labelTimestamp,
Long[] rowCounts)
Retrieves the current and deleted row counts for an abstract column set, optionally based on a label setting. |
|
static FemLocalSchema |
getSchemaByName(CwmCatalog catalog,
String schemaName)
Looks up a schema by name in a catalog. |
|
static Properties |
getStorageOptionsAsProperties(FarragoRepos repos,
FemElementWithStorageOptions element)
Extracts the storage options for an element into a Properties. |
|
static List<CwmStructuralFeature> |
getStructuralFeatures(CwmClassifier classifier)
Returns a collection of just the structural features of a classifier, hiding other features such as operations. |
|
static SqlAccessType |
getTableAllowedAccess(CwmNamedColumnSet table)
Determines the allowed access for a table |
|
static Collection<FemLocalIndex> |
getTableIndexes(FarragoRepos repos,
CwmClass table)
Gets the collection of indexes spanning a table. |
|
static List<FemLocalIndex> |
getUnclusteredIndexes(FarragoRepos repos,
CwmClass table)
Finds all unclustered indexes storing a table's data. |
|
static BitSet |
getUniqueKeyCols(CwmClassifier table)
Returns a bitmap with bits set for any column from a table that is part of either a primary key or a unique constraint |
|
static List<FemUniqueKeyConstraint> |
getUniqueKeyConstraints(CwmClassifier table)
Finds the unique key constraints for a table. |
|
static FemUser |
getUserByName(FarragoRepos repos,
String userName)
Looks up a user by name in a catalog. |
|
static boolean |
hasUniqueKey(CwmClassifier table)
Determines whether a table contains a unique key |
|
static
|
indexModelElementsByName(Collection<T> inCollection,
Map<String,T> outMap)
Indexes a collection of model elements by name. |
|
static void |
initializeCatalog(FarragoRepos repos,
CwmCatalog catalog)
Sets default attributes for a new catalog instance. |
|
static boolean |
isColumnNullable(FarragoRepos repos,
CwmColumn column)
Determines whether a column may contain null values. |
|
static boolean |
isDeletionIndex(FemLocalIndex index)
Determines whether an index implements an internal deletion index. |
|
static boolean |
isIndexPrimaryKey(FemLocalIndex index)
Determines whether an index implements its table's primary key. |
|
static boolean |
isIndexTemporary(CwmSqlindex index)
Determines whether an index is temporary. |
|
static boolean |
isIndexUnique(FemLocalIndex index)
Determines whether an index implements either a primary key or a unique constraint |
|
static boolean |
isRoutineConstructor(FemRoutine routine)
Determines whether a routine is a constructor method. |
|
static boolean |
isRoutineMethod(FemRoutine routine)
Determines whether a routine is a method. |
|
static boolean |
isTableFunction(FemRoutine routine)
Determines whether a UDF has a RETURNS TABLE clause. |
|
static FemGrant |
newCreationGrant(FarragoRepos repos,
FemAuthId grantorAuthId,
FemAuthId granteeAuthId,
CwmModelElement grantedObject)
Creates a new grant representing ownership of an object by its creator. |
|
static FemGrant |
newCreationGrant(FarragoRepos repos,
String grantorName,
String granteeName,
CwmModelElement grantedObject)
Creates a new grant representing ownership of an object by its creator. |
|
static FemGrant |
newElementGrant(FarragoRepos repos,
FemAuthId grantorAuthId,
FemAuthId granteeAuthId,
CwmModelElement grantedObject)
Create a new grant for an element, with AuthId's specified as repository objects. |
|
static FemGrant |
newElementGrant(FarragoRepos repos,
String grantorName,
String granteeName,
CwmModelElement grantedObject)
Creates a grant on a specified repos element, with AuthId's specified as strings. |
|
static FemGrant |
newRoleGrant(FarragoRepos repos,
String grantorName,
String granteeName,
String roleName)
Creates a new grant on a ROLE with specified role name and associate it to the grantor and grantee auth ids respectively. |
|
static void |
removeObsoleteStatistics(FemLabel label,
FarragoRepos repos,
boolean usePreviewRefDelete)
|
|
private static
|
removeObsoleteStatisticsFromTable(FarragoRepos repos,
Collection<ParentType> parentList,
Method statsGetter,
Method timestampGetter,
Timestamp lowerBound,
Timestamp upperBound,
boolean onlyLabel,
boolean usePreviewRefDelete)
Removes statistics in between 2 timestamp boundaries, provided the stat is not the only remaining statistic record within the timestamp range. |
|
static void |
resetRowCounts(FemAbstractColumnSet table)
Deprecated. |
|
static void |
resetRowCounts(FemAbstractColumnSet table,
FarragoRepos repos)
Resets the row counts for a table, creating new row count stat records, as needed. |
|
private static void |
setNewRowCounts(FemAbstractColumnSet table,
FemRowCountStatistics rowCountStats,
List<FarragoCatalogUtil.RowCountStat> rowCounts)
Sets various row counts for an abstract column set. |
|
static void |
setRoutineSpecification(FarragoRepos repos,
FemRoutine routine,
FemUserDefinedType typeDef)
Sets the specification for a routine. |
|
private static boolean |
timestampInRange(Timestamp lowerBound,
Timestamp upperBound,
Timestamp timestamp)
Determines if a specified timestamp is within 2 bounds. |
|
static FemSqltypedElement |
toFemSqltypedElement(FemAbstractTypedElement element)
Casts a FemAbstractTypedElement to the FemSqltypedElement
interface via a proxy. |
|
static String |
uniquifyGeneratedName(FarragoRepos repos,
RefObject refObj,
String name)
Generated names are normally unique by construction. |
|
static void |
updateAnnotatedElement(FemAnnotatedElement annotatedElement,
String timestamp,
boolean isNew)
Updates system-maintained attributes of an object. |
|
static void |
updateHistogram(FarragoRepos repos,
FemAbstractColumn column,
Long distinctValues,
boolean distinctValuesEstimated,
float samplePercent,
long sampleSize,
int barCount,
long rowsPerBar,
long rowsLastBar,
List<FemColumnHistogramBar> bars)
|
|
static void |
updatePageCount(FemLocalIndex index,
Long pageCount)
Deprecated. |
|
static void |
updatePageCount(FemLocalIndex index,
Long pageCount,
FarragoRepos repos)
Updates the page count statistic for a local index, creating new index stat records as needed. |
|
static boolean |
updatePendingBackupData(FarragoRepos repos,
boolean backupSucceeded,
boolean setEndTimestamp)
Updates the system backup catalog data depending on whether the last pending backup (if any) succeeded or failed. |
|
static void |
updateRowCount(FemAbstractColumnSet columnSet,
Long rowCount,
boolean updateRowCount,
boolean updateAnalyzeRowCount)
Deprecated. |
|
static void |
updateRowCount(FemAbstractColumnSet columnSet,
Long rowCount,
boolean updateRowCount,
boolean updateAnalyzeRowCount,
FarragoRepos repos)
Updates the row count statistic for an abstract column set, creating new row count stat records, as needed. |
|
static void |
updateRowCounts(FemAbstractColumnSet table,
List<FarragoCatalogUtil.RowCountStat> rowCounts,
FarragoRepos repos)
Updates various row counts for an abstract column set, creating new row count stat records as needed. |
|
static void |
updateRowCounts(FemAbstractColumnSet table,
long rowCount,
long deletedRowCount,
FarragoRepos repos)
Updates the current and deleted row counts for an abstract column set, creating new row count stat records as needed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FarragoCatalogUtil()
Method Detail |
---|
public static void initializeCatalog(FarragoRepos repos, CwmCatalog catalog)
repos
- repository in which catalog is storedcatalog
- catalog to initializepublic static int getRoutineParamCount(FemRoutine routine)
public static boolean isRoutineConstructor(FemRoutine routine)
routine
- routine in question
public static boolean isRoutineMethod(FemRoutine routine)
routine
- routine in question
public static void setRoutineSpecification(FarragoRepos repos, FemRoutine routine, FemUserDefinedType typeDef)
repos
- repository storing the routine definitionroutine
- new routinetypeDef
- owning type if a method, else nullpublic static boolean isIndexTemporary(CwmSqlindex index)
index
- the index in question
public static CwmTable getIndexTable(CwmSqlindex index)
index
- the index in question
public static FemLocalTable getIndexTable(FemLocalIndex index)
FemLocalTable
on which a FemLocalIndex
is
defined.
index
- the index in question
public static boolean isIndexPrimaryKey(FemLocalIndex index)
index
- the index in question
public static boolean isIndexUnique(FemLocalIndex index)
index
- the index in question
public static boolean isDeletionIndex(FemLocalIndex index)
index
- the index in question
public static List<FemUniqueKeyConstraint> getUniqueKeyConstraints(CwmClassifier table)
table
- the table of interest
public static FemPrimaryKeyConstraint getPrimaryKey(CwmClassifier table)
table
- the table of interest
public static BitSet getUniqueKeyCols(CwmClassifier table)
table
- the table of interest
private static void addKeyCols(List<FemAbstractColumn> keyCols, BitSet keys)
public static boolean hasUniqueKey(CwmClassifier table)
table
- the table of interest
public static FemLocalIndex getClusteredIndex(FarragoRepos repos, CwmClass table)
repos
- repository storing the table definitiontable
- the table to access
public static List<FemLocalIndex> getClusteredIndexes(FarragoRepos repos, CwmClass table)
repos
- repository storing the table definitiontable
- the table to access
public static List<FemLocalIndex> getUnclusteredIndexes(FarragoRepos repos, CwmClass table)
repos
- repository storing the table definitiontable
- the table to access
public static FemLocalIndex getDeletionIndex(FarragoRepos repos, CwmClass table)
repos
- repository storing the table definitiontable
- the table to access
public static Collection<FemLocalIndex> getTableIndexes(FarragoRepos repos, CwmClass table)
repos
- repository storing the table definitiontable
- the table of interest
public static void generateConstraintIndexName(FarragoRepos repos, FemAbstractUniqueConstraint constraint, CwmSqlindex index)
repos
- repos storing indexconstraint
- the constraint being implementedindex
- the index implementing the constraintpublic static void generateConstraintName(FarragoRepos repos, FemAbstractUniqueConstraint constraint)
repos
- repos storing constraintconstraint
- the anonymous constraintpublic static String uniquifyGeneratedName(FarragoRepos repos, RefObject refObj, String name)
repos
- repos storing objectrefObj
- object for which to construct namename
- generated name
private static String generateUniqueConstraintColumnList(FemAbstractUniqueConstraint constraint)
public static <T extends CwmModelElement> T getModelElementByName(Collection<T> collection, String name)
CwmModelElement
s (or a subtype) by name.
collection
- the collection to searchname
- name of element to find
public static <T extends CwmModelElement> T getModelElementByNameAndType(Collection<? extends CwmModelElement> collection, String name, Class<T> clazz)
collection
- the collection to searchname
- name of element to findclazz
- class which sought object must instantiate
public static CwmModelElement getModelElementByNameAndType(Collection collection, String name, RefClass type)
public static <OutT extends CwmModelElement,AskT extends OutT> void filterTypedModelElements(Collection<? extends CwmModelElement> inCollection, Collection<OutT> outCollection, Class<AskT> type)
CwmModelElement
s of a given type.
inCollection
- the collection to searchoutCollection
- receives matching objectstype
- class which sought objects must instantiateUtil.filter(List, java.lang.Class)
public static <T extends CwmModelElement> void indexModelElementsByName(Collection<T> inCollection, Map<String,T> outMap)
inCollection
- elements to be indexedoutMap
- receives indexed elements; key is name, value is elementpublic static FemLocalSchema getSchemaByName(CwmCatalog catalog, String schemaName)
catalog
- CwmCatalog to searchschemaName
- name of schema to find
public static boolean isColumnNullable(FarragoRepos repos, CwmColumn column)
REVIEW jvs 7-July-2006: The statement above is no longer true; we now store the derived nullability in isNullable, and remember the original declared nullability in isDeclaredNullable. Maybe we should deprecate this method now.
repos
- repos storing column definitioncolumn
- the column of interest
public static FemRoutine getRoutineForOrdering(FemUserDefinedOrdering udo)
udo
- user-defined ordering of interest
public static SqlIdentifier getQualifiedName(CwmModelElement element)
element
- model element
public static FemSqltypedElement toFemSqltypedElement(FemAbstractTypedElement element)
FemAbstractTypedElement
to the FemSqltypedElement
interface via a proxy.
element
- element to cast
public static List<CwmStructuralFeature> getStructuralFeatures(CwmClassifier classifier)
classifier
- to access
public static boolean isTableFunction(FemRoutine routine)
routine
- UDF
public static String getJarUrl(FemJar femJar)
femJar
- jar to access
public static FemAuthId getAuthIdByName(FarragoRepos repos, String authName)
repos
- repository storing the Authorization IdauthName
- the input name used for this lookup
public static FemUser getUserByName(FarragoRepos repos, String userName)
repos
- repos storing cataloguserName
- name of user to find
public static FemRole getRoleByName(FarragoRepos repos, String roleName)
repos
- repos storing catalogroleName
- name of role to find
public static FemGrant newRoleGrant(FarragoRepos repos, String grantorName, String granteeName, String roleName)
repos
- repository containing the objectsgrantorName
- the creator of this grantgranteeName
- the receipient of this grantroleName
- the role name of the authorization id to be granted by
this new grant
public static FemGrant newElementGrant(FarragoRepos repos, String grantorName, String granteeName, CwmModelElement grantedObject)
repos
- repository storing the objectsgrantorName
- the creator of this grantgranteeName
- the recipient of this grantgrantedObject
- element being granted
public static FemGrant newElementGrant(FarragoRepos repos, FemAuthId grantorAuthId, FemAuthId granteeAuthId, CwmModelElement grantedObject)
repos
- repository storing the objectsgrantorAuthId
- the creator of this grantgranteeAuthId
- the receipient of this grantgrantedObject
- element being granted
public static FemGrant newCreationGrant(FarragoRepos repos, String grantorName, String granteeName, CwmModelElement grantedObject)
repos
- repository storing the objectsgrantorName
- the name of the creator of the grantgranteeName
- the name of the grantee of the grantgrantedObject
- element being created
public static FemGrant newCreationGrant(FarragoRepos repos, FemAuthId grantorAuthId, FemAuthId granteeAuthId, CwmModelElement grantedObject)
repos
- repository storing the objectsgrantorAuthId
- a FemAuthId representing the creator of the grantgranteeAuthId
- a FemAuthId representing the grantee of the grantgrantedObject
- element being created
public static SqlAccessType getTableAllowedAccess(CwmNamedColumnSet table)
table
- Repository table
public static void getRowCounts(FemAbstractColumnSet table, Timestamp labelTimestamp, Long[] rowCounts)
table
- the abstract column setlabelTimestamp
- creation timestamp of the label setting that
determines which row counts to retrieve; null if there is no label
settingrowCounts
- the row counts to be returned; the first element in the
array is the current row count and the second is the deleted row countprivate static Timestamp getMaxTimestamp(FemAbstractColumnSet table, FemRowCountStatistics stats)
table
- the abstract column set corresponding to the row count stats
recordstats
- the row count stats record
public static void updateRowCounts(FemAbstractColumnSet table, long rowCount, long deletedRowCount, FarragoRepos repos)
table
- the abstract column setrowCount
- the current row countdeletedRowCount
- the deleted row countrepos
- repositorypublic static void updateRowCounts(FemAbstractColumnSet table, List<FarragoCatalogUtil.RowCountStat> rowCounts, FarragoRepos repos)
table
- the abstract column setrowCounts
- list of row counts to be updatedrepos
- repositorypublic static void updateRowCount(FemAbstractColumnSet columnSet, Long rowCount, boolean updateRowCount, boolean updateAnalyzeRowCount)
columnSet
- the column set whose row count will be updatedrowCount
- number of rows returned by column setupdateRowCount
- if true, the FemAbstractColumnSet.setRowCount(Long)
property is updated.updateAnalyzeRowCount
- if true, the FemAbstractColumnSet.setLastAnalyzeRowCount(Long)
property is updatedpublic static void updateRowCount(FemAbstractColumnSet columnSet, Long rowCount, boolean updateRowCount, boolean updateAnalyzeRowCount, FarragoRepos repos)
columnSet
- the column set whose row count will be updatedrowCount
- number of rows returned by column setupdateRowCount
- if true, the current row count is updatedupdateAnalyzeRowCount
- if true, the analyze row count is updatedpublic static Long getPageCount(FemLocalIndex index, Timestamp labelTimestamp)
index
- the index whose page count will be retrievedlabelTimestamp
- creation timestamp of the label setting that
determines which page count to retrieve; null if there is no label
setting
public static void updatePageCount(FemLocalIndex index, Long pageCount)
index
- the index whose page count will be updatedpageCount
- number of pages on disk used by indexpublic static void updatePageCount(FemLocalIndex index, Long pageCount, FarragoRepos repos)
index
- the index whose page count will be updatedpageCount
- number of pages on disk used by indexrepos
- repositorypublic static FemColumnHistogram getHistogram(FemAbstractColumn column, Timestamp labelTimestamp)
column
- the columnlabelTimestamp
- the creation timestamp of the label setting; null
if there is no label setting
public static void updateHistogram(FarragoRepos repos, FemAbstractColumn column, Long distinctValues, boolean distinctValuesEstimated, float samplePercent, long sampleSize, int barCount, long rowsPerBar, long rowsLastBar, List<FemColumnHistogramBar> bars)
public static FemColumnHistogram getHistogramForUpdate(FarragoRepos repos, FemAbstractColumn column, boolean createNewHistogram)
repos
- repositorycolumn
- the column for which the histogram will be createdcreateNewHistogram
- if true and the latest record cannot be
updated, then create a new histogram record
public static void updateAnnotatedElement(FemAnnotatedElement annotatedElement, String timestamp, boolean isNew)
annotatedElement
- object to updatetimestamp
- timestamp to use for creation/modificationisNew
- whether object is being createdpublic static String createTimestamp()
public static FemRecoveryReference createRecoveryReference(FarragoRepos repos, RecoveryType recoveryType, CwmModelElement modelElement)
repos
- repository in which object is definedrecoveryType
- description of recoverable actionmodelElement
- object on which recovery would be neededpublic static void resetRowCounts(FemAbstractColumnSet table)
table
- a column set tablepublic static void resetRowCounts(FemAbstractColumnSet table, FarragoRepos repos)
table
- a column set tablerepos
- repositoryprivate static void setNewRowCounts(FemAbstractColumnSet table, FemRowCountStatistics rowCountStats, List<FarragoCatalogUtil.RowCountStat> rowCounts)
table
- the abstract column setrowCountStats
- the row count statisticsrowCounts
- the row counts to be setpublic static Timestamp getNewestLabelCreationTimestamp(FarragoRepos repos)
repos
- repository
public static Long getOldestLabelCsn(FarragoRepos repos)
repos
- repository
private static List<Timestamp> getLabelBounds(FemLabel referenceLabel, FarragoRepos repos)
referenceLabel
- the label that will be used to determine the
boundariesrepos
- repository
public static void removeObsoleteStatistics(FemLabel label, FarragoRepos repos, boolean usePreviewRefDelete)
private static <ParentType extends CwmModelElement> void removeObsoleteStatisticsFromTable(FarragoRepos repos, Collection<ParentType> parentList, Method statsGetter, Method timestampGetter, Timestamp lowerBound, Timestamp upperBound, boolean onlyLabel, boolean usePreviewRefDelete) throws Exception
ParentType
- the type of the object that references the stat
recordsrepos
- repositoryparentList
- list of parent objectsstatsGetter
- method that retrieves the list of stat records from
each parent objecttimestampGetter
- method that retrieves the timestamp from each
stats record; null if this is a RowCountStatistics object; row count
stats are handled as a special caselowerBound
- the lower bound timestamp boundaryupperBound
- the upper bound timestamp boundaryonlyLabel
- true if this is the special case where the label being
dropped is the only remaining one; in this case, the lowerBound should be
nullusePreviewRefDelete
- whether to use the repository's preview
refDelete feature or just delete the objects
Exception
private static boolean timestampInRange(Timestamp lowerBound, Timestamp upperBound, Timestamp timestamp)
lowerBound
- the lower bound; if null, then there is no lower boundupperBound
- the upper bound; if null, then there is no upper boundtimestamp
- the timestamp; if null, the timestamp represents a very
old timestamp and therefore only qualifies if there is no explicit lower
bound
public static List<FarragoCatalogUtil.BackupData> getCurrentBackupData(FarragoRepos repos)
repos
- repository
public static void addPendingSystemBackup(FarragoRepos repos, String type, Long csn, String startTime)
repos
- repositorytype
- type of backupcsn
- commit sequence number corresponding to the backupstartTime
- start time of the backuppublic static boolean updatePendingBackupData(FarragoRepos repos, boolean backupSucceeded, boolean setEndTimestamp)
repos
- repositorybackupSucceeded
- true if the last backup succeededsetEndTimestamp
- if true, record the current timestamp as the
ending timestamp when updating pending data to completed
public static void addPendingRestore(FarragoRepos repos)
repos
- repositoryprivate static void addNewPendingRestoreRecord(FarragoRepos repos, BackupTypeEnum type)
public static Properties getStorageOptionsAsProperties(FarragoRepos repos, FemElementWithStorageOptions element)
${varname}
get expanded on read.
repos
- repository referenceelement
- FemElement we want the options from
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |