package geniusweb.protocol.session; import java.util.List; import com.fasterxml.jackson.annotation.JsonSubTypes; import geniusweb.protocol.NegoSettings; import geniusweb.protocol.session.amop.AMOPSettings; import geniusweb.protocol.session.learn.LearnSettings; import geniusweb.protocol.session.mopac.MOPACSettings; import geniusweb.protocol.session.mopac2.MOPAC2Settings; import geniusweb.protocol.session.saop.SAOPSettings; import geniusweb.protocol.session.shaop.SHAOPSettings; import geniusweb.references.PartyWithProfile; import tudelft.utilities.logging.Reporter; /** * interface for settings for session protocols. Immutable. */ @JsonSubTypes({ @JsonSubTypes.Type(value = SAOPSettings.class), @JsonSubTypes.Type(value = SHAOPSettings.class), @JsonSubTypes.Type(value = AMOPSettings.class), @JsonSubTypes.Type(value = MOPACSettings.class), @JsonSubTypes.Type(value = MOPAC2Settings.class), @JsonSubTypes.Type(value = LearnSettings.class) }) public interface SessionSettings extends NegoSettings { /** * Get the {@link TeamInfo}s. * * @return list of {@link PartyWithProfile} items. */ List getTeams(); /** * @return the size of each {@link TeamInfo}. Usually 1 (SAOP etc) or * sometimes 2 (SHAOP). Used eg by tournament runner to determine * proper team construction. */ Integer getTeamSize(); /** * Allows modification of SessionSettings to include a party. This is needed * for tournament auto-configuration of sessions. * * @param partyprofteam the {@link TeamInfo} to be added * @return new modified SessionSettings object */ SessionSettings with(TeamInfo partyprofteam); /** * * @return all parties from all teams, as a flattened ordered list. The * order : start with all parties from team 1, then all from team 2, * etc. The specific order of the parties from a team depends on the * protocol. */ List getAllParties(); /** * @param logger the logger where the protocol can log events to. * @return the an initialized and ready to use {@link SessionProtocol} that * can handle this Negotiation. */ @Override SessionProtocol getProtocol(Reporter logger); }