1 | package geniusweb.events;
|
---|
2 |
|
---|
3 | import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
---|
4 | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
|
---|
5 | import com.fasterxml.jackson.annotation.JsonSubTypes;
|
---|
6 | import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
---|
7 | import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
---|
8 |
|
---|
9 | import geniusweb.actions.Action;
|
---|
10 |
|
---|
11 | /**
|
---|
12 | * reports some event happened in the negotiation system. Generally, parties are
|
---|
13 | * informed about events in the system, but this depends on the protocol.
|
---|
14 | *
|
---|
15 | */
|
---|
16 | @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE)
|
---|
17 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = As.WRAPPER_OBJECT)
|
---|
18 | @JsonSubTypes({ @JsonSubTypes.Type(value = ActionEvent.class),
|
---|
19 | @JsonSubTypes.Type(value = SessionStarted.class),
|
---|
20 | @JsonSubTypes.Type(value = TournamentStarted.class) })
|
---|
21 | public interface NegotiationEvent {
|
---|
22 | /**
|
---|
23 | * @return the time at which the event happened on the server, measured in
|
---|
24 | * milliseconds, between the start time and midnight, January 1,
|
---|
25 | * 1970 UTCas. See also {@link System#currentTimeMillis()}. <br>
|
---|
26 | *
|
---|
27 | * If the event is about an {@link Action} done by a negotiation
|
---|
28 | * party on another machine, this time refers to the time the action
|
---|
29 | * was handled on the server (which may differ from the clock time
|
---|
30 | * on the other machine). <br>
|
---|
31 | *
|
---|
32 | * Note: we do not use RFC 3339 because we need millisecond
|
---|
33 | * accuracy.
|
---|
34 | */
|
---|
35 | Long getTime();
|
---|
36 |
|
---|
37 | }
|
---|