Package dev.getelements.elements.sdk.dao
Interface MatchDao
- All Known Implementing Classes:
MongoMatchDao
public interface MatchDao
Created by patricktwohig on 7/20/17.
-
Method Summary
Modifier and TypeMethodDescriptioncreateMatch(Match match) Crates an instance ofMatchin the database.voiddeleteMatch(String profileId, String matchId) getMatchesForPlayer(String playerId, int offset, int count) Fetches allMatchinstances with the given profile ID, and match ID.getMatchesForPlayer(String playerId, int offset, int count, String search) Fetches allMatchinstances with the given profile ID, and match ID.getMatchForPlayer(String playerId, String matchId) Fetches aMatchwith the given profile ID, and match ID.getMatchmaker(MatchingAlgorithm matchingAlgorithm) Returns aMatchmakerinstance for the suppliedMatchingAlgorithm.
-
Method Details
-
getMatchForPlayer
Fetches aMatchwith the given profile ID, and match ID. If no such match is found, then this throws an instance ofNotFoundException.The profile ID is compared against the ID of
Match.getPlayer()- Parameters:
playerId- as specified by the value ofProfile.getId()ofMatch.getPlayer()matchId- the mach id as determined byMatch.getId()- Returns:
- the
Match, never null - Throws:
NotFoundException- if the match is not found.
-
getMatchesForPlayer
Fetches allMatchinstances with the given profile ID, and match ID. If no such match is found, then this throws an instance ofNotFoundException.The profile ID is compared against the ID of
Match.getPlayer()- Parameters:
playerId- as specified by the value ofProfile.getId()ofMatch.getPlayer()offset- the offsetcount- the count- Returns:
- the
Match, never null - Throws:
NotFoundException- if the match is not found.
-
getMatchesForPlayer
Fetches allMatchinstances with the given profile ID, and match ID. If no such match is found, then this throws an instance ofNotFoundException.The profile ID is compared against the ID of
Match.getPlayer()- Parameters:
playerId- as specified by the value ofProfile.getId()ofMatch.getPlayer()offset- the offsetcount- the countsearch- a search query to filterMatchinstances- Returns:
- the
Match, never null - Throws:
NotFoundException- if the match is not found.
-
createMatch
Crates an instance ofMatchin the database. Note that this does not -
getMatchmaker
Returns aMatchmakerinstance for the suppliedMatchingAlgorithm.- Parameters:
matchingAlgorithm- the requestedMatchingAlgorithm- Returns:
- a
Matchmaker - Throws:
NotImplementedException- if the supplied algorithm is not supported.
-
deleteMatch
Delets aMatch, specyifying the id of theMatch. Note that aMatchmay not be deleted if it is already matched to an opponent.- Parameters:
profileId- the id of theProfileas determined byProfile.getId()matchId- the id of theMatch, specified byMatch.getId()
-