cst.common.businessLayer
Interface AdminServiceAPI

All Superinterfaces:
CSTServiceAPI
All Known Implementing Classes:
DemonstrationAdminService, ProductionAdminService

public interface AdminServiceAPI
extends CSTServiceAPI

The service API that is used by the Admin Tool GUI. The API should also be used by developers who seek to exercise the business operations of the administration tool without wanting to use the forms that come with it.


 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)

Method Summary
 void addUser(User adminUser, User user)
          add a user to the list of registered users of the system.
 void clearChanges(User adminUser)
          removes all records that describe changes made to activity data.
 void clearDatabase(User adminUser)
          produces an empty database.
 void clearUsers(User adminUser)
          removes all users from the list of registered users.
 void createDatabase(User adminUser)
          creates a database according to settings specified in the configuration file the end users choose when they start the Administration Tool.
 boolean databaseExists(User adminUser)
          determines whether the database described in the configuration file at startup exists or not.
 void deleteDatabase(User adminUser)
          deletes the database described in the configuration file end users choose when they start the Administration Tool.
 void deleteUser(User adminUser, User user)
          deletes a user from the registry of known users.
 java.util.ArrayList<User> getRegisteredUsers(User adminUser)
          returns a collection of registered users for the system.
 java.util.ArrayList<TrialSubjectModel> getSubjectAttributeData(User adminUser)
          Provides all the subject attribute data that is needed to uniquely identify and filter subjects.
 void importTrialSubjectModels(User adminUser, java.util.ArrayList<TrialSubjectModel> trialSubjectModels)
          imports a collection of trial subject model records into the data repository.
 void synchroniseRepository(User adminUser)
          ensures that every activity and activity step defined in the configuration file specied at startup has a corresponding entry in the data repository.
 void updateUser(User adminUser, User user)
          update the details of an existing user
 boolean userExists(User adminUser, java.lang.String userID)
          determines whether a given userID exists in the collection of registered users
 boolean validateAdministrator(User adminUser)
          determine whether a given user is the administrator or not
 
Methods inherited from interface cst.common.businessLayer.CSTServiceAPI
checkRepositoryIsSynchronised, getTrialSubjectModel, initialise
 

Method Detail

validateAdministrator

boolean validateAdministrator(User adminUser)
                              throws CSTException
determine whether a given user is the administrator or not

Parameters:
adminUser -
Returns:
Throws:
CSTException

getSubjectAttributeData

java.util.ArrayList<TrialSubjectModel> getSubjectAttributeData(User adminUser)
                                                               throws CSTException
Provides all the subject attribute data that is needed to uniquely identify and filter subjects. Subject attribute data are stored in the system to support filtering operations found in the LoggingTool. For example, values for "Location", "Gender", "Strain", "Age Group" are subject attributes which are used to filter subjects but which are not actively maintained and edited by data curators.

Parameters:
adminUser -
Returns:
Throws:
CSTException

importTrialSubjectModels

void importTrialSubjectModels(User adminUser,
                              java.util.ArrayList<TrialSubjectModel> trialSubjectModels)
                              throws CSTException
imports a collection of trial subject model records into the data repository. When a record is imported, an entry is made for both the subject attribute data and blank entries for each activity associated with it. Subject records each have a unique identifier. Imported subject records may overwrite existing records.

Parameters:
adminUser -
trialSubjectModels -
Throws:
CSTException

getRegisteredUsers

java.util.ArrayList<User> getRegisteredUsers(User adminUser)
                                             throws CSTException
returns a collection of registered users for the system.

Parameters:
adminUser -
Returns:
Throws:
CSTException

userExists

boolean userExists(User adminUser,
                   java.lang.String userID)
                   throws CSTException
determines whether a given userID exists in the collection of registered users

Parameters:
adminUser -
userID -
Returns:
Throws:
CSTException

clearUsers

void clearUsers(User adminUser)
                throws CSTException
removes all users from the list of registered users.

Parameters:
adminUser -
Throws:
CSTException

addUser

void addUser(User adminUser,
             User user)
             throws CSTException
add a user to the list of registered users of the system.

Parameters:
adminUser -
user -
Throws:
CSTException

updateUser

void updateUser(User adminUser,
                User user)
                throws CSTException
update the details of an existing user

Parameters:
adminUser -
user -
Throws:
CSTException

deleteUser

void deleteUser(User adminUser,
                User user)
                throws CSTException
deletes a user from the registry of known users.

Parameters:
adminUser -
user -
Throws:
CSTException

clearChanges

void clearChanges(User adminUser)
                  throws CSTException
removes all records that describe changes made to activity data.

Parameters:
adminUser -
Throws:
CSTException

clearDatabase

void clearDatabase(User adminUser)
                   throws CSTException
produces an empty database. This method exists mainly to service testing efforts

Parameters:
adminUser -
Throws:
CSTException

databaseExists

boolean databaseExists(User adminUser)
                       throws CSTException
determines whether the database described in the configuration file at startup exists or not.

Parameters:
adminUser -
Returns:
Throws:
CSTException

createDatabase

void createDatabase(User adminUser)
                    throws CSTException
creates a database according to settings specified in the configuration file the end users choose when they start the Administration Tool.

Parameters:
adminUser -
Throws:
CSTException

deleteDatabase

void deleteDatabase(User adminUser)
                    throws CSTException
deletes the database described in the configuration file end users choose when they start the Administration Tool.

Parameters:
adminUser -
Throws:
CSTException

synchroniseRepository

void synchroniseRepository(User adminUser)
                           throws CSTException
ensures that every activity and activity step defined in the configuration file specied at startup has a corresponding entry in the data repository. Although this method is supported by both Demonstration and Production versions of the service, its main use is to ensure that elements in the configuration file match elements in the MySQL database.

Parameters:
adminUser -
Throws:
CSTException