com.randomcoder.user
Class UserBusinessImpl

java.lang.Object
  extended by com.randomcoder.user.UserBusinessImpl
All Implemented Interfaces:
UserBusiness

public class UserBusinessImpl
extends Object
implements UserBusiness

Business implementation for user management.

 Copyright (c) 2006-2007, Craig Condit. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
 
   * Redistributions of source code must retain the above copyright notice,
     this list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above copyright notice,
     this list of conditions and the following disclaimer in the documentation
     and/or other materials provided with the distribution.
     
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 


Constructor Summary
UserBusinessImpl()
           
 
Method Summary
 void associateCardSpaceCredentials(Long userId, CardSpaceCredentials credentials)
          Associates the given CardSpaceCredentials with the given user.
 void auditCardSpaceLogin(CardSpaceCredentials credentials)
          Marks a user as having logged in as of a particular date and time and marks the associated CardSpaceToken as used.
 void auditUsernamePasswordLogin(String userName)
          Marks a user as having logged in as of a particular date and time.
 void changePassword(String userName, String password)
          Change a user's password.
 void createAccount(Producer<User> producer)
          Creates a new account using a password.
 void createAccount(Producer<User> userProducer, Producer<CardSpaceToken> tokenProducer)
          Creates a new account using CardSpace credentials.
 void createUser(Producer<User> producer)
          Create a new user.
 void deleteCardSpaceToken(String userName, Long tokenId)
          Deletes a CardSpace token.
 void deleteUser(Long userId)
          Deletes a user.
 void loadUserForEditing(Consumer<User> consumer, Long userId)
          Loads a user for editing.
 void setCardSpaceTokenDao(CardSpaceTokenDao cardSpaceTokenDao)
          Sets the CardSpaceTokenDao implementation to use.
 void setUserDao(UserDao userDao)
          Sets the UserDao implementation to use.
 void updateUser(Producer<User> producer, Long userId)
          Update an existing user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserBusinessImpl

public UserBusinessImpl()
Method Detail

setUserDao

public void setUserDao(UserDao userDao)
Sets the UserDao implementation to use.

Parameters:
userDao - UserDao implementation

setCardSpaceTokenDao

public void setCardSpaceTokenDao(CardSpaceTokenDao cardSpaceTokenDao)
Sets the CardSpaceTokenDao implementation to use.

Parameters:
cardSpaceTokenDao - CardSpaceTokenDao implementation

changePassword

@Transactional
public void changePassword(String userName,
                                         String password)
Description copied from interface: UserBusiness
Change a user's password.

Specified by:
changePassword in interface UserBusiness
Parameters:
userName - user name
password - new password

createUser

@Transactional
public void createUser(Producer<User> producer)
Description copied from interface: UserBusiness
Create a new user.

Specified by:
createUser in interface UserBusiness
Parameters:
producer - user producer

createAccount

@Transactional
public void createAccount(Producer<User> producer)
Description copied from interface: UserBusiness
Creates a new account using a password.

Specified by:
createAccount in interface UserBusiness
Parameters:
producer - user producer

createAccount

@Transactional
public void createAccount(Producer<User> userProducer,
                                        Producer<CardSpaceToken> tokenProducer)
Description copied from interface: UserBusiness
Creates a new account using CardSpace credentials.

Specified by:
createAccount in interface UserBusiness
Parameters:
userProducer - user producer
tokenProducer - CardSpace token producer

updateUser

@Transactional
public void updateUser(Producer<User> producer,
                                     Long userId)
Description copied from interface: UserBusiness
Update an existing user.

Specified by:
updateUser in interface UserBusiness
Parameters:
producer - user producer
userId - user id

deleteUser

@Transactional
public void deleteUser(Long userId)
Description copied from interface: UserBusiness
Deletes a user.

Specified by:
deleteUser in interface UserBusiness
Parameters:
userId - user id to delete

loadUserForEditing

@Transactional(readOnly=true)
public void loadUserForEditing(Consumer<User> consumer,
                                                     Long userId)
Description copied from interface: UserBusiness
Loads a user for editing.

Specified by:
loadUserForEditing in interface UserBusiness
Parameters:
consumer - consumer
userId - id of user to load

associateCardSpaceCredentials

@Transactional
public void associateCardSpaceCredentials(Long userId,
                                                        CardSpaceCredentials credentials)
Description copied from interface: UserBusiness
Associates the given CardSpaceCredentials with the given user.

Specified by:
associateCardSpaceCredentials in interface UserBusiness
Parameters:
userId - user id of user to associate credentials with
credentials - CardSpace credentials

auditUsernamePasswordLogin

@Transactional
public void auditUsernamePasswordLogin(String userName)
Description copied from interface: UserBusiness
Marks a user as having logged in as of a particular date and time.

Specified by:
auditUsernamePasswordLogin in interface UserBusiness
Parameters:
userName - user name to update

auditCardSpaceLogin

@Transactional
public void auditCardSpaceLogin(CardSpaceCredentials credentials)
Description copied from interface: UserBusiness
Marks a user as having logged in as of a particular date and time and marks the associated CardSpaceToken as used.

Specified by:
auditCardSpaceLogin in interface UserBusiness
Parameters:
credentials - credentials to update

deleteCardSpaceToken

@Transactional
public void deleteCardSpaceToken(String userName,
                                               Long tokenId)
Description copied from interface: UserBusiness
Deletes a CardSpace token.

Specified by:
deleteCardSpaceToken in interface UserBusiness
Parameters:
userName - current user
tokenId - id of token to delete


Copyright © 2006-2010 Craig Condit. All Rights Reserved.