ch.openchvote.printingauthority.writein.EventContext Maven / Gradle / Ivy
/*
* Copyright (C) 2024 Berner Fachhochschule https://e-voting.bfh.ch
*
* - This program is free software: you can redistribute it and/or modify -
* - it under the terms of the GNU Affero General Public License as published by -
* - the Free Software Foundation, either version 3 of the License, or -
* - (at your option) any later version. -
* - -
* - This program is distributed in the hope that it will be useful, -
* - but WITHOUT ANY WARRANTY; without even the implied warranty of -
* - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -
* - GNU General Public License for more details. -
* - -
* - You should have received a copy of the GNU Affero General Public License -
* - along with this program. If not, see . -
*/
package ch.openchvote.printingauthority.writein;
import ch.openchvote.framework.party.State;
import ch.openchvote.printingauthority.writein.states.S100;
import ch.openchvote.utilities.serializer.TypeReference;
import ch.openchvote.utilities.tuples.Sextuple;
/**
* Instances of this class represent the election printing authority's event context. The private constructor
* {@link EventContext#EventContext(String, String, String)} defines the printing authority's initial state and its public and
* secret event data. The framework calls this constructor using reflection.
*/
@SuppressWarnings("unused")
public final class EventContext extends ch.openchvote.framework.party.EventContext {
@SuppressWarnings("MissingJavadoc")
static public final TypeReference> TYPE_REFERENCE = new TypeReference<>() {
};
// private constructor for an empty event context set to the initial state
private EventContext(String eventId, String protocolId, String securityLevel) {
this(eventId, protocolId, securityLevel, State.getId(S100.class), new PublicData(), new SecretData());
}
// private constructor for initializing all fields
private EventContext(String eventId, String protocolId, String securityLevel, String stateId, PublicData publicData, SecretData secretData) {
super(eventId, protocolId, securityLevel, stateId, publicData, secretData);
}
// private copy constructor
private EventContext(EventContext eventContext) {
super(eventContext);
}
}