Package de.xima.fc.entities
Class AAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- java.lang.Object
-
- de.xima.cmn.dao.model.AEntity<Long>
-
- de.xima.fc.entities.AbstractEntity
-
- de.xima.fc.entities.AbstractLockableEntity
-
- de.xima.fc.entities.ALockableEntity
-
- de.xima.fc.entities.AAuthenticator<T>
-
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IEntity<Long>
,de.xima.cmn.dao.interfaces.ILockableEntity<Long>
,IAuthenticator<T>
,IDescriptionProviding
,ILockingVersionProviding
,INameProviding
,ITransferable
,ITransferableEntity
,ITransferableLockableEntity
,IUUIDEntity
,Serializable
,Comparable<de.xima.cmn.dao.interfaces.IEntity<Long>>
- Direct Known Subclasses:
ClientAuthenticator
,SystemAuthenticator
@MappedSuperclass public abstract class AAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>> extends ALockableEntity implements IAuthenticator<T>
Abstract base class for user authenticators- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_CALLBACK_URL_TYPE
static String
ATTR_CALLBACK_UUID
static String
ATTR_CONFIG_STATE
static String
ATTR_TYPE
protected Map<String,String>
attributes
static String
COL_CALLBACK_URL_TYPE
static String
COL_UUID
protected Map<String,T>
fileMap
-
Fields inherited from class de.xima.fc.entities.AbstractLockableEntity
COL_LOCKINGVERSION, lockingVersion
-
Fields inherited from class de.xima.fc.entities.AbstractEntity
COL_ID, id
-
Fields inherited from interface de.xima.fc.entities.interfaces.IDescriptionProviding
ATTR_BESCHREIBUNG, ATTR_DESCRIPTION, COL_DESCRIPTION
-
Fields inherited from interface de.xima.fc.entities.interfaces.INameProviding
ATTR_NAME, COL_NAME
-
Fields inherited from interface de.xima.fc.entities.interfaces.ITransferableEntity
IMPORT_ID, INVALID_ID
-
Fields inherited from interface de.xima.fc.entities.interfaces.IUUIDEntity
ATTR_UUID, INVALID_UUID, INVALID_UUID_OBJECT, NULL_SAFE_UUID_TYPE, TYPE_NAME_UUID
-
-
Constructor Summary
Constructors Constructor Description AAuthenticator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAttributeValue(String key)
Get theString
value of the attribute with the given keyList<String>
getAttributeValueList(String key)
Get theList
value of the attribute with the given keyMap<String,String>
getAttributeValueMap(String key)
Get theMap
value of the attribute with the given keyString
getBeschreibung()
EAuthCallbackUrlType
getCallbackUrlType()
UUID
getCallbackUUID()
String
getCallbackUUIDString()
EAuthConfigState
getConfigState()
String
getDescription()
String
getLoginButtonTitle()
String
getName()
EAuthClientType
getType()
String
getUUID()
UUID
getUUIDObject()
void
putAttribute(String key, String value)
Puts the givenString
value for the given key in the attribute map of this authenticatorvoid
putAttributes(String key, List<String> values)
Puts the givenList
value for the given key in the attribute map of this authenticatorvoid
putAttributes(String key, Map<String,String> valueMap)
Puts the givenMap
value for the given key in the attribute map of this authenticatorT
putFile(String key, T file)
String
removeAttribute(String key)
Removes the attributes for the given keyT
removeFile(String key)
Removes the file mapping for the given key.void
setAttributes(Map<String,String> attributes)
void
setCallbackUrlType(EAuthCallbackUrlType callbackUrlType)
void
setCallbackUUID(UUID callbackUUID)
void
setCallbackUUIDString(String uuidString)
void
setConfigState(EAuthConfigState configState)
void
setDescription(String description)
void
setFileMap(Map<String,T> fileMap)
DON'T USE!void
setLoginButtonTitle(String loginButtonTitle)
void
setName(String name)
void
setType(EAuthClientType type)
void
setUUID(String uuid)
void
setUUIDObject(UUID uuid)
String
toString()
-
Methods inherited from class de.xima.fc.entities.AbstractLockableEntity
entityHasChanged, getLockingVersion, setLockingVersion
-
Methods inherited from class de.xima.fc.entities.AbstractEntity
asIntValue, isPersisted, setId, setId
-
Methods inherited from class de.xima.cmn.dao.model.AEntity
compareTo, equals, getDBTableName, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface de.xima.fc.entities.interfaces.IAuthenticator
getAttributes, getFileMap, getIdentifier
-
-
-
-
Field Detail
-
COL_UUID
public static final String COL_UUID
- See Also:
- Constant Field Values
-
COL_CALLBACK_URL_TYPE
public static final String COL_CALLBACK_URL_TYPE
- See Also:
- Constant Field Values
-
ATTR_TYPE
public static final String ATTR_TYPE
- See Also:
- Constant Field Values
-
ATTR_CALLBACK_UUID
public static final String ATTR_CALLBACK_UUID
- See Also:
- Constant Field Values
-
ATTR_CALLBACK_URL_TYPE
public static final String ATTR_CALLBACK_URL_TYPE
- See Also:
- Constant Field Values
-
ATTR_CONFIG_STATE
public static final String ATTR_CONFIG_STATE
- See Also:
- Constant Field Values
-
fileMap
protected Map<String,T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>> fileMap
-
-
Method Detail
-
getUUID
public String getUUID()
- Specified by:
getUUID
in interfaceIUUIDEntity
- Returns:
- UUID (Universal Unique Identifier) that identifies this type of entity. Usually is unique within a context,
e.g.
Mandant
,Projekt
, ...
-
setUUID
public void setUUID(String uuid)
- Specified by:
setUUID
in interfaceIUUIDEntity
-
getUUIDObject
public UUID getUUIDObject()
- Specified by:
getUUIDObject
in interfaceIUUIDEntity
-
setUUIDObject
public void setUUIDObject(UUID uuid)
-
getName
public String getName()
- Specified by:
getName
in interfaceINameProviding
- Returns:
- The name of this object.
-
setName
public void setName(String name)
-
getBeschreibung
public String getBeschreibung()
- Specified by:
getBeschreibung
in interfaceIDescriptionProviding
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceIDescriptionProviding
- Returns:
- A human-readable description for this object.
-
setDescription
public void setDescription(String description)
-
getType
public EAuthClientType getType()
- Specified by:
getType
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- Returns:
- The authenticator type as selected by the user, such as Google, Facebook or NTLM.
-
setType
public void setType(EAuthClientType type)
-
getCallbackUUID
public UUID getCallbackUUID()
- Specified by:
getCallbackUUID
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- Returns:
- The UUID that uniquely identifies this client. It is added to the callback URL (the URL to which the identity provider redirects upon success or failure).
-
setCallbackUUID
public void setCallbackUUID(UUID callbackUUID)
-
getCallbackUrlType
public EAuthCallbackUrlType getCallbackUrlType()
- Specified by:
getCallbackUrlType
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- Returns:
- the type of callback URL to be used by this authenticator.
-
setCallbackUrlType
public void setCallbackUrlType(EAuthCallbackUrlType callbackUrlType)
-
getCallbackUUIDString
public String getCallbackUUIDString()
-
setCallbackUUIDString
public void setCallbackUUIDString(String uuidString)
-
getLoginButtonTitle
public String getLoginButtonTitle()
- Specified by:
getLoginButtonTitle
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- Returns:
- The name displayed on the login button that appears on the login page.
-
setLoginButtonTitle
public void setLoginButtonTitle(String loginButtonTitle)
-
getConfigState
public EAuthConfigState getConfigState()
- Specified by:
getConfigState
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- Returns:
- The current state of this configuration, i.e. whether it still misses some configuration or was configured completely and is ready to be used.
-
setConfigState
public void setConfigState(EAuthConfigState configState)
-
setAttributes
public void setAttributes(Map<String,String> attributes)
- Specified by:
setAttributes
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
-
getAttributeValue
public String getAttributeValue(String key)
Get theString
value of the attribute with the given key- Specified by:
getAttributeValue
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- Parameters:
key
-String
attribute name- Returns:
String
value of the requested attribute- See Also:
IAuthenticator.getAttributes()
-
getAttributeValueList
public List<String> getAttributeValueList(String key)
Get theList
value of the attribute with the given key
-
getAttributeValueMap
public Map<String,String> getAttributeValueMap(String key)
Get theMap
value of the attribute with the given key- Specified by:
getAttributeValueMap
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- Parameters:
key
-String
attribute name- Returns:
Map
value of the requested attribute ornull
if the attribute does not exist or can't be parsed to a map.
-
putAttribute
public void putAttribute(String key, String value)
Puts the givenString
value for the given key in the attribute map of this authenticator- Specified by:
putAttribute
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- Parameters:
key
-String
attribute namevalue
-String
value of the attribute
-
putAttributes
public void putAttributes(String key, List<String> values)
Puts the givenList
value for the given key in the attribute map of this authenticator- Specified by:
putAttributes
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- Parameters:
key
-String
attribute namevalues
-List
value of the attribute
-
putAttributes
public void putAttributes(String key, Map<String,String> valueMap)
Puts the givenMap
value for the given key in the attribute map of this authenticator- Specified by:
putAttributes
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- Parameters:
key
-String
attribute namevalueMap
-Map
value of the attribute
-
removeAttribute
public String removeAttribute(String key)
Removes the attributes for the given key- Parameters:
key
-String
key in the attribute map- Returns:
true
if the attribute was removed
-
setFileMap
public void setFileMap(Map<String,T> fileMap)
DON'T USE! Hibernate is managing this collection, so if it is overridden, Hibernate can't keep track of it anymore. UseputFile(String, IFileEntity)
,removeFile(String)
orIAuthenticator.getFileMap()
instead to modify the map.- Specified by:
setFileMap
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
-
putFile
public T putFile(String key, T file)
- Specified by:
putFile
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- Parameters:
key
-String
to store file underfile
- the file to put into file map- Returns:
- the file previously stored for the given key or
null
if there wasn't any
-
removeFile
public T removeFile(String key)
Removes the file mapping for the given key. SeeMap.remove(Object)
.- Specified by:
removeFile
in interfaceIAuthenticator<T extends IFileEntity<? extends de.xima.cmn.dao.interfaces.IEntity<Long>,? extends IFileDataEntity<?>>>
- Parameters:
key
-String
key in the file map- Returns:
- the removed file or
null
if there wasn't any
-
toString
public String toString()
- Overrides:
toString
in classAbstractLockableEntity
-
-