org.mmbase.datatypes
Class VerifyEmailProcessor

java.lang.Object
  extended by org.mmbase.datatypes.VerifyEmailProcessor
All Implemented Interfaces:
Serializable, CommitProcessor, Processor

public class VerifyEmailProcessor
extends Object
implements CommitProcessor, Processor, Serializable

Using this class a Processor and as CommitProcessor on a certain field, adds 'email verification' functionality for another field. If this other field is changed, then this change will be ignored but in stead be stored on this 'verify email' field, together with a verification key. The verification can then be done by setting this key in this verify field (so, over the implicitely stored value). If the key is then the same as already stored, then the new email value is stored in the actual email field, and the verify field is emptied.

Version:
$Id: VerifyEmailProcessor.java 42278 2010-05-26 14:11:47Z andre $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
protected static Set<String> verificationReceivers
           
 
Constructor Summary
VerifyEmailProcessor()
           
 
Method Summary
 void commit(Node node, Field field)
          Will be called on commit of the node.
static String decrypt(String string)
           
static String encrypt(String string)
           
protected  String encryptKey(Node node, Field field, String key)
           
protected  String generateKey()
           
protected  ResourceBundle getResourceBundle(Locale locale)
           
static Set<String> getVerificationReceivers()
           
static void main(String[] argv)
           
 Object process(Node node, Field field, Object value)
           
 void setEmailField(String ef)
           
 void setIncludeUrl(String u)
           
 void setOnlyForSelf(boolean o)
           
 void setSuccessProcessor(String p)
           
 void setTextBundle(String b)
           
static void setupEncryption()
           
 void setUrl(String u)
           
static Node validate(Cloud cloud, String encryptedKey)
          Call this method with the key received from the client to perform the actual validation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

verificationReceivers

protected static Set<String> verificationReceivers
Constructor Detail

VerifyEmailProcessor

public VerifyEmailProcessor()
Method Detail

getVerificationReceivers

public static Set<String> getVerificationReceivers()

setOnlyForSelf

public void setOnlyForSelf(boolean o)

setEmailField

public void setEmailField(String ef)

setTextBundle

public void setTextBundle(String b)

getResourceBundle

protected ResourceBundle getResourceBundle(Locale locale)

setSuccessProcessor

public void setSuccessProcessor(String p)

setUrl

public void setUrl(String u)

setIncludeUrl

public void setIncludeUrl(String u)

setupEncryption

public static void setupEncryption()

encrypt

public static String encrypt(String string)

decrypt

public static String decrypt(String string)

generateKey

protected String generateKey()

process

public Object process(Node node,
                      Field field,
                      Object value)
Specified by:
process in interface Processor
Parameters:
node - The node object for which the field must be transformed.
field - The field which is set.
value - The (new) field value.

encryptKey

protected String encryptKey(Node node,
                            Field field,
                            String key)

validate

public static Node validate(Cloud cloud,
                            String encryptedKey)
Call this method with the key received from the client to perform the actual validation. This method decrypts and parses this key, and then sets the value.


commit

public void commit(Node node,
                   Field field)
Description copied from interface: CommitProcessor
Will be called on commit of the node.

Specified by:
commit in interface CommitProcessor

main

public static void main(String[] argv)
                 throws Exception
Throws:
Exception


MMBase 2.0-SNAPSHOT - null