magoffin.matt.ma2.aop
Class UserLoginEmailInterceptor

java.lang.Object
  extended by magoffin.matt.ma2.aop.AbstractMailTemplateInterceptor
      extended by magoffin.matt.ma2.aop.UserEmailInterceptor
          extended by magoffin.matt.ma2.aop.UserLoginEmailInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class UserLoginEmailInterceptor
extends UserEmailInterceptor

Email interceptor for forgot password email handling.

This email interceptor will look for a user login as the first argument to the method being intercepted.

The configurable properties of this class are:

userDao
The UserDao instance to use.

Version:
$Revision: 43 $ $Date: 2007-10-21 11:10:01 +1300 (Sun, 21 Oct 2007) $
Author:
Matt Magoffin (spamsqr@msqr.us)

Field Summary
 
Fields inherited from class magoffin.matt.ma2.aop.UserEmailInterceptor
CONFIRM_URL_KEY, RESULT_KEY, USER_KEY
 
Fields inherited from class magoffin.matt.ma2.aop.AbstractMailTemplateInterceptor
log
 
Constructor Summary
UserLoginEmailInterceptor()
           
 
Method Summary
 UserDao getUserDao()
           
protected  org.springframework.mail.SimpleMailMessage postProcessModel(org.aopalliance.intercept.MethodInvocation invocation, java.util.Map<java.lang.String,java.lang.Object> model, java.lang.Object result)
          Get a SimpleMailMessage object based on the result of the method invocation.
 void setUserDao(UserDao userDao)
           
 
Methods inherited from class magoffin.matt.ma2.aop.UserEmailInterceptor
getConfirmUrl, getInitialModel, getLocale, setConfirmUrl
 
Methods inherited from class magoffin.matt.ma2.aop.AbstractMailTemplateInterceptor
getMailMergeSupport, invoke, setMailMergeSupport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserLoginEmailInterceptor

public UserLoginEmailInterceptor()
Method Detail

postProcessModel

protected org.springframework.mail.SimpleMailMessage postProcessModel(org.aopalliance.intercept.MethodInvocation invocation,
                                                                      java.util.Map<java.lang.String,java.lang.Object> model,
                                                                      java.lang.Object result)
Description copied from class: AbstractMailTemplateInterceptor
Get a SimpleMailMessage object based on the result of the method invocation.

You can use the MailMergeHelper instance's MailMergeHelper.getMessageTemplate() method to obtain a mail message template, and use the SimpleMailMessage.SimpleMailMessage(org.springframework.mail.SimpleMailMessage) copy constructor to create the SimpleMailMessage to return here. Most likely the only property you'll need to set on the result if the to property.

Overrides:
postProcessModel in class UserEmailInterceptor
Parameters:
invocation - the current method invocation
model - the model Map
result - the method invocation result object
Returns:
a SimpleMailMessage object with appropriate information set, i.e. the to property

getUserDao

public UserDao getUserDao()
Returns:
the userDao

setUserDao

public void setUserDao(UserDao userDao)
Parameters:
userDao - the userDao to set