Package com.exedio.cope.pattern
Class PasswordRecovery
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Pattern
-
- com.exedio.cope.pattern.PasswordRecovery
-
- All Implemented Interfaces:
Serializable
public final class PasswordRecovery extends Pattern
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PasswordRecovery.Config
static class
PasswordRecovery.Token
-
Constructor Summary
Constructors Constructor Description PasswordRecovery(Hash password)
PasswordRecovery(HashInterface password)
PasswordRecovery(HashInterface password, SecureRandom random)
PasswordRecovery(Hash password, SecureRandom random)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DateField
getExpires()
<P extends Item>
ItemField<P>getParent(Class<P> parentClass)
HashInterface
getPassword()
LongField
getSecret()
PartOf<?>
getTokens()
Type<PasswordRecovery.Token>
getTokenType()
PasswordRecovery.Token
getValidToken(Item item, long secret)
PasswordRecovery.Token
issue(Item item, int expiryMillis)
Deprecated.Useissue(Item, Config)
instead.PasswordRecovery.Token
issue(Item item, PasswordRecovery.Config config)
protected void
onMount()
Here you can do additional initialization not yet done in the constructor.int
purge(Interrupter interrupter)
Deprecated.Usepurge(JobContext)
instead.void
purge(JobContext ctx)
int
purge(Class<?> parentClass, Interrupter interrupter)
Deprecated.Usepurge(com.exedio.cope.util.Interrupter)
instead.String
redeem(Item item, long secret)
-
Methods inherited from class com.exedio.cope.Pattern
addSource, addSource, addSource, addSource, addSourceFeature, addSourceFeature, addSourceFeature, annotationField, equals, getGeneratedTypes, getSourceFeatures, getSourceFeaturesGather, getSourceFields, getSources, getSourceTypes, getType, hashCode, initialize, newSourceType, newSourceType, newSourceType, newSourceType, newSourceType, newSourceType, newType, newType, registerSource
-
Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
-
-
-
Constructor Detail
-
PasswordRecovery
public PasswordRecovery(Hash password)
-
PasswordRecovery
public PasswordRecovery(HashInterface password)
-
PasswordRecovery
public PasswordRecovery(Hash password, SecureRandom random)
-
PasswordRecovery
public PasswordRecovery(HashInterface password, SecureRandom random)
-
-
Method Detail
-
onMount
protected void onMount()
Description copied from class:Pattern
Here you can do additional initialization not yet done in the constructor. In this method you can call methodsPattern.getType()
andFeature.getName()
for the first time.
-
getPassword
public HashInterface getPassword()
-
getTokens
public PartOf<?> getTokens()
-
getSecret
public LongField getSecret()
-
getExpires
public DateField getExpires()
-
getTokenType
public Type<PasswordRecovery.Token> getTokenType()
-
issue
@Nonnull public PasswordRecovery.Token issue(@Nonnull Item item, @Nonnull PasswordRecovery.Config config)
- Returns:
- a valid token for password recovery
-
getValidToken
@Nullable public PasswordRecovery.Token getValidToken(@Nonnull Item item, long secret)
- Parameters:
secret
- a secret for password recovery- Returns:
- a valid token, if existing, otherwise null
-
redeem
@Nullable public String redeem(@Nonnull Item item, long secret)
- Parameters:
secret
- a secret for password recovery- Returns:
- a new password, if the secret was valid, otherwise null
-
purge
public void purge(@Nonnull JobContext ctx)
-
purge
@Deprecated public int purge(Class<?> parentClass, Interrupter interrupter)
Deprecated.Usepurge(com.exedio.cope.util.Interrupter)
instead.
-
purge
@Deprecated public int purge(@Nullable Interrupter interrupter)
Deprecated.Usepurge(JobContext)
instead.
-
issue
@Deprecated @Nonnull public PasswordRecovery.Token issue(@Nonnull Item item, int expiryMillis)
Deprecated.Useissue(Item, Config)
instead.- Returns:
- a valid token for password recovery
-
-