cst.loggingTool.persistenceLayer
Class DemonstrationLoggingService

java.lang.Object
  extended by cst.common.persistenceLayer.AbstractDemonstrationService
      extended by cst.loggingTool.persistenceLayer.DemonstrationLoggingService
All Implemented Interfaces:
CSTServiceAPI, LoggingServiceAPI

public class DemonstrationLoggingService
extends AbstractDemonstrationService
implements LoggingServiceAPI


 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)

Field Summary
protected  java.text.SimpleDateFormat sqlDateFormat
           
 
Fields inherited from class cst.common.persistenceLayer.AbstractDemonstrationService
adminUser, demonstrationDB, guest, recognisedUsers, sessionProperties
 
Constructor Summary
DemonstrationLoggingService(DemonstrationDB demonstrationDB)
           
 
Method Summary
 java.util.ArrayList<java.lang.String> applyCoreFieldAndCompletionFilter(User user, SubjectAttributeFilterCommand coreFieldFilter, CompletionFilterCommand completionFilter)
           
 java.util.ArrayList<java.lang.String> applyCoreFieldAndDataTypeFilter(User user, SubjectAttributeFilterCommand coreFieldFilter, DateFilterCommand dataTypeFilter)
           
 java.util.ArrayList<java.lang.String> applyOnlyCompletionFilter(User user, CompletionFilterCommand completionFilter)
           
 java.util.ArrayList<java.lang.String> applyOnlyDataTypeFilter(User user, DateFilterCommand dataTypeFilter)
           
 java.util.ArrayList<java.lang.String> applyOnlySubjectAttributeFilter(User user, SubjectAttributeFilterCommand coreFieldFilter)
           
 java.util.ArrayList<java.lang.String> applyShowAllFilter(User user)
           
 java.util.ArrayList<TrialActivityModel> getAllTrialActivityModels(User adminUser, java.lang.String trialActivityDataStorageName)
           
 java.util.ArrayList<TrialActivityChange> getTrialActivityChangesForSubject(User user, java.lang.String trialSubjectIdentifier)
           
 java.util.ArrayList<TrialActivityChange> getTrialActivityChangesForUser(User user, User changeAuthor)
           
 TrialActivityModel getTrialActivityModel(User user, java.lang.String trialSubjectIdentifier, java.lang.String trialActivityDataStorageName)
           
 SubjectInformationReportAPI getTrialSubjectInformation(User user, java.lang.String trialSubjectIdentifier)
           
 TrialSubjectModel getTrialSubjectModel(User user, java.lang.String identifier)
           
 java.lang.String[] getValuesForSubjectAttribute(User user, java.lang.String coreFieldDataStorageName)
           
 int importTrialActivityData(User user, java.lang.String trialActivityDataStorageName, java.util.ArrayList<TrialActivityModel> trialActivityModels, java.lang.String dataSourceName)
          assumes a collection of trial activity models are all for the same activity.
protected  void recordChanges(java.util.ArrayList<TrialActivityChange> changes)
           
 boolean trialSubjectModelExists(User user, java.lang.String targetTrialSubjectModelIdentifier)
           
 void updateChangeHistory(User user, TrialActivityChange trialActivityChange)
           
 void updateTrialActivity(User user, TrialActivityModel revisedTrialActivityModel)
           
 void validateUser(User user)
           
 
Methods inherited from class cst.common.persistenceLayer.AbstractDemonstrationService
checkRepositoryIsSynchronised, initialise, isValidUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cst.common.businessLayer.LoggingServiceAPI
initialise
 
Methods inherited from interface cst.common.businessLayer.CSTServiceAPI
checkRepositoryIsSynchronised
 

Field Detail

sqlDateFormat

protected java.text.SimpleDateFormat sqlDateFormat
Constructor Detail

DemonstrationLoggingService

public DemonstrationLoggingService(DemonstrationDB demonstrationDB)
Method Detail

applyShowAllFilter

public java.util.ArrayList<java.lang.String> applyShowAllFilter(User user)
                                                         throws CSTException
Specified by:
applyShowAllFilter in interface LoggingServiceAPI
Throws:
CSTException

applyOnlyCompletionFilter

public java.util.ArrayList<java.lang.String> applyOnlyCompletionFilter(User user,
                                                                       CompletionFilterCommand completionFilter)
                                                                throws CSTException
Specified by:
applyOnlyCompletionFilter in interface LoggingServiceAPI
Throws:
CSTException

applyOnlySubjectAttributeFilter

public java.util.ArrayList<java.lang.String> applyOnlySubjectAttributeFilter(User user,
                                                                             SubjectAttributeFilterCommand coreFieldFilter)
                                                                      throws CSTException
Specified by:
applyOnlySubjectAttributeFilter in interface LoggingServiceAPI
Throws:
CSTException

