1 | package geniusweb.protocol.session;
|
---|
2 |
|
---|
3 | import java.util.List;
|
---|
4 |
|
---|
5 | import com.fasterxml.jackson.annotation.JsonSubTypes;
|
---|
6 |
|
---|
7 | import geniusweb.protocol.NegoSettings;
|
---|
8 | import geniusweb.protocol.session.amop.AMOPSettings;
|
---|
9 | import geniusweb.protocol.session.learn.LearnSettings;
|
---|
10 | import geniusweb.protocol.session.mopac.MOPACSettings;
|
---|
11 | import geniusweb.protocol.session.mopac2.MOPAC2Settings;
|
---|
12 | import geniusweb.protocol.session.saop.SAOPSettings;
|
---|
13 | import geniusweb.protocol.session.shaop.SHAOPSettings;
|
---|
14 | import geniusweb.references.PartyWithProfile;
|
---|
15 | import tudelft.utilities.logging.Reporter;
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * interface for settings for session protocols. Immutable.
|
---|
19 | */
|
---|
20 | @JsonSubTypes({ @JsonSubTypes.Type(value = SAOPSettings.class),
|
---|
21 | @JsonSubTypes.Type(value = SHAOPSettings.class),
|
---|
22 | @JsonSubTypes.Type(value = AMOPSettings.class),
|
---|
23 | @JsonSubTypes.Type(value = MOPACSettings.class),
|
---|
24 | @JsonSubTypes.Type(value = MOPAC2Settings.class),
|
---|
25 | @JsonSubTypes.Type(value = LearnSettings.class) })
|
---|
26 | public interface SessionSettings extends NegoSettings {
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * Get the {@link TeamInfo}s.
|
---|
30 | *
|
---|
31 | * @return list of {@link PartyWithProfile} items.
|
---|
32 | */
|
---|
33 | List<TeamInfo> getTeams();
|
---|
34 |
|
---|
35 | /**
|
---|
36 | * @return the size of each {@link TeamInfo}. Usually 1 (SAOP etc) or
|
---|
37 | * sometimes 2 (SHAOP). Used eg by tournament runner to determine
|
---|
38 | * proper team construction.
|
---|
39 | */
|
---|
40 | Integer getTeamSize();
|
---|
41 |
|
---|
42 | /**
|
---|
43 | * Allows modification of SessionSettings to include a party. This is needed
|
---|
44 | * for tournament auto-configuration of sessions.
|
---|
45 | *
|
---|
46 | * @param partyprofteam the {@link TeamInfo} to be added
|
---|
47 | * @return new modified SessionSettings object
|
---|
48 | */
|
---|
49 | SessionSettings with(TeamInfo partyprofteam);
|
---|
50 |
|
---|
51 | /**
|
---|
52 | *
|
---|
53 | * @return all parties from all teams, as a flattened ordered list. The
|
---|
54 | * order : start with all parties from team 1, then all from team 2,
|
---|
55 | * etc. The specific order of the parties from a team depends on the
|
---|
56 | * protocol.
|
---|
57 | */
|
---|
58 | List<PartyWithProfile> getAllParties();
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * @param logger the logger where the protocol can log events to.
|
---|
62 | * @return the an initialized and ready to use {@link SessionProtocol} that
|
---|
63 | * can handle this Negotiation.
|
---|
64 | */
|
---|
65 | @Override
|
---|
66 | SessionProtocol getProtocol(Reporter logger);
|
---|
67 |
|
---|
68 | }
|
---|