Package dev.getelements.elements.sdk.dao
Interface MultiMatchDao
- All Known Implementing Classes:
MongoMultiMatchDao
public interface MultiMatchDao
Handles multi-matches, allowing multiple players to join or leave a match.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddProfile(String multiMatchId, Profile profile) Adds a newProfileto theMultiMatch.createMultiMatch(MultiMatch multiMatch) Creates a newMultiMatchwith no players.default voiddeleteMultiMatch(String multiMatchId) Deletes theMultiMatchwith the given ID, throwing an exception if it does not exist.default voidexpireMultiMatch(String multiMatchId) Expires aMultiMatchby its ID, setting its status to expired flagging it for removal at a later date.findMultiMatch(String multiMatchId) Finds aMultiMatchby its ID.default List<MultiMatch> Gets allMultiMatchinstances.getAllMultiMatches(String query) Gets allMultiMatchinstances.default MultiMatchgetMultiMatch(String multiMatchId) Gets aMultiMatchby its ID.getProfiles(String multiMatchId) Gets allProfileinstances in theMultiMatch.removeProfile(String multiMatchId, Profile profile) Removes theProfileto theMultiMatch.booleantryDeleteMultiMatch(String multiMatchId) Deletes theMultiMatchwith the given ID, returning true if it was deleted, false if it did not exist.booleantryExpireMultiMatch(String multiMatchId) Expires aMultiMatchby its ID, setting its status to expired flagging it for removal at a later date.updateMultiMatch(MultiMatch configuration) Creates a newMultiMatchwith no players.
-
Field Details
-
MULTI_MATCH_CREATED
- See Also:
-
MULTI_MATCH_ADD_PROFILE
- See Also:
-
MULTI_MATCH_REMOVE_PROFILE
- See Also:
-
MULTI_MATCH_UPDATED
- See Also:
-
MULTI_MATCH_EXPIRED
- See Also:
-
MULTI_MATCH_DELETED
- See Also:
-
-
Method Details
-
getAllMultiMatches
Gets allMultiMatchinstances.- Returns:
- a
ListofMultiMatchinstances
-
getAllMultiMatches
Gets allMultiMatchinstances.- Parameters:
query- the query to execute- Returns:
- a
ListofMultiMatchinstances
-
findMultiMatch
Finds aMultiMatchby its ID.- Parameters:
multiMatchId- the ID of the multi-match to find.- Returns:
- the found
MultiMatch, or an empty Optional if not found.
-
getMultiMatch
Gets aMultiMatchby its ID.- Parameters:
multiMatchId- theMultiMatch- Returns:
- the
MultiMatch
-
getProfiles
Gets allProfileinstances in theMultiMatch.- Parameters:
multiMatchId- tbe multi-match id to get profiles from- Returns:
- the
ListofProfileinstances in theMultiMatch - Throws:
MultiMatchNotFoundException- if noMultiMatchwith the given ID exists
-
addProfile
Adds a newProfileto theMultiMatch.- Parameters:
multiMatchId- the multi-match id receiving the profileprofile- the profile to add- Returns:
- the updated
MultiMatch
-
removeProfile
Removes theProfileto theMultiMatch.- Parameters:
multiMatchId- the multi-match id receiving the profileprofile- the profile to add- Returns:
- the updated
MultiMatch
-
createMultiMatch
Creates a newMultiMatchwith no players.- Parameters:
multiMatch- theMultiMatchto create- Returns:
- the newly created
MultiMatch
-
updateMultiMatch
Creates a newMultiMatchwith no players.- Parameters:
configuration- theMatchmakingApplicationConfigurationto use- Returns:
- the newly created
MultiMatch
-
deleteMultiMatch
Deletes theMultiMatchwith the given ID, throwing an exception if it does not exist. -
tryDeleteMultiMatch
Deletes theMultiMatchwith the given ID, returning true if it was deleted, false if it did not exist. -
expireMultiMatch
Expires aMultiMatchby its ID, setting its status to expired flagging it for removal at a later date.- Parameters:
multiMatchId- the ID of theMultiMatch- Throws:
MultiMatchNotFoundException- if the multi-match does not exist or is already expired.
-
tryExpireMultiMatch
Expires aMultiMatchby its ID, setting its status to expired flagging it for removal at a later date.- Parameters:
multiMatchId- the ID of theMultiMatch- Returns:
- true if the multi-match was expired, false if it did not exist or was already expired.
-