applyOnlyDataTypeFilter

public java.util.ArrayList<java.lang.String> applyOnlyDataTypeFilter(User user,
                                                                     DateFilterCommand dataTypeFilter)
                                                              throws CSTException
Specified by:
applyOnlyDataTypeFilter in interface LoggingServiceAPI
Throws:
CSTException

applyCoreFieldAndDataTypeFilter

public java.util.ArrayList<java.lang.String> applyCoreFieldAndDataTypeFilter(User user,
                                                                             SubjectAttributeFilterCommand coreFieldFilter,
                                                                             DateFilterCommand dataTypeFilter)
                                                                      throws CSTException
Specified by:
applyCoreFieldAndDataTypeFilter in interface LoggingServiceAPI
Throws:
CSTException

applyCoreFieldAndCompletionFilter

public java.util.ArrayList<java.lang.String> applyCoreFieldAndCompletionFilter(User user,
                                                                               SubjectAttributeFilterCommand coreFieldFilter,
                                                                               CompletionFilterCommand completionFilter)
                                                                        throws CSTException
Specified by:
applyCoreFieldAndCompletionFilter in interface LoggingServiceAPI
Throws:
CSTException

getValuesForSubjectAttribute

public java.lang.String[] getValuesForSubjectAttribute(User user,
                                                       java.lang.String coreFieldDataStorageName)
                                                throws CSTException
Specified by:
getValuesForSubjectAttribute in interface LoggingServiceAPI
Throws:
CSTException

updateTrialActivity

public void updateTrialActivity(User user,
                                TrialActivityModel revisedTrialActivityModel)
                         throws CSTException
Specified by:
updateTrialActivity in interface LoggingServiceAPI
Throws:
CSTException

importTrialActivityData

public int importTrialActivityData(User user,
                                   java.lang.String trialActivityDataStorageName,
                                   java.util.ArrayList<TrialActivityModel> trialActivityModels,
                                   java.lang.String dataSourceName)
                            throws CSTException
assumes a collection of trial activity models are all for the same activity.

Specified by:
importTrialActivityData in interface LoggingServiceAPI
Throws:
CSTException

getAllTrialActivityModels

public java.util.ArrayList<TrialActivityModel> getAllTrialActivityModels(User adminUser,
                                                                         java.lang.String trialActivityDataStorageName)
                                                                  throws CSTException
Specified by:
getAllTrialActivityModels in interface LoggingServiceAPI
Throws:
CSTException

getTrialSubjectInformation

public SubjectInformationReportAPI getTrialSubjectInformation(User user,
                                                              java.lang.String trialSubjectIdentifier)
                                                       throws CSTException
Specified by:
getTrialSubjectInformation in interface LoggingServiceAPI
Throws:
CSTException

getTrialActivityModel

public TrialActivityModel getTrialActivityModel(User user,
                                                java.lang.String trialSubjectIdentifier,
                                                java.lang.String trialActivityDataStorageName)
                                         throws CSTException
Specified by:
getTrialActivityModel in interface LoggingServiceAPI
Throws:
CSTException

trialSubjectModelExists

public boolean trialSubjectModelExists(User user,
                                       java.lang.String targetTrialSubjectModelIdentifier)
                                throws CSTException
Specified by:
trialSubjectModelExists in interface LoggingServiceAPI
Throws:
CSTException

updateChangeHistory

public void updateChangeHistory(User user,
                                TrialActivityChange trialActivityChange)
                         throws CSTException
Specified by:
updateChangeHistory in interface LoggingServiceAPI
Throws:
CSTException

getTrialActivityChangesForSubject

public java.util.ArrayList<TrialActivityChange> getTrialActivityChangesForSubject(User user,
                                                                                  java.lang.String trialSubjectIdentifier)
                                                                           throws CSTException
Specified by:
getTrialActivityChangesForSubject in interface LoggingServiceAPI
Throws:
CSTException

getTrialActivityChangesForUser

public java.util.ArrayList<TrialActivityChange> getTrialActivityChangesForUser(User user,
                                                                               User changeAuthor)
                                                                        throws CSTException
Specified by:
getTrialActivityChangesForUser in interface LoggingServiceAPI
Throws:
CSTException

validateUser

public void validateUser(User user)
                  throws CSTException
Specified by:
validateUser in interface LoggingServiceAPI
Specified by:
validateUser in class AbstractDemonstrationService
Throws:
CSTException

getTrialSubjectModel

public TrialSubjectModel getTrialSubjectModel(User user,
                                              java.lang.String identifier)
                                       throws CSTException
Specified by:
getTrialSubjectModel in interface CSTServiceAPI
Throws:
CSTException

recordChanges

protected void recordChanges(java.util.ArrayList<TrialActivityChange> changes)