[100] | 1 | from abc import abstractmethod, ABC
|
---|
| 2 |
|
---|
| 3 | from pyson.JsonSubTypes import JsonSubTypes
|
---|
| 4 | from pyson.JsonTypeInfo import Id, As
|
---|
| 5 | from pyson.JsonTypeInfo import JsonTypeInfo
|
---|
| 6 |
|
---|
| 7 | @JsonSubTypes([ "geniusweb.events.ActionEvent.ActionEvent",
|
---|
| 8 | "geniusweb.events.SessionStarted.SessionStarted",
|
---|
| 9 | "geniusweb.events.TournamentStarted.TournamentStarted"])
|
---|
| 10 | @JsonTypeInfo(use=Id.NAME, include=As.WRAPPER_OBJECT)
|
---|
| 11 | class NegotiationEvent (ABC):
|
---|
| 12 | '''
|
---|
| 13 | reports some event happened in the negotiation system. Generally, parties are
|
---|
| 14 | informed about events in the system, but this depends on the protocol.
|
---|
| 15 | '''
|
---|
| 16 | @abstractmethod
|
---|
| 17 | def getTime(self)->int:
|
---|
| 18 | '''
|
---|
| 19 | @return the time at which the event happened on the server, measured in
|
---|
| 20 | milliseconds, between the start time and midnight, January 1,
|
---|
| 21 | 1970 UTCas. See also {@link System#currentTimeMillis()}. <br>
|
---|
| 22 |
|
---|
| 23 | If the event is about an {@link Action} done by a negotiation
|
---|
| 24 | party on another machine, this time refers to the time the action
|
---|
| 25 | was handled on the server (which may differ from the clock time
|
---|
| 26 | on the other machine). <br>
|
---|
| 27 |
|
---|
| 28 | Note: we do not use RFC 3339 because we need millisecond
|
---|
| 29 | accuracy.
|
---|
| 30 | '''
|
---|