Package de.xima.fc.form.identitytoken
Class IdentityTokenUpdate
- java.lang.Object
-
- de.xima.fc.form.identitytoken.IdentityTokenUpdate
-
public class IdentityTokenUpdate extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
IdentityTokenUpdate()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Vorgang>
getFailedFormRecord()
Optional<EIdentityTokenFailure>
getUpdateFailed()
List<Map.Entry<String,List<Vorgang>>>
getViolations()
static IdentityTokenUpdate
perform(IEntityContext ec, Projekt project)
Updates the identity token of all form records for the given project with the current identity token template of that project.
-
-
-
Method Detail
-
getUpdateFailed
public Optional<EIdentityTokenFailure> getUpdateFailed()
- Returns:
- Empty if the update succeeded, the type of error otherwise.
-
getViolations
public List<Map.Entry<String,List<Vorgang>>> getViolations()
- Returns:
- List of all violations, ie. form-records with non-unique IDs. The key of the entry is the generated identity token, the value a list of all form records with that token.
-
getFailedFormRecord
public Optional<Vorgang> getFailedFormRecord()
- Returns:
- If the update failed and the error is
EIdentityTokenFailure.GENERATE_MAX_LENGTH_EXCEEDED
orEIdentityTokenFailure.UPDATE_NOT_UNIQUE
, one form record that caused the failure.
-
perform
public static IdentityTokenUpdate perform(IEntityContext ec, Projekt project)
Updates the identity token of all form records for the given project with the current identity token template of that project. Returns whether the operation succeeded. If it did not succeed because the new identity token template resulted in multiple form records with the same identity token, also return the list of form records violating the uniqueness constraint.- Parameters:
ec
- Entity context for accessing the database.project
- The project with the form records to update.- Returns:
- The result of the identity token check.
-
-