|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmacaw.persistenceLayer.demo.DemonstrationCurationService
public class DemonstrationCurationService
Implements the MacawCurationAPI interface as a service which manages
all of its data in-memory instead of in a database. This class allows Macaw to run in
a demonstration mode off a pen drive without requiring the client machine to have MySQL
installed. DemonstrationCurationService is useful in testing as well. All of the classes
in the macaw.test sub-packages can be applied to either in-memory or SQL
versions of Macaw services. The difference in implementations make it easy to rapidly
isolate the causes of failed test cases. In general, the in-memory implementation is
treated as the gold test standard.
DemonstrationCurationService delegates implementations of the API methods to manager
classes for major concepts. All of these manager classes have names that are prefixed
with "InMemory", eg: InMemoryVariableManager.
The manager classes support persistence using the following policy
A more detailed description of how this works is given
in InMemorySupportingDocumentsManager.
| Field Summary | |
|---|---|
protected User |
admin
|
protected InMemoryChangeEventManager |
changeEventManager
|
protected InMemoryListChoiceManager |
listChoiceManager
|
protected Log |
log
|
protected InMemoryOntologyTermFilter |
ontologyTermFilter
|
protected InMemoryOntologyTermManager |
ontologyTermManager
|
protected MacawSecurityAPI |
securityValidationService
|
protected InMemorySupportingDocumentFilter |
supportingDocumentFilter
|
protected InMemorySupportingDocumentsManager |
supportingDocumentsManager
|
protected InMemoryUserManager |
userManager
|
protected InMemoryValueLabelManager |
valueLabelManager
|
protected InMemoryVariableFilter |
variableFilter
|
protected InMemoryVariableManager |
variableManager
|
| Constructor Summary | |
|---|---|
DemonstrationCurationService()
|
|
DemonstrationCurationService(boolean automatedTestingMode)
|
|
| Method Summary | |
|---|---|
void |
addAliasFilePath(User user,
AliasFilePath aliasFilePath)
|
void |
addAvailabilityState(User user,
AvailabilityState availabilityState)
|
void |
addCategory(User user,
Category dataLibrary)
methods for managing categories |
void |
addChangeEvents(MacawChangeEvent changeEvent)
|
void |
addCleaningState(User user,
CleaningState cleaningState)
|
void |
addDerivedVariable(User user,
DerivedVariable derivedVariable)
|
void |
addOntologyTerm(User user,
OntologyTerm ontologyTerm)
|
void |
addRawVariable(User user,
RawVariable rawVariable)
|
void |
addSupportingDocument(User user,
SupportingDocument supportingDocument)
|
void |
addUser(User admin,
User user)
|
void |
addValueLabels(User user,
Variable variable,
java.util.ArrayList<ValueLabel> valueLabels)
|
void |
associateOntologyTermsWithVariable(User user,
Variable variable,
java.util.ArrayList<OntologyTerm> ontologyTerms)
|
void |
associateSourceVariables(User user,
DerivedVariable derivedVariable,
java.util.ArrayList<Variable> sourceVariablesToAdd)
|
void |
associateSupportingDocumentsWithVariable(User user,
Variable variable,
java.util.ArrayList<SupportingDocument> supportingDocuments)
|
void |
checkValidAdministrator(User administrator)
|
void |
checkValidUser(User user)
|
void |
clear(User admin)
|
void |
clearAllChanges(User admin)
|
void |
deleteAliasFilePaths(User user,
java.util.ArrayList<AliasFilePath> aliasFilePaths)
|
void |
deleteAvailabilityStates(User user,
java.util.ArrayList<AvailabilityState> availabilityStatesToDelete)
|
void |
deleteCategories(User user,
java.util.ArrayList<Category> categories)
|
void |
deleteCleaningStates(User user,
java.util.ArrayList<CleaningState> cleaningStates)
|
void |
deleteDerivedVariables(User user,
java.util.ArrayList<DerivedVariable> derivedVariables)
|
void |
deleteOntologyTerms(User user,
java.util.ArrayList<OntologyTerm> ontologyTerms)
|
void |
deleteRawVariables(User user,
java.util.ArrayList<RawVariable> rawVariables)
|
void |
deleteSupportingDocuments(User user,
java.util.ArrayList<SupportingDocument> supportingDocuments)
|
void |
deleteUsers(User admin,
java.util.ArrayList<User> usersToDelete)
|
void |
deleteValueLabels(User user,
Variable variable,
java.util.ArrayList<ValueLabel> valueLabels)
|
void |
disassociateOntologyTermsFromVariable(User user,
Variable variable,
java.util.ArrayList<OntologyTerm> ontologyTerms)
|
void |
disassociateSourceVariables(User user,
DerivedVariable derivedVariable,
java.util.ArrayList<Variable> sourceVariablesToDelete)
removes references to either RawVariable or DerivedVariable variables that
were used to create a given derivedVariable |
void |
disassociateSupportingDocumentsFromVariable(User user,
Variable variable,
java.util.ArrayList<SupportingDocument> supportingDocuments)
|
java.util.ArrayList<OntologyTerm> |
filterOntologyTerms(User user,
java.lang.String termFilter,
java.lang.String descriptionFilter)
|
java.util.ArrayList<SupportingDocument> |
filterSupportingDocuments(User user,
java.lang.String documentTitleFilter,
java.lang.String documentCodeFilter)
|
java.util.ArrayList<VariableSummary> |
filterVariableSummaries(User user,
java.lang.String searchText,
java.lang.String year,
java.lang.String category,
VariableTypeFilter variableTypeFilter)
|
int |
getAliasFilePathIdentifier(User user,
Variable variable,
AliasFilePath aliasFilePath)
|
java.util.ArrayList<AliasFilePath> |
getAliasFilePaths(User user)
Methods for data libraries |
java.util.ArrayList<MacawChangeEvent> |
getAllChanges(User admin)
|
java.util.ArrayList<OntologyTerm> |
getAllOntologyTerms(User user)
|
java.util.ArrayList<SupportingDocument> |
getAllSupportingDocuments(User user)
|
Variable |
getAlternativeVariable(User user,
Variable targetVariable)
|
int |
getAvailabilityStateIdentifier(User user,
Variable variable,
AvailabilityState availabilityState)
|
java.util.ArrayList<AvailabilityState> |
getAvailabilityStates(User user)
Methods for managing availability states |
java.util.ArrayList<Category> |
getCategories(User user)
|
int |
getCategoryIdentifier(User user,
Variable variable,
Category category)
|
java.util.ArrayList<MacawChangeEvent> |
getChangeHistoryByUser(User user)
|
java.util.ArrayList<MacawChangeEvent> |
getChangeHistoryForListChoices(User user)
|
java.util.ArrayList<MacawChangeEvent> |
getChangeHistoryForSupportingDocument(User user,
SupportingDocument supportingDocument)
|
java.util.ArrayList<MacawChangeEvent> |
getChangeHistoryForValueLabels(User user,
Variable variable)
|
java.util.ArrayList<MacawChangeEvent> |
getChangeHistoryForVariable(User user,
Variable variable)
|
int |
getCleaningStateIdentifier(User user,
Variable variable,
CleaningState cleaningState)
|
java.util.ArrayList<CleaningState> |
getCleaningStates(User user)
Methods for managing cleaning states |
Variable |
getCompleteVariableData(User user,
VariableSummary variableSummary)
|
int |
getDerivedVariableIdentifier(User user,
DerivedVariable derivedVariable)
|
java.lang.String |
getFilePathFromAlias(User user,
java.lang.String currentAlias)
|
int |
getOntologyTermIdentifier(User user,
OntologyTerm ontologyTerm)
|
java.util.ArrayList<OntologyTerm> |
getOntologyTerms(User user,
Variable variable)
|
Variable |
getOriginalVariable(User user,
Variable variable)
|
int |
getRawVariableIdentifier(User user,
RawVariable rawVariable)
|
java.util.ArrayList<Variable> |
getSourceVariables(User user,
DerivedVariable derivedVariable)
|
java.lang.String[] |
getStudyYears(User user)
retrieves a collection of unique years associated with at least one variable in the data repository. |
java.util.ArrayList<VariableSummary> |
getSummaryDataForAllVariables(User user)
retrieves a collection of all variables managed by the system. |
int |
getSupportingDocumentIdentifier(User user,
SupportingDocument supportingDocument)
|
java.util.ArrayList<SupportingDocument> |
getSupportingDocuments(User user,
Variable variable)
|
int |
getUserIdentifier(User admin,
User user)
|
java.util.ArrayList<User> |
getUsers(User admin)
|
int |
getValueLabelIdentifier(User user,
Variable variable,
ValueLabel valueLabel)
|
java.util.ArrayList<ValueLabel> |
getValueLabels(User user,
Variable variable)
|
Variable |
getVariable(User user,
java.lang.String variableName)
|
void |
setAlternativeVariable(User user,
Variable targetVariable,
Variable alternativeVariable)
|
void |
updateAliasFilePath(User user,
AliasFilePath aliasFilePath)
|
void |
updateAvailabilityState(User user,
AvailabilityState availabilityState)
|
void |
updateCategory(User user,
Category dataLibrary)
|
void |
updateCleaningState(User user,
CleaningState cleaningState)
|
void |
updateDerivedVariable(User user,
DerivedVariable derivedVariable)
|
void |
updateOntologyTerm(User user,
OntologyTerm ontologyTerm)
|
void |
updateRawVariable(User user,
RawVariable rawVariable)
|
void |
updateSupportingDocument(User user,
SupportingDocument revisedSupportingDocument)
|
void |
updateUser(User admin,
User user)
|
void |
updateValueLabels(User user,
Variable variable,
java.util.ArrayList<ValueLabel> valueLabels)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected InMemoryListChoiceManager listChoiceManager
protected InMemorySupportingDocumentsManager supportingDocumentsManager
protected InMemoryChangeEventManager changeEventManager
protected InMemoryVariableManager variableManager
protected InMemoryValueLabelManager valueLabelManager
protected InMemoryOntologyTermManager ontologyTermManager
protected InMemoryUserManager userManager
protected InMemoryVariableFilter variableFilter
protected InMemorySupportingDocumentFilter supportingDocumentFilter
protected InMemoryOntologyTermFilter ontologyTermFilter
protected MacawSecurityAPI securityValidationService
protected User admin
protected Log log
| Constructor Detail |
|---|
public DemonstrationCurationService()
public DemonstrationCurationService(boolean automatedTestingMode)
| Method Detail |
|---|
public void addRawVariable(User user,
RawVariable rawVariable)
throws MacawException
addRawVariable in interface MacawCurationAPIMacawException
public void deleteRawVariables(User user,
java.util.ArrayList<RawVariable> rawVariables)
throws MacawException
deleteRawVariables in interface MacawCurationAPIMacawException
public void updateRawVariable(User user,
RawVariable rawVariable)
throws MacawException
updateRawVariable in interface MacawCurationAPIMacawException
public void addDerivedVariable(User user,
DerivedVariable derivedVariable)
throws MacawException
addDerivedVariable in interface MacawCurationAPIMacawException
public void deleteDerivedVariables(User user,
java.util.ArrayList<DerivedVariable> derivedVariables)
throws MacawException
deleteDerivedVariables in interface MacawCurationAPIMacawException
public void updateDerivedVariable(User user,
DerivedVariable derivedVariable)
throws MacawException
updateDerivedVariable in interface MacawCurationAPIMacawException
public int getRawVariableIdentifier(User user,
RawVariable rawVariable)
throws MacawException
getRawVariableIdentifier in interface MacawCurationAPIMacawException
public int getDerivedVariableIdentifier(User user,
DerivedVariable derivedVariable)
throws MacawException
getDerivedVariableIdentifier in interface MacawCurationAPIMacawException
public Variable getVariable(User user,
java.lang.String variableName)
throws MacawException
getVariable in interface MacawCurationAPIMacawException
public java.util.ArrayList<Variable> getSourceVariables(User user,
DerivedVariable derivedVariable)
throws MacawException
getSourceVariables in interface MacawCurationAPIMacawException
public void associateSourceVariables(User user,
DerivedVariable derivedVariable,
java.util.ArrayList<Variable> sourceVariablesToAdd)
throws MacawException
associateSourceVariables in interface MacawCurationAPIMacawException
public void disassociateSourceVariables(User user,
DerivedVariable derivedVariable,
java.util.ArrayList<Variable> sourceVariablesToDelete)
throws MacawException
MacawCurationAPIRawVariable or DerivedVariable variables that
were used to create a given derivedVariable
disassociateSourceVariables in interface MacawCurationAPIderivedVariable - contains source variables to deletesourceVariablesToDelete - the raw or derived variables that should no longer be associated with derivedVariable.
MacawException
public java.util.ArrayList<ValueLabel> getValueLabels(User user,
Variable variable)
throws MacawException
getValueLabels in interface MacawCurationAPIMacawException
public void addValueLabels(User user,
Variable variable,
java.util.ArrayList<ValueLabel> valueLabels)
throws MacawException
addValueLabels in interface MacawCurationAPIMacawException
public void updateValueLabels(User user,
Variable variable,
java.util.ArrayList<ValueLabel> valueLabels)
throws MacawException
updateValueLabels in interface MacawCurationAPIMacawException
public void deleteValueLabels(User user,
Variable variable,
java.util.ArrayList<ValueLabel> valueLabels)
throws MacawException
deleteValueLabels in interface MacawCurationAPIMacawException
public int getValueLabelIdentifier(User user,
Variable variable,
ValueLabel valueLabel)
getValueLabelIdentifier in interface MacawCurationAPI
public java.lang.String[] getStudyYears(User user)
throws MacawException
MacawCurationAPI
getStudyYears in interface MacawCurationAPIMacawException
public java.util.ArrayList<VariableSummary> getSummaryDataForAllVariables(User user)
throws MacawException
MacawCurationAPIRawVariables and DerivedVariable. Note
that only summary data are included:
getSummaryDataForAllVariables in interface MacawCurationAPIMacawException
public Variable getCompleteVariableData(User user,
VariableSummary variableSummary)
throws MacawException
getCompleteVariableData in interface MacawCurationAPIMacawException
public Variable getOriginalVariable(User user,
Variable variable)
throws MacawException
getOriginalVariable in interface MacawCurationAPIMacawException
public java.util.ArrayList<SupportingDocument> getAllSupportingDocuments(User user)
throws MacawException
getAllSupportingDocuments in interface MacawCurationAPIMacawException
public java.util.ArrayList<SupportingDocument> getSupportingDocuments(User user,
Variable variable)
throws MacawException
getSupportingDocuments in interface MacawCurationAPIMacawException
public void addSupportingDocument(User user,
SupportingDocument supportingDocument)
throws MacawException
addSupportingDocument in interface MacawCurationAPIMacawException
public void updateSupportingDocument(User user,
SupportingDocument revisedSupportingDocument)
throws MacawException
updateSupportingDocument in interface MacawCurationAPIMacawException
public void deleteSupportingDocuments(User user,
java.util.ArrayList<SupportingDocument> supportingDocuments)
throws MacawException
deleteSupportingDocuments in interface MacawCurationAPIMacawException
public int getSupportingDocumentIdentifier(User user,
SupportingDocument supportingDocument)
throws MacawException
getSupportingDocumentIdentifier in interface MacawCurationAPIMacawException
public void associateSupportingDocumentsWithVariable(User user,
Variable variable,
java.util.ArrayList<SupportingDocument> supportingDocuments)
throws MacawException
associateSupportingDocumentsWithVariable in interface MacawCurationAPIMacawException
public void disassociateSupportingDocumentsFromVariable(User user,
Variable variable,
java.util.ArrayList<SupportingDocument> supportingDocuments)
throws MacawException
disassociateSupportingDocumentsFromVariable in interface MacawCurationAPIMacawException
public java.util.ArrayList<Category> getCategories(User user)
throws MacawException
getCategories in interface MacawCurationAPIMacawException
public void addCategory(User user,
Category dataLibrary)
throws MacawException
addCategory in interface MacawCurationAPIMacawException
public void updateCategory(User user,
Category dataLibrary)
throws MacawException
updateCategory in interface MacawCurationAPIMacawException
public void deleteCategories(User user,
java.util.ArrayList<Category> categories)
throws MacawException
deleteCategories in interface MacawCurationAPIMacawException
public int getCategoryIdentifier(User user,
Variable variable,
Category category)
throws MacawException
getCategoryIdentifier in interface MacawCurationAPIMacawException
public java.util.ArrayList<CleaningState> getCleaningStates(User user)
throws MacawException
getCleaningStates in interface MacawCurationAPIMacawException
public void addCleaningState(User user,
CleaningState cleaningState)
throws MacawException
addCleaningState in interface MacawCurationAPIMacawException
public void updateCleaningState(User user,
CleaningState cleaningState)
throws MacawException
updateCleaningState in interface MacawCurationAPIMacawException
public void deleteCleaningStates(User user,
java.util.ArrayList<CleaningState> cleaningStates)
throws MacawException
deleteCleaningStates in interface MacawCurationAPIMacawException
public int getCleaningStateIdentifier(User user,
Variable variable,
CleaningState cleaningState)
throws MacawException
getCleaningStateIdentifier in interface MacawCurationAPIMacawException
public java.util.ArrayList<AvailabilityState> getAvailabilityStates(User user)
throws MacawException
getAvailabilityStates in interface MacawCurationAPIMacawException
public void addAvailabilityState(User user,
AvailabilityState availabilityState)
throws MacawException
addAvailabilityState in interface MacawCurationAPIMacawException
public void updateAvailabilityState(User user,
AvailabilityState availabilityState)
throws MacawException
updateAvailabilityState in interface MacawCurationAPIMacawException
public void deleteAvailabilityStates(User user,
java.util.ArrayList<AvailabilityState> availabilityStatesToDelete)
throws MacawException
deleteAvailabilityStates in interface MacawCurationAPIMacawException
public int getAvailabilityStateIdentifier(User user,
Variable variable,
AvailabilityState availabilityState)
throws MacawException
getAvailabilityStateIdentifier in interface MacawCurationAPIMacawException
public java.util.ArrayList<AliasFilePath> getAliasFilePaths(User user)
throws MacawException
getAliasFilePaths in interface MacawCurationAPIMacawException
public void addAliasFilePath(User user,
AliasFilePath aliasFilePath)
throws MacawException
addAliasFilePath in interface MacawCurationAPIMacawException
public void updateAliasFilePath(User user,
AliasFilePath aliasFilePath)
throws MacawException
updateAliasFilePath in interface MacawCurationAPIMacawException
public void deleteAliasFilePaths(User user,
java.util.ArrayList<AliasFilePath> aliasFilePaths)
throws MacawException
deleteAliasFilePaths in interface MacawCurationAPIMacawException
public int getAliasFilePathIdentifier(User user,
Variable variable,
AliasFilePath aliasFilePath)
throws MacawException
getAliasFilePathIdentifier in interface MacawCurationAPIMacawException
public java.util.ArrayList<VariableSummary> filterVariableSummaries(User user,
java.lang.String searchText,
java.lang.String year,
java.lang.String category,
VariableTypeFilter variableTypeFilter)
throws MacawException
filterVariableSummaries in interface MacawCurationAPIMacawException
public java.lang.String getFilePathFromAlias(User user,
java.lang.String currentAlias)
throws MacawException
getFilePathFromAlias in interface MacawCurationAPIMacawException
public java.util.ArrayList<SupportingDocument> filterSupportingDocuments(User user,
java.lang.String documentTitleFilter,
java.lang.String documentCodeFilter)
throws MacawException
filterSupportingDocuments in interface MacawCurationAPIMacawException
public java.util.ArrayList<OntologyTerm> filterOntologyTerms(User user,
java.lang.String termFilter,
java.lang.String descriptionFilter)
throws MacawException
filterOntologyTerms in interface MacawCurationAPIMacawException
public java.util.ArrayList<OntologyTerm> getAllOntologyTerms(User user)
throws MacawException
getAllOntologyTerms in interface MacawCurationAPIMacawException
public java.util.ArrayList<OntologyTerm> getOntologyTerms(User user,
Variable variable)
throws MacawException
getOntologyTerms in interface MacawCurationAPIMacawException
public void addOntologyTerm(User user,
OntologyTerm ontologyTerm)
throws MacawException
addOntologyTerm in interface MacawCurationAPIMacawException
public void updateOntologyTerm(User user,
OntologyTerm ontologyTerm)
throws MacawException
updateOntologyTerm in interface MacawCurationAPIMacawException
public void deleteOntologyTerms(User user,
java.util.ArrayList<OntologyTerm> ontologyTerms)
throws MacawException
deleteOntologyTerms in interface MacawCurationAPIMacawException
public int getOntologyTermIdentifier(User user,
OntologyTerm ontologyTerm)
throws MacawException
getOntologyTermIdentifier in interface MacawCurationAPIMacawException
public void associateOntologyTermsWithVariable(User user,
Variable variable,
java.util.ArrayList<OntologyTerm> ontologyTerms)
throws MacawException
associateOntologyTermsWithVariable in interface MacawCurationAPIMacawException
public void disassociateOntologyTermsFromVariable(User user,
Variable variable,
java.util.ArrayList<OntologyTerm> ontologyTerms)
throws MacawException
disassociateOntologyTermsFromVariable in interface MacawCurationAPIMacawException
public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForVariable(User user,
Variable variable)
throws MacawException
getChangeHistoryForVariable in interface MacawCurationAPIMacawException
public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForSupportingDocument(User user,
SupportingDocument supportingDocument)
throws MacawException
getChangeHistoryForSupportingDocument in interface MacawCurationAPIMacawException
public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForValueLabels(User user,
Variable variable)
throws MacawException
getChangeHistoryForValueLabels in interface MacawCurationAPIMacawException
public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForListChoices(User user)
throws MacawException
getChangeHistoryForListChoices in interface MacawCurationAPIMacawException
public java.util.ArrayList<MacawChangeEvent> getChangeHistoryByUser(User user)
throws MacawException
getChangeHistoryByUser in interface MacawCurationAPIMacawException
public void addChangeEvents(MacawChangeEvent changeEvent)
throws MacawException
MacawException
public java.util.ArrayList<User> getUsers(User admin)
throws MacawException
getUsers in interface MacawCurationAPIMacawException
public void addUser(User admin,
User user)
throws MacawException
addUser in interface MacawCurationAPIMacawException
public void updateUser(User admin,
User user)
throws MacawException
updateUser in interface MacawCurationAPIMacawException
public void deleteUsers(User admin,
java.util.ArrayList<User> usersToDelete)
throws MacawException
deleteUsers in interface MacawCurationAPIMacawException
public int getUserIdentifier(User admin,
User user)
throws MacawException
getUserIdentifier in interface MacawCurationAPIMacawException
public void checkValidUser(User user)
throws MacawException
checkValidUser in interface MacawCurationAPIMacawException
public void checkValidAdministrator(User administrator)
throws MacawException
checkValidAdministrator in interface MacawCurationAPIMacawException
public void clear(User admin)
throws MacawException
clear in interface MacawCurationAPIMacawException
public void clearAllChanges(User admin)
throws MacawException
clearAllChanges in interface MacawCurationAPIMacawException
public java.util.ArrayList<MacawChangeEvent> getAllChanges(User admin)
throws MacawException
getAllChanges in interface MacawCurationAPIMacawException
public Variable getAlternativeVariable(User user,
Variable targetVariable)
throws MacawException
getAlternativeVariable in interface MacawCurationAPIMacawException
public void setAlternativeVariable(User user,
Variable targetVariable,
Variable alternativeVariable)
throws MacawException
setAlternativeVariable in interface MacawCurationAPIMacawException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||