source: protocol/src/main/java/geniusweb/protocol/NegoState.java@ 43

Last change on this file since 43 was 43, checked in by bart, 2 years ago

Added python timedependent parties (conceder, hardliner, etc)

File size: 1.7 KB
Line 
1package geniusweb.protocol;
2
3import com.fasterxml.jackson.annotation.JsonAutoDetect;
4import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
5import com.fasterxml.jackson.annotation.JsonSubTypes;
6import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
7import com.fasterxml.jackson.annotation.JsonTypeInfo;
8
9import geniusweb.protocol.session.SessionState;
10import geniusweb.protocol.tournament.TournamentState;
11
12/**
13 * The current state of the session/tournament. Must be (de)serializabl;e so
14 * that it can be restarted if a crash occurs. Notice that this restart
15 * functionality is not yet available.
16 * <p>
17 * In general the state contains all the information to control the flow of the
18 * negotiation: who did what, are we finished, etc. This object may be stored to
19 * record the final result as well
20 */
21@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
22@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
23@JsonSubTypes({ @Type(value = SessionState.class),
24 @Type(value = TournamentState.class) })
25public interface NegoState {
26
27 /**
28 * @return the settings that were used to create this Nego
29 */
30 NegoSettings getSettings();
31
32 /**
33 * @param currentTimeMs the current time in ms since 1970, see
34 * {@link System#currentTimeMillis()}
35 * @return true iff this is the final state. A state can be final because
36 * the protocol decided so, eg a deal was achieved, the deadline was
37 * reached or someone made a protocol error. If true, no more state
38 * changes can occur, including no more protocol errors.
39 */
40 boolean isFinal(long currentTimeMs);
41
42}
Note: See TracBrowser for help on using the repository browser.