macaw.persistenceLayer.demo
Class InMemoryUserManager

java.lang.Object
  extended by macaw.persistenceLayer.demo.InMemoryUserManager
All Implemented Interfaces:
MacawSecurityAPI

public class InMemoryUserManager
extends java.lang.Object
implements MacawSecurityAPI

manages instances of User in-memory. Note that in future Macaw will rely on an external service for managing User identities. For now, Macaw uses its own built-in system for editing user data.


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
InMemoryUserManager(InMemoryChangeEventManager changeEventManager, Log log, User admin)
           
 
Method Summary
 void addUser(User admin, User user)
           
 void clear()
           
 void deleteUsers(User admin, java.util.ArrayList<User> usersToDelete)
           
 java.util.ArrayList<User> getUnverifiedUsers(User admin)
           
 User getUserFromEmail(User user, java.lang.String email)
           
 User getUserFromID(User user, java.lang.String userID)
           
 int getUserIdentifier(User user)
           
 java.util.ArrayList<User> getUsers(User admin)
          this is a utility
 void updateUser(User admin, User revisedUser)
           
 void validateAdministrator(User candidateAdmin)
           
 void validateUser(User candidateUser)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemoryUserManager

public InMemoryUserManager(InMemoryChangeEventManager changeEventManager,
                           Log log,
                           User admin)
Method Detail

validateUser

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

addUser

public void addUser(User admin,
                    User user)
             throws MacawException
Throws:
MacawException

updateUser

public void updateUser(User admin,
                       User revisedUser)
                throws MacawException
Throws:
MacawException

deleteUsers

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

getUsers

public java.util.ArrayList<User> getUsers(User admin)
this is a utility


getUserIdentifier

public int getUserIdentifier(User user)

getUserFromEmail

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

getUserFromID

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

getUnverifiedUsers

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

clear

public void clear()

validateAdministrator

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