|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object macaw.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 MacawCurationAPI
MacawException
public void deleteRawVariables(User user, java.util.ArrayList<RawVariable> rawVariables) throws MacawException
deleteRawVariables
in interface MacawCurationAPI
MacawException
public void updateRawVariable(User user, RawVariable rawVariable) throws MacawException
updateRawVariable
in interface MacawCurationAPI
MacawException
public void addDerivedVariable(User user, DerivedVariable derivedVariable) throws MacawException
addDerivedVariable
in interface MacawCurationAPI
MacawException
public void deleteDerivedVariables(User user, java.util.ArrayList<DerivedVariable> derivedVariables) throws MacawException
deleteDerivedVariables
in interface MacawCurationAPI
MacawException
public void updateDerivedVariable(User user, DerivedVariable derivedVariable) throws MacawException
updateDerivedVariable
in interface MacawCurationAPI
MacawException
public int getRawVariableIdentifier(User user, RawVariable rawVariable) throws MacawException
getRawVariableIdentifier
in interface MacawCurationAPI
MacawException
public int getDerivedVariableIdentifier(User user, DerivedVariable derivedVariable) throws MacawException
getDerivedVariableIdentifier
in interface MacawCurationAPI
MacawException
public Variable getVariable(User user, java.lang.String variableName) throws MacawException
getVariable
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<Variable> getSourceVariables(User user, DerivedVariable derivedVariable) throws MacawException
getSourceVariables
in interface MacawCurationAPI
MacawException
public void associateSourceVariables(User user, DerivedVariable derivedVariable, java.util.ArrayList<Variable> sourceVariablesToAdd) throws MacawException
associateSourceVariables
in interface MacawCurationAPI
MacawException
public void disassociateSourceVariables(User user, DerivedVariable derivedVariable, java.util.ArrayList<Variable> sourceVariablesToDelete) throws MacawException
MacawCurationAPI
RawVariable
or DerivedVariable
variables that
were used to create a given derivedVariable
disassociateSourceVariables
in interface MacawCurationAPI
derivedVariable
- 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 MacawCurationAPI
MacawException
public void addValueLabels(User user, Variable variable, java.util.ArrayList<ValueLabel> valueLabels) throws MacawException
addValueLabels
in interface MacawCurationAPI
MacawException
public void updateValueLabels(User user, Variable variable, java.util.ArrayList<ValueLabel> valueLabels) throws MacawException
updateValueLabels
in interface MacawCurationAPI
MacawException
public void deleteValueLabels(User user, Variable variable, java.util.ArrayList<ValueLabel> valueLabels) throws MacawException
deleteValueLabels
in interface MacawCurationAPI
MacawException
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 MacawCurationAPI
MacawException
public java.util.ArrayList<VariableSummary> getSummaryDataForAllVariables(User user) throws MacawException
MacawCurationAPI
RawVariable
s and DerivedVariable
. Note
that only summary data are included:
getSummaryDataForAllVariables
in interface MacawCurationAPI
MacawException
public Variable getCompleteVariableData(User user, VariableSummary variableSummary) throws MacawException
getCompleteVariableData
in interface MacawCurationAPI
MacawException
public Variable getOriginalVariable(User user, Variable variable) throws MacawException
getOriginalVariable
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<SupportingDocument> getAllSupportingDocuments(User user) throws MacawException
getAllSupportingDocuments
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<SupportingDocument> getSupportingDocuments(User user, Variable variable) throws MacawException
getSupportingDocuments
in interface MacawCurationAPI
MacawException
public void addSupportingDocument(User user, SupportingDocument supportingDocument) throws MacawException
addSupportingDocument
in interface MacawCurationAPI
MacawException
public void updateSupportingDocument(User user, SupportingDocument revisedSupportingDocument) throws MacawException
updateSupportingDocument
in interface MacawCurationAPI
MacawException
public void deleteSupportingDocuments(User user, java.util.ArrayList<SupportingDocument> supportingDocuments) throws MacawException
deleteSupportingDocuments
in interface MacawCurationAPI
MacawException
public int getSupportingDocumentIdentifier(User user, SupportingDocument supportingDocument) throws MacawException
getSupportingDocumentIdentifier
in interface MacawCurationAPI
MacawException
public void associateSupportingDocumentsWithVariable(User user, Variable variable, java.util.ArrayList<SupportingDocument> supportingDocuments) throws MacawException
associateSupportingDocumentsWithVariable
in interface MacawCurationAPI
MacawException
public void disassociateSupportingDocumentsFromVariable(User user, Variable variable, java.util.ArrayList<SupportingDocument> supportingDocuments) throws MacawException
disassociateSupportingDocumentsFromVariable
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<Category> getCategories(User user) throws MacawException
getCategories
in interface MacawCurationAPI
MacawException
public void addCategory(User user, Category dataLibrary) throws MacawException
addCategory
in interface MacawCurationAPI
MacawException
public void updateCategory(User user, Category dataLibrary) throws MacawException
updateCategory
in interface MacawCurationAPI
MacawException
public void deleteCategories(User user, java.util.ArrayList<Category> categories) throws MacawException
deleteCategories
in interface MacawCurationAPI
MacawException
public int getCategoryIdentifier(User user, Variable variable, Category category) throws MacawException
getCategoryIdentifier
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<CleaningState> getCleaningStates(User user) throws MacawException
getCleaningStates
in interface MacawCurationAPI
MacawException
public void addCleaningState(User user, CleaningState cleaningState) throws MacawException
addCleaningState
in interface MacawCurationAPI
MacawException
public void updateCleaningState(User user, CleaningState cleaningState) throws MacawException
updateCleaningState
in interface MacawCurationAPI
MacawException
public void deleteCleaningStates(User user, java.util.ArrayList<CleaningState> cleaningStates) throws MacawException
deleteCleaningStates
in interface MacawCurationAPI
MacawException
public int getCleaningStateIdentifier(User user, Variable variable, CleaningState cleaningState) throws MacawException
getCleaningStateIdentifier
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<AvailabilityState> getAvailabilityStates(User user) throws MacawException
getAvailabilityStates
in interface MacawCurationAPI
MacawException
public void addAvailabilityState(User user, AvailabilityState availabilityState) throws MacawException
addAvailabilityState
in interface MacawCurationAPI
MacawException
public void updateAvailabilityState(User user, AvailabilityState availabilityState) throws MacawException
updateAvailabilityState
in interface MacawCurationAPI
MacawException
public void deleteAvailabilityStates(User user, java.util.ArrayList<AvailabilityState> availabilityStatesToDelete) throws MacawException
deleteAvailabilityStates
in interface MacawCurationAPI
MacawException
public int getAvailabilityStateIdentifier(User user, Variable variable, AvailabilityState availabilityState) throws MacawException
getAvailabilityStateIdentifier
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<AliasFilePath> getAliasFilePaths(User user) throws MacawException
getAliasFilePaths
in interface MacawCurationAPI
MacawException
public void addAliasFilePath(User user, AliasFilePath aliasFilePath) throws MacawException
addAliasFilePath
in interface MacawCurationAPI
MacawException
public void updateAliasFilePath(User user, AliasFilePath aliasFilePath) throws MacawException
updateAliasFilePath
in interface MacawCurationAPI
MacawException
public void deleteAliasFilePaths(User user, java.util.ArrayList<AliasFilePath> aliasFilePaths) throws MacawException
deleteAliasFilePaths
in interface MacawCurationAPI
MacawException
public int getAliasFilePathIdentifier(User user, Variable variable, AliasFilePath aliasFilePath) throws MacawException
getAliasFilePathIdentifier
in interface MacawCurationAPI
MacawException
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 MacawCurationAPI
MacawException
public java.lang.String getFilePathFromAlias(User user, java.lang.String currentAlias) throws MacawException
getFilePathFromAlias
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<SupportingDocument> filterSupportingDocuments(User user, java.lang.String documentTitleFilter, java.lang.String documentCodeFilter) throws MacawException
filterSupportingDocuments
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<OntologyTerm> filterOntologyTerms(User user, java.lang.String termFilter, java.lang.String descriptionFilter) throws MacawException
filterOntologyTerms
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<OntologyTerm> getAllOntologyTerms(User user) throws MacawException
getAllOntologyTerms
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<OntologyTerm> getOntologyTerms(User user, Variable variable) throws MacawException
getOntologyTerms
in interface MacawCurationAPI
MacawException
public void addOntologyTerm(User user, OntologyTerm ontologyTerm) throws MacawException
addOntologyTerm
in interface MacawCurationAPI
MacawException
public void updateOntologyTerm(User user, OntologyTerm ontologyTerm) throws MacawException
updateOntologyTerm
in interface MacawCurationAPI
MacawException
public void deleteOntologyTerms(User user, java.util.ArrayList<OntologyTerm> ontologyTerms) throws MacawException
deleteOntologyTerms
in interface MacawCurationAPI
MacawException
public int getOntologyTermIdentifier(User user, OntologyTerm ontologyTerm) throws MacawException
getOntologyTermIdentifier
in interface MacawCurationAPI
MacawException
public void associateOntologyTermsWithVariable(User user, Variable variable, java.util.ArrayList<OntologyTerm> ontologyTerms) throws MacawException
associateOntologyTermsWithVariable
in interface MacawCurationAPI
MacawException
public void disassociateOntologyTermsFromVariable(User user, Variable variable, java.util.ArrayList<OntologyTerm> ontologyTerms) throws MacawException
disassociateOntologyTermsFromVariable
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForVariable(User user, Variable variable) throws MacawException
getChangeHistoryForVariable
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForSupportingDocument(User user, SupportingDocument supportingDocument) throws MacawException
getChangeHistoryForSupportingDocument
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForValueLabels(User user, Variable variable) throws MacawException
getChangeHistoryForValueLabels
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForListChoices(User user) throws MacawException
getChangeHistoryForListChoices
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<MacawChangeEvent> getChangeHistoryByUser(User user) throws MacawException
getChangeHistoryByUser
in interface MacawCurationAPI
MacawException
public void addChangeEvents(MacawChangeEvent changeEvent) throws MacawException
MacawException
public java.util.ArrayList<User> getUsers(User admin) throws MacawException
getUsers
in interface MacawCurationAPI
MacawException
public void addUser(User admin, User user) throws MacawException
addUser
in interface MacawCurationAPI
MacawException
public void updateUser(User admin, User user) throws MacawException
updateUser
in interface MacawCurationAPI
MacawException
public void deleteUsers(User admin, java.util.ArrayList<User> usersToDelete) throws MacawException
deleteUsers
in interface MacawCurationAPI
MacawException
public int getUserIdentifier(User admin, User user) throws MacawException
getUserIdentifier
in interface MacawCurationAPI
MacawException
public void checkValidUser(User user) throws MacawException
checkValidUser
in interface MacawCurationAPI
MacawException
public void checkValidAdministrator(User administrator) throws MacawException
checkValidAdministrator
in interface MacawCurationAPI
MacawException
public void clear(User admin) throws MacawException
clear
in interface MacawCurationAPI
MacawException
public void clearAllChanges(User admin) throws MacawException
clearAllChanges
in interface MacawCurationAPI
MacawException
public java.util.ArrayList<MacawChangeEvent> getAllChanges(User admin) throws MacawException
getAllChanges
in interface MacawCurationAPI
MacawException
public Variable getAlternativeVariable(User user, Variable targetVariable) throws MacawException
getAlternativeVariable
in interface MacawCurationAPI
MacawException
public void setAlternativeVariable(User user, Variable targetVariable, Variable alternativeVariable) throws MacawException
setAlternativeVariable
in interface MacawCurationAPI
MacawException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |