macaw.persistenceLayer.production
Class ProductionRetrievalService

java.lang.Object
  extended by macaw.persistenceLayer.production.ProductionRetrievalService
All Implemented Interfaces:
MacawRetrievalAPI

public class ProductionRetrievalService
extends java.lang.Object
implements MacawRetrievalAPI

Implements the MacawRetrievalAPI interface as a service which retrieves all of its data from a database. DemonstrationRetrievalService delegates the implementations of MacawRetrievalAPI methods to manager classes whose names are prefixed with "SQL" (eg: SQLVariableManager). The main duties of this class are

  1. validate users before the methods are allowed to proceed
  2. log any exceptions that are thrown.

For security reasons, exceptions are caught rather than thrown to the calling class.


Copyright 2010 Medical Research Council Unit for Lifelong Health and Ageing Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)

Constructor Summary
ProductionRetrievalService(SessionProperties sessionProperties)
           
 
Method Summary
 AliasFilePath getAliasFilePath(User user, java.lang.String cardNumber)
          given the name of a logical location for data, returns an AliasFilePath object that can also describe the physical location.
 java.util.ArrayList<AliasFilePath> getAliasFilePaths(User user)
          Methods for data libraries
 java.util.ArrayList<AliasFilePath> getAliasFilePathsMatchingName(User user, java.lang.String regularExpression)
          Searches for all alias file paths whose logical location names contain a phrase.
 java.util.ArrayList<AvailabilityState> getAvailabilityStates(User user)
           
 java.util.ArrayList<Category> getCategories(User user)
           
 java.util.ArrayList<Category> getCategoriesForVariable(User user, java.lang.String variableName)
           
 java.util.ArrayList<CleaningState> getCleaningStates(User user)
          Methods for managing cleaning states
 java.util.ArrayList<OntologyTerm> getOntologyTerms(User user, java.lang.String variableName)
          return the ontology terms for a given variable
 java.util.ArrayList<OntologyTerm> getOntologyTerms(User user, Variable variable)
           
 java.util.ArrayList<SupportingDocument> getSupportingDocuments(User user, java.lang.String variableName)
          returns the supporting documents for a given variable
 java.util.ArrayList<User> getUnverifiedUsers(User user)
           
 User getUserFromEmail(User user, java.lang.String email)
           
 User getUserFromID(User user, java.lang.String userID)
           
 java.util.ArrayList<User> getUsers(User admin)
           
 java.util.ArrayList<ValueLabel> getValueLabels(User user, java.lang.String variableName)
          returns the value labels associated with a given variable
 Variable getVariable(User user, java.lang.String variableName)
          returns a variable record given a variable name
 java.lang.String[] getVariableNames(User user)
          returns an alphabetically sorted list of all the variable names in the data repository
 java.util.ArrayList<VariableSummary> getVariableSummariesForCategory(User user, java.lang.String categoryName)
          returns summary records of variables that are associated with a given category.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProductionRetrievalService

public ProductionRetrievalService(SessionProperties sessionProperties)
                           throws MacawException
Throws:
MacawException
Method Detail

getUserFromID

public User getUserFromID(User user,
                          java.lang.String userID)
Specified by:
getUserFromID in interface MacawRetrievalAPI

getUnverifiedUsers

public java.util.ArrayList<User> getUnverifiedUsers(User user)
Specified by:
getUnverifiedUsers in interface MacawRetrievalAPI

getUsers

public java.util.ArrayList<User> getUsers(User admin)
Specified by:
getUsers in interface MacawRetrievalAPI

getUserFromEmail

public User getUserFromEmail(User user,
                             java.lang.String email)
Specified by:
getUserFromEmail in interface MacawRetrievalAPI

getCategories

public java.util.ArrayList<Category> getCategories(User user)
Specified by:
getCategories in interface MacawRetrievalAPI

getAvailabilityStates

public java.util.ArrayList<AvailabilityState> getAvailabilityStates(User user)
Specified by:
getAvailabilityStates in interface MacawRetrievalAPI

getCleaningStates

public java.util.ArrayList<CleaningState> getCleaningStates(User user)
Methods for managing cleaning states

Specified by:
getCleaningStates in interface MacawRetrievalAPI

getValueLabels

public java.util.ArrayList<ValueLabel> getValueLabels(User user,
                                                      java.lang.String variableName)
Description copied from interface: MacawRetrievalAPI
returns the value labels associated with a given variable

Specified by:
getValueLabels in interface MacawRetrievalAPI
Parameters:
user - registered user who is using the retrieval service
variableName - the name of a variable

getOntologyTerms

public java.util.ArrayList<OntologyTerm> getOntologyTerms(User user,
                                                          java.lang.String variableName)
Description copied from interface: MacawRetrievalAPI
return the ontology terms for a given variable

Specified by:
getOntologyTerms in interface MacawRetrievalAPI

getOntologyTerms

public java.util.ArrayList<OntologyTerm> getOntologyTerms(User user,
                                                          Variable variable)

getSupportingDocuments

public java.util.ArrayList<SupportingDocument> getSupportingDocuments(User user,
                                                                      java.lang.String variableName)
Description copied from interface: MacawRetrievalAPI
returns the supporting documents for a given variable

Specified by:
getSupportingDocuments in interface MacawRetrievalAPI

getAliasFilePaths

public java.util.ArrayList<AliasFilePath> getAliasFilePaths(User user)
Methods for data libraries

Specified by:
getAliasFilePaths in interface MacawRetrievalAPI
Parameters:
user - - registered user who is using the retrieval service

getAliasFilePath

public AliasFilePath getAliasFilePath(User user,
                                      java.lang.String cardNumber)
Description copied from interface: MacawRetrievalAPI
given the name of a logical location for data, returns an AliasFilePath object that can also describe the physical location.

Specified by:
getAliasFilePath in interface MacawRetrievalAPI
Parameters:
user - - registered user who is using the retrieval service

getAliasFilePathsMatchingName

public java.util.ArrayList<AliasFilePath> getAliasFilePathsMatchingName(User user,
                                                                        java.lang.String regularExpression)
Description copied from interface: MacawRetrievalAPI
Searches for all alias file paths whose logical location names contain a phrase. Note that this search filter does not support regular expression symbols.

Specified by:
getAliasFilePathsMatchingName in interface MacawRetrievalAPI
Parameters:
user - - registered user who is using the retrieval service
regularExpression - - a search phrase that represents part of the name for a logical location in an alias file path.

getCategoriesForVariable

public java.util.ArrayList<Category> getCategoriesForVariable(User user,
                                                              java.lang.String variableName)
Specified by:
getCategoriesForVariable in interface MacawRetrievalAPI

getVariableSummariesForCategory

public java.util.ArrayList<VariableSummary> getVariableSummariesForCategory(User user,
                                                                            java.lang.String categoryName)
Description copied from interface: MacawRetrievalAPI
returns summary records of variables that are associated with a given category.

Specified by:
getVariableSummariesForCategory in interface MacawRetrievalAPI

getVariableNames

public java.lang.String[] getVariableNames(User user)
Description copied from interface: MacawRetrievalAPI
returns an alphabetically sorted list of all the variable names in the data repository

Specified by:
getVariableNames in interface MacawRetrievalAPI

getVariable

public Variable getVariable(User user,
                            java.lang.String variableName)
Description copied from interface: MacawRetrievalAPI
returns a variable record given a variable name

Specified by:
getVariable in interface MacawRetrievalAPI