AU
- type of AppUser
X
- registration typepublic abstract class AppUserNameFinder<AU extends AppUser,X extends AppUserNameFinder> extends AppUserComposite<AU,X> implements ParseFactory<AU>
Composite
that implements the NameFinder
logic for an AppUserFactory
.
These are included by composition in the AppUserFactory
allowing multiple name schemes to be supported at the same time.
AppUserNameFinder
s where userVisible()
return false have to be explicitly requested and are not
included in the AppUserFactory
NameFinder
implementation.
Though the normal operation of a AppUserNameFinder
is to locate existing database records it is also possible to
to have it query an external directory and lazily create database records.
Though a AppUserNameFinder
normally only supports a single name per realm it can support
many-to-one mappings for example Openid names where a user uses multiple identities.
Constructor and Description |
---|
AppUserNameFinder(AppUserFactory<AU> factory,
java.lang.String realm) |
Modifier and Type | Method and Description |
---|---|
abstract 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. |
AU |
findFromString(java.lang.String name)
Find an existing entry by name.
|
java.util.Set<java.lang.String> |
getAllNames(AU user)
Get all of the defined names for this realm.
|
DataCache<java.lang.String,AU> |
getDataCache() |
abstract java.lang.String |
getNameLabel()
Get a user presented label asking for the login name of the supported type.
|
java.lang.String |
getRealm()
Get the realm this finder applies to.
|
abstract SQLFilter<AU> |
getStringFinderFilter(java.lang.Class<? super AU> target,
java.lang.String name)
get a filter than locates the target object from a String.
|
protected java.lang.Class<? super X> |
getType()
Returns the type the composite should be registered under.
|
abstract void |
setName(AU user,
java.lang.String name)
Set the name of an object for this realm (If supported)
|
java.lang.String |
toString()
used to list composites on table structure page.
|
boolean |
userVisible()
Is this a name we might expect the user to know or an internal generated id.
|
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.
|
addDefaults, addFieldHelp, addOptional, addSelectors, addSuppress, addTranslations, customiseForm, customiseUpdateForm, getContext, getFactory, getLogger, getRecord, getRepository, modifyDefaultTableSpecification, postUpdate, preRegister, release
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCanonicalName
addFieldConstraints, addFormFields
public AppUserNameFinder(AppUserFactory<AU> factory, java.lang.String realm)
factory
- AppUserFactory
we are adding finder to.realm
- The realm to implement (can be prefixed by Namefinder.)public java.lang.String toString()
Composite
public abstract java.lang.String getNameLabel()
public final java.lang.String getRealm()
public abstract SQLFilter<AU> getStringFinderFilter(java.lang.Class<? super AU> target, java.lang.String name)
findFromString(String)
name
- public abstract boolean active()
AppUserNameFinder
An inactive finder still modifies the table specification but won't be retreivable as a realm.public abstract void setName(AU user, java.lang.String name)
user
- name
- public void validateName(java.lang.String name) throws ParseException
name
- ParseException
public boolean userVisible()
public void verified(AU user)
user
- public AU findFromString(java.lang.String name)
ParseFactory
findFromString
in interface ParseFactory<AU extends AppUser>
public java.util.Set<java.lang.String> getAllNames(AU user)
user
- protected java.lang.Class<? super X> getType()
Composite