AU - type of AppUser@Scopes(scopes={"email","impersonate"}) public class EmailNameFinder<AU extends AppUser> extends AppUserNameFinder<AU,EmailNameFinder<AU>> implements HistoryFieldContributor, SummaryContributer<AU>, AppUserTransitionContributor, AnonymisingComposite<AU>, RequiredPageProvider<AU>
AppUserNameFinder to handle users canonical Email
The email address is required not to resolve to an existing name on the factory unless it
corresponds to the current object.
(we query the full factory in case we have a NameFinder for known aliases as well.| Modifier and Type | Class and Description |
|---|---|
class |
EmailNameFinder.ChangeEmailTransition |
class |
EmailNameFinder.VerifyEmailRequiredPage |
| Modifier and Type | Field and Description |
|---|---|
static Feature |
ANON_TO_DUMMY_FEATURE |
static CurrentUserKey |
CHANGE_EMAIL |
static Feature |
CHANGE_EMAIL_FEATURE |
static java.lang.String |
EMAIL |
static java.lang.String |
EMAIL_MAXWIDTH_PROP
property to set the email input box width
|
static java.lang.String |
EMAIL_VERIFIED_FIELD |
| Constructor and Description |
|---|
EmailNameFinder(AppUserFactory<AU> factory) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
active()
Checks if sufficient database fields exist to use this
AppUserNameFinder
An inactive finder still modifies the table specification but won't be retreivable as a realm. |
void |
addAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes,
AU target)
Add to the set of attributes.
|
void |
addEraseFields(java.util.Set<java.lang.String> fields)
Add to the set of fields that contain PII data
This can be used to generate an anonymising rule for history tables
|
java.util.Map<java.lang.String,Selector> |
addSelectors(java.util.Map<java.lang.String,Selector> selectors)
Get a Map of selectors to use for forms of this type.
|
java.util.Set<java.lang.String> |
addSuppress(java.util.Set<java.lang.String> suppress)
generate the class specific set of suppressed fields to be used in form creation/update
The individual forms can override these so you usually use this method to define fields that should
be suppressed in all forms.
|
void |
addToHistorySpecification(TableSpecification spec)
add fields to the history table default specification.
|
void |
anonymise(AU target) |
void |
customiseForm(Form f)
Extension hook to allow additional Form customisation generic to all
types of Form (create and update) For example adding a FormValidator .
|
void |
customiseUpdateForm(Form f,
AU target,
SessionService operator)
Extension hook to allow additional Form customisation specific to the update
of an existing object.
|
java.lang.String |
getCanonicalName(AU object)
Get a canonical name of an object in a format that can be parsed by the
ParseFactory.findFromString(String) method. |
static FieldValidator<java.lang.String> |
getEmailValidator(AppContext conn) |
java.lang.String |
getNameLabel()
Get a user presented label asking for the login name of the supported type.
|
java.util.Set<RequiredPage<AU>> |
getRequiredPages()
Get the set of required pages.
|
SQLFilter<AU> |
getStringFinderFilter(java.lang.Class<? super AU> target,
java.lang.String name)
get a filter than locates the target object from a String.
|
java.util.Map<AppUserKey,Transition<AppUser>> |
getTransitions(AppUserTransitionProvider provider) |
protected java.lang.Class<? super EmailNameFinder<AU>> |
getType()
Returns the type the composite should be registered under.
|
java.util.Date |
getVerificationDate(AU user) |
TableSpecification |
modifyDefaultTableSpecification(TableSpecification spec,
java.lang.String table)
Modify the
TableSpecification of the target factory. |
java.util.Date |
needVerifyBy(AU user)
If email needs to be regularly verified when does this next need to be done by
|
BaseFilter<AU> |
needVerifyFilter() |
void |
setName(AU user,
java.lang.String name)
Set the name of an object for this realm (If supported)
|
boolean |
useEmailVerificationDate() |
void |
validateName(java.lang.String name)
Extension point to validate the format of the name before construction
|
void |
verified(AU user)
Extension point to record the time when this name was last verified
Verification could be that the name has sucessfully been generated by an authentication
system or in the case of an Email that the user has clicked on an opaque link sent to the email
address.
|
boolean |
warnVerify(AU user) |
findFromString, getAllNames, getDataCache, getRealm, toString, userVisibleaddDefaults, addFieldHelp, addOptional, addTranslations, getContext, getFactory, getLogger, getRecord, getRepository, postUpdate, preRegister, releaseclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddFieldConstraints, addFormFieldspublic static final java.lang.String EMAIL_MAXWIDTH_PROP
public static final java.lang.String EMAIL
public static final java.lang.String EMAIL_VERIFIED_FIELD
public static final Feature CHANGE_EMAIL_FEATURE
public static final Feature ANON_TO_DUMMY_FEATURE
public static CurrentUserKey CHANGE_EMAIL
public EmailNameFinder(AppUserFactory<AU> factory)
factory - public TableSpecification modifyDefaultTableSpecification(TableSpecification spec, java.lang.String table)
TableStructureContributerTableSpecification of the target factory.modifyDefaultTableSpecification in interface TableStructureContributer<AU extends AppUser>modifyDefaultTableSpecification in class Composite<AU extends AppUser,EmailNameFinder<AU extends AppUser>>public void addToHistorySpecification(TableSpecification spec)
HistoryFieldContributoraddToHistorySpecification in interface HistoryFieldContributorpublic java.util.Map<java.lang.String,Selector> addSelectors(java.util.Map<java.lang.String,Selector> selectors)
TableStructureContributeraddSelectors in interface TableStructureContributer<AU extends AppUser>addSelectors in class Composite<AU extends AppUser,EmailNameFinder<AU extends AppUser>>Map of modified selectors/inputspublic java.lang.String getCanonicalName(AU object)
ParseFactoryParseFactory.findFromString(String) method.getCanonicalName in interface ParseFactory<AU extends AppUser>public java.lang.String getNameLabel()
AppUserNameFindergetNameLabel in class AppUserNameFinder<AU extends AppUser,EmailNameFinder<AU extends AppUser>>public SQLFilter<AU> getStringFinderFilter(java.lang.Class<? super AU> target, java.lang.String name)
AppUserNameFinderAppUserNameFinder.findFromString(String)getStringFinderFilter in class AppUserNameFinder<AU extends AppUser,EmailNameFinder<AU extends AppUser>>public static FieldValidator<java.lang.String> getEmailValidator(AppContext conn)
public void customiseForm(Form f)
TableStructureContributerTableStructureContributer.customiseUpdateForm(Form, DataObject, SessionService)customiseForm in interface TableStructureContributer<AU extends AppUser>customiseForm in class Composite<AU extends AppUser,EmailNameFinder<AU extends AppUser>>f - Form to modifypublic void customiseUpdateForm(Form f, AU target, SessionService operator)
TableStructureContributerTableStructureContributer.customiseForm(Form)customiseUpdateForm in interface TableStructureContributer<AU extends AppUser>customiseUpdateForm in class Composite<AU extends AppUser,EmailNameFinder<AU extends AppUser>>public void setName(AU user, java.lang.String name)
AppUserNameFindersetName in class AppUserNameFinder<AU extends AppUser,EmailNameFinder<AU extends AppUser>>public boolean active()
AppUserNameFinderAppUserNameFinder
An inactive finder still modifies the table specification but won't be retreivable as a realm.active in class AppUserNameFinder<AU extends AppUser,EmailNameFinder<AU extends AppUser>>public void validateName(java.lang.String name)
throws ParseException
AppUserNameFindervalidateName in class AppUserNameFinder<AU extends AppUser,EmailNameFinder<AU extends AppUser>>ParseExceptionpublic void addAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes,
AU target)
SummaryContributerTable so the data should be of a
type that can be displayed by Tables
The keys should be display text.addAttributes in interface SummaryContributer<AU extends AppUser>public void anonymise(AU target)
anonymise in interface AnonymisingComposite<AU extends AppUser>public java.util.Map<AppUserKey,Transition<AppUser>> getTransitions(AppUserTransitionProvider provider)
getTransitions in interface AppUserTransitionContributorpublic void addEraseFields(java.util.Set<java.lang.String> fields)
AnonymisingCompositeaddEraseFields in interface AnonymisingComposite<AU extends AppUser>public void verified(AU user)
AppUserNameFinderverified in class AppUserNameFinder<AU extends AppUser,EmailNameFinder<AU extends AppUser>>public boolean useEmailVerificationDate()
public java.util.Date getVerificationDate(AU user)
public java.util.Set<java.lang.String> addSuppress(java.util.Set<java.lang.String> suppress)
TableStructureContributeraddSuppress in interface TableStructureContributer<AU extends AppUser>addSuppress in class Composite<AU extends AppUser,EmailNameFinder<AU extends AppUser>>Set of fields to suppress in forms.public java.util.Set<RequiredPage<AU>> getRequiredPages()
RequiredPageProvidergetRequiredPages in interface RequiredPageProvider<AU extends AppUser>public BaseFilter<AU> needVerifyFilter()
public boolean warnVerify(AU user)
public java.util.Date needVerifyBy(AU user)
user - Date or nullprotected final java.lang.Class<? super EmailNameFinder<AU>> getType()
CompositegetType in class AppUserNameFinder<AU extends AppUser,EmailNameFinder<AU extends AppUser>>