Package com.exedio.cope.pattern
Class DrivebyHashMigration
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Pattern
-
- com.exedio.cope.pattern.DrivebyHashMigration
-
- All Implemented Interfaces:
HashInterface
,Settable<String>
,Serializable
public final class DrivebyHashMigration extends Pattern implements HashInterface
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DrivebyHashMigration(HashAlgorithm legacy, HashAlgorithm target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
blind(String actualPlainText)
boolean
check(Item item, String actualPlainText)
SetValue<?>[]
execute(String value, Item exceptionItem)
String
getHash(Item item)
Set<Class<? extends Throwable>>
getInitialExceptions()
Returns the exceptions possibly thrown, when setting a value for this settable.Type
getInitialType()
Hash
getLegacyHash()
Hash
getTargetHash()
boolean
isFinal()
Returns true, if a value for the settable can be specified on the creation of an item only, thus cannot be modified later.boolean
isInitial()
Returns true, if a value for the settable should be specified on the creation of an item.boolean
isMandatory()
boolean
isNull(Item item)
String
newRandomPassword(SecureRandom random)
void
set(Item item, String plainText)
-
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, onMount, 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
-
DrivebyHashMigration
public DrivebyHashMigration(HashAlgorithm legacy, HashAlgorithm target)
- Parameters:
legacy
- the algorithm the passwords are currently hashed withtarget
- the algorithm the passwords are to be hashed with in the future
-
-
Method Detail
-
getLegacyHash
public Hash getLegacyHash()
-
getTargetHash
public Hash getTargetHash()
-
check
public boolean check(@Nonnull Item item, @Nullable String actualPlainText)
- Specified by:
check
in interfaceHashInterface
-
isNull
public boolean isNull(Item item)
- Specified by:
isNull
in interfaceHashInterface
-
getHash
public String getHash(Item item)
- Specified by:
getHash
in interfaceHashInterface
-
blind
public void blind(@Nullable String actualPlainText)
- Specified by:
blind
in interfaceHashInterface
-
newRandomPassword
public String newRandomPassword(SecureRandom random)
- Specified by:
newRandomPassword
in interfaceHashInterface
-
set
public void set(@Nonnull Item item, @Nonnull String plainText)
- Specified by:
set
in interfaceHashInterface
-
isFinal
public boolean isFinal()
Description copied from interface:Settable
Returns true, if a value for the settable can be specified on the creation of an item only, thus cannot be modified later.
-
isMandatory
public boolean isMandatory()
- Specified by:
isMandatory
in interfaceSettable<String>
-
getInitialType
public Type getInitialType()
- Specified by:
getInitialType
in interfaceSettable<String>
-
isInitial
public boolean isInitial()
Description copied from interface:Settable
Returns true, if a value for the settable should be specified on the creation of an item.
-
-