Interface IdentityTypeDefinition
- All Known Subinterfaces:
DynamicIdentityTypeDefinition
public interface IdentityTypeDefinition
Implementation defined identity type.
Currently it is stateless, but
IdentityType wraps configuration which in future can be used to
convert also this interface to be stateful and so configurable.- Author:
- K. Benedyczak
-
Method Summary
Modifier and TypeMethodDescriptionpl.edu.icm.unity.base.identity.IdentityParamconvertFromString(String stringRepresentation, String remoteIdp, String translationProfile) Creates an IdentityParam from a string representation.pl.edu.icm.unity.base.identity.IdentitycreateNewIdentity(String realm, String target, long entityId) Tries to create a new identity.getComparableValue(String from, String realm, String target) Comparable value must be guaranteed to be unique for the type, i.e. if two values are the same (case sensitive), then the identities represent the same principal.getHumanFriendlyDescription(pl.edu.icm.unity.base.message.MessageSource msg) getHumanFriendlyName(pl.edu.icm.unity.base.message.MessageSource msg) getId()booleanbooleanbooleanisExpired(pl.edu.icm.unity.base.identity.Identity identity) Checks if the identity is expired.booleanbooleanbooleantoHumanFriendlyString(pl.edu.icm.unity.base.message.MessageSource msg, pl.edu.icm.unity.base.identity.IdentityParam from) toPrettyString(pl.edu.icm.unity.base.identity.IdentityParam from) Similar to, but allows for less verbose and more user-friendly output.invalid reference
#toString()toPrettyStringNoPrefix(pl.edu.icm.unity.base.identity.IdentityParam from) Similar to, but doesn't return id type prefix.invalid reference
#toPrettyString()toString(pl.edu.icm.unity.base.identity.IdentityParam from) voidChecks if the value is valid
-
Method Details
-
getId
String getId()- Returns:
- type id
-
getDefaultDescriptionKey
String getDefaultDescriptionKey()- Returns:
- identity type default description
-
isDynamic
boolean isDynamic()- Returns:
- if true then the identity type is dynamic, and can not be created manually. Dynamic identities are created automatically.
-
isUserSettable
boolean isUserSettable()- Returns:
- if true then the identity type can be set by user.
-
isRemovable
boolean isRemovable()- Returns:
- false is returned only for dynamic identities, which can not be removed manually. This happens for volatile identities, for instance session-scoped. Those identities can be only reset, i.e. all instances of its type can be removed.
-
isTargeted
boolean isTargeted()- Returns:
- if true then identities of this type are targeted, i.e. can have a different value
for each and every receiver (target). This implies that the authentication realm and target are mandatory
parameters for the methods as e.g. the
getComparableValue(String, String, String).
-
isEmailVerifiable
boolean isEmailVerifiable()- Returns:
- if true then identities of this type can be confirmed.
-
isExpired
boolean isExpired(pl.edu.icm.unity.base.identity.Identity identity) Checks if the identity is expired.- Parameters:
identity- to be checked- Returns:
- true if expired, false otherwise
-
validate
Checks if the value is valid- Throws:
pl.edu.icm.unity.base.identity.IllegalIdentityValueException
-
getComparableValue
Comparable value must be guaranteed to be unique for the type, i.e. if two values are the same (case sensitive), then the identities represent the same principal.- Parameters:
from- mandatory raw identity valuerealm- realm value, can be nulltarget- target for which the identity is going to be used, can be null- Returns:
- comparable value of the string
-
toPrettyString
Similar to, but allows for less verbose and more user-friendly output.invalid reference
#toString() -
toPrettyStringNoPrefix
Similar to, but doesn't return id type prefix.invalid reference
#toPrettyString() -
toString
- Returns:
- full String representation
-
toHumanFriendlyString
String toHumanFriendlyString(pl.edu.icm.unity.base.message.MessageSource msg, pl.edu.icm.unity.base.identity.IdentityParam from) - Returns:
- string representation which is most useful for end-user. Note that this representation may even hide the actual value if it is considered cryptic.
-
getHumanFriendlyName
- Returns:
- Name of the type which can be presented to end user.
-
getHumanFriendlyDescription
- Returns:
- Description of the type which can be presented to end user.
-
createNewIdentity
pl.edu.icm.unity.base.identity.Identity createNewIdentity(String realm, String target, long entityId) Tries to create a new identity. Can be called only for types which report themself as dynamic.- Parameters:
realm- authentication realm identifier or null if no realm is definedtarget- null or the receiver of the created identityentityId- entityId to be set in the returned identity- Returns:
- newly generated identity
- Throws:
IllegalStateException- if the creation failed: typically when used on a static type.
-
convertFromString
pl.edu.icm.unity.base.identity.IdentityParam convertFromString(String stringRepresentation, String remoteIdp, String translationProfile) throws pl.edu.icm.unity.base.identity.IllegalIdentityValueException Creates an IdentityParam from a string representation. Typically the method is simplistic (i.e. theIdentityTaV.getValue(), remoteIdp and profile is set to the arguments and type togetId()), but it can also perform additional parsing to set for instance the confirmation information.- Throws:
pl.edu.icm.unity.base.identity.IllegalIdentityValueException
-