macaw.persistenceLayer.production
Class SQLUserManager

java.lang.Object
  extended by macaw.persistenceLayer.production.SQLCurationConceptManager
      extended by macaw.persistenceLayer.production.SQLUserManager
All Implemented Interfaces:
MacawSecurityAPI

public class SQLUserManager
extends SQLCurationConceptManager
implements MacawSecurityAPI


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
 
Fields inherited from class macaw.persistenceLayer.production.SQLCurationConceptManager
log
 
Constructor Summary
SQLUserManager(SQLChangeEventManager changeEventManager, SQLConnectionManager sqlConnectionManager)
           
 
Method Summary
 void addUser(java.sql.Connection connection, User admin, User user)
           
 void clear(java.sql.Connection connection)
           
 void createTable(java.sql.Connection connection)
           
 void deleteUsers(java.sql.Connection connection, User admin, java.util.ArrayList<User> usersToDelete)
           
 java.sql.Connection getConnection()
           
 User getOriginalUser(java.sql.Connection connection, User targetUser)
           
 java.util.ArrayList<User> getUnverifiedUsers(java.sql.Connection connection, User admin)
           
 User getUserFromEmail(java.sql.Connection connection, User user, java.lang.String email)
           
 User getUserFromID(java.sql.Connection connection, User user, java.lang.String userID)
           
 int getUserIdentifier(java.sql.Connection connection, User admin, User user)
           
 java.util.ArrayList<User> getUsers(User admin)
           
 void releaseConnection(java.sql.Connection connection)
           
 void updateUser(java.sql.Connection connection, User admin, User revisedUser)
           
 void validateAdministrator(User admin)
           
 void validateUser(User user)
           
 
Methods inherited from class macaw.persistenceLayer.production.SQLCurationConceptManager
registerChangeEvent, registerChangeEvents, setLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLUserManager

public SQLUserManager(SQLChangeEventManager changeEventManager,
                      SQLConnectionManager sqlConnectionManager)
Method Detail

createTable

public void createTable(java.sql.Connection connection)
                 throws MacawException
Throws:
MacawException

validateAdministrator

public void validateAdministrator(User admin)
                           throws MacawException
Specified by:
validateAdministrator in interface MacawSecurityAPI
Throws:
MacawException

validateUser

public void validateUser(User user)
                  throws MacawException
Specified by:
validateUser in interface MacawSecurityAPI
Throws:
MacawException

getUsers

public java.util.ArrayList<User> getUsers(User admin)
                                   throws MacawException
Throws:
MacawException

getUserFromEmail

public User getUserFromEmail(java.sql.Connection connection,
                             User user,
                             java.lang.String email)
                      throws MacawException
Throws:
MacawException

getUserFromID

public User getUserFromID(java.sql.Connection connection,
                          User user,
                          java.lang.String userID)
                   throws MacawException
Throws:
MacawException

getUnverifiedUsers

public java.util.ArrayList<User> getUnverifiedUsers(java.sql.Connection connection,
                                                    User admin)
                                             throws MacawException
Throws:
MacawException

addUser

public void addUser(java.sql.Connection connection,
                    User admin,
                    User user)
             throws MacawException
Throws:
MacawException

updateUser

public void updateUser(java.sql.Connection connection,
                       User admin,
                       User revisedUser)
                throws MacawException
Throws:
MacawException

deleteUsers

public void deleteUsers(java.sql.Connection connection,
                        User admin,
                        java.util.ArrayList<User> usersToDelete)
                 throws MacawException
Throws:
MacawException

getUserIdentifier

public int getUserIdentifier(java.sql.Connection connection,
                             User admin,
                             User user)
                      throws MacawException
Throws:
MacawException

clear

public void clear(java.sql.Connection connection)
           throws MacawException
Throws:
MacawException

getOriginalUser

public User getOriginalUser(java.sql.Connection connection,
                            User targetUser)
                     throws MacawException
Throws:
MacawException

getConnection

public java.sql.Connection getConnection()
                                  throws MacawException
Throws:
MacawException

releaseConnection

public void releaseConnection(java.sql.Connection connection)