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 ofMatch
in the database.void
deleteMatch
(String profileId, String matchId) Returns the defaultMatchmaker
instance.getMatchesForPlayer
(String playerId, int offset, int count) Fetches allMatch
instances with the given profile ID, and match ID.getMatchesForPlayer
(String playerId, int offset, int count, String search) Fetches allMatch
instances with the given profile ID, and match ID.getMatchForPlayer
(String playerId, String matchId) Fetches aMatch
with the given profile ID, and match ID.
-
Method Details
-
getMatchForPlayer
Fetches aMatch
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()
matchId
- the mach id as determined byMatch.getId()
- Returns:
- the
Match
, never null - Throws:
NotFoundException
- if the match is not found.
-
getMatchesForPlayer
Fetches allMatch
instances 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 allMatch
instances 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 filterMatch
instances- Returns:
- the
Match
, never null - Throws:
NotFoundException
- if the match is not found.
-
createMatch
Crates an instance ofMatch
in the database. Note that this does not -
getDefaultMatchmaker
Matchmaker getDefaultMatchmaker()Returns the defaultMatchmaker
instance.- Returns:
- a
Matchmaker
- Throws:
NotImplementedException
- if the supplied algorithm is not supported.
-
deleteMatch
Delets aMatch
, specyifying the id of theMatch
. Note that aMatch
may not be deleted if it is already matched to an opponent.- Parameters:
profileId
- the id of theProfile
as determined byProfile.getId()
matchId
- the id of theMatch
, specified byMatch.getId()
-