|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cst.common.persistenceLayer.AbstractDemonstrationService cst.adminTool.persistenceLayer.DemonstrationAdminService
public class DemonstrationAdminService
Provides an in-memory version of the administration service that is used
principally for demonstration and testing purposes. CST is designed so that
the Administration Tool GUI is unaware of how a repository is implemented.
When users run the demonstration version of their service specification,
the DemonstrationToolSuite
spawns copies of
both DemonstrationAdminService
and DemonstrationLoggingService
.
Both services rely on an instance of the virtual database DemonstrationDB
The In-memory database is intended to provide a simple version of the repository which can serve two purposes:
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.
Field Summary |
---|
Fields inherited from class cst.common.persistenceLayer.AbstractDemonstrationService |
---|
adminUser, demonstrationDB, guest, recognisedUsers, sessionProperties |
Constructor Summary | |
---|---|
DemonstrationAdminService(DemonstrationDB demonstrationDB)
|
Method Summary | |
---|---|
void |
addUser(User adminUser,
User user)
add a user to the list of registered users of the system. |
void |
changeAdministratorPassword(User candidateAdminUser,
java.lang.String candidatePassword)
TODO - this method should probably be changed. |
void |
checkRepositoryIsSynchronised(User adminUser)
|
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. |
User |
getAdministratorID()
|
java.util.ArrayList<User> |
getRegisteredUsers(User admin)
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. |
TrialSubjectModel |
getTrialSubjectModel(User user,
java.lang.String identifier)
|
void |
importTrialSubjectModels(User adminUser,
java.util.ArrayList<TrialSubjectModel> trialSubjectModelsToImport)
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 candidateAdminUser)
determine whether a given user is the administrator or not |
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.CSTServiceAPI |
---|
checkRepositoryIsSynchronised, initialise |
Constructor Detail |
---|
public DemonstrationAdminService(DemonstrationDB demonstrationDB)
Method Detail |
---|
public void createDatabase(User adminUser) throws CSTException
AdminServiceAPI
createDatabase
in interface AdminServiceAPI
CSTException
public void clearDatabase(User adminUser) throws CSTException
AdminServiceAPI
clearDatabase
in interface AdminServiceAPI
CSTException
public void clearChanges(User adminUser) throws CSTException
AdminServiceAPI
clearChanges
in interface AdminServiceAPI
CSTException
public void clearUsers(User adminUser) throws CSTException
AdminServiceAPI
clearUsers
in interface AdminServiceAPI
CSTException
public void deleteDatabase(User adminUser) throws CSTException
AdminServiceAPI
deleteDatabase
in interface AdminServiceAPI
CSTException
public java.util.ArrayList<TrialSubjectModel> getSubjectAttributeData(User adminUser) throws CSTException
AdminServiceAPI
getSubjectAttributeData
in interface AdminServiceAPI
CSTException
public boolean databaseExists(User adminUser) throws CSTException
AdminServiceAPI
databaseExists
in interface AdminServiceAPI
CSTException
public void addUser(User adminUser, User user) throws CSTException
AdminServiceAPI
addUser
in interface AdminServiceAPI
CSTException
public void updateUser(User adminUser, User user) throws CSTException
AdminServiceAPI
updateUser
in interface AdminServiceAPI
CSTException
public void deleteUser(User adminUser, User user) throws CSTException
AdminServiceAPI
deleteUser
in interface AdminServiceAPI
CSTException
public boolean userExists(User adminUser, java.lang.String userID) throws CSTException
AdminServiceAPI
userExists
in interface AdminServiceAPI
CSTException
public java.util.ArrayList<User> getRegisteredUsers(User admin) throws CSTException
AdminServiceAPI
getRegisteredUsers
in interface AdminServiceAPI
CSTException
public User getAdministratorID()
public void changeAdministratorPassword(User candidateAdminUser, java.lang.String candidatePassword) throws CSTException
CSTException
public void importTrialSubjectModels(User adminUser, java.util.ArrayList<TrialSubjectModel> trialSubjectModelsToImport) throws CSTException
AdminServiceAPI
importTrialSubjectModels
in interface AdminServiceAPI
CSTException
public TrialSubjectModel getTrialSubjectModel(User user, java.lang.String identifier) throws CSTException
getTrialSubjectModel
in interface CSTServiceAPI
CSTException
public void checkRepositoryIsSynchronised(User adminUser) throws CSTException
CSTException
public void synchroniseRepository(User adminUser) throws CSTException
AdminServiceAPI
synchroniseRepository
in interface AdminServiceAPI
CSTException
public void validateUser(User user) throws CSTException
validateUser
in class AbstractDemonstrationService
CSTException
public boolean validateAdministrator(User candidateAdminUser) throws CSTException
AdminServiceAPI
validateAdministrator
in interface AdminServiceAPI
CSTException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |