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 newProfile
to theMultiMatch
.createMultiMatch
(MultiMatch multiMatch) Creates a newMultiMatch
with no players.default void
deleteMultiMatch
(String multiMatchId) Deletes theMultiMatch
with the given ID, throwing an exception if it does not exist.default void
expireMultiMatch
(String multiMatchId) Expires aMultiMatch
by its ID, setting its status to expired flagging it for removal at a later date.findMultiMatch
(String multiMatchId) Finds aMultiMatch
by its ID.default List
<MultiMatch> Gets allMultiMatch
instances.getAllMultiMatches
(String query) Gets allMultiMatch
instances.default MultiMatch
getMultiMatch
(String multiMatchId) Gets aMultiMatch
by its ID.getProfiles
(String multiMatchId) Gets allProfile
instances in theMultiMatch
.removeProfile
(String multiMatchId, Profile profile) Removes theProfile
to theMultiMatch
.boolean
tryDeleteMultiMatch
(String multiMatchId) Deletes theMultiMatch
with the given ID, returning true if it was deleted, false if it did not exist.boolean
tryExpireMultiMatch
(String multiMatchId) Expires aMultiMatch
by its ID, setting its status to expired flagging it for removal at a later date.updateMultiMatch
(MultiMatch configuration) Creates a newMultiMatch
with 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 allMultiMatch
instances.- Returns:
- a
List
ofMultiMatch
instances
-
getAllMultiMatches
Gets allMultiMatch
instances.- Parameters:
query
- the query to execute- Returns:
- a
List
ofMultiMatch
instances
-
findMultiMatch
Finds aMultiMatch
by 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 aMultiMatch
by its ID.- Parameters:
multiMatchId
- theMultiMatch
- Returns:
- the
MultiMatch
-
getProfiles
Gets allProfile
instances in theMultiMatch
.- Parameters:
multiMatchId
- tbe multi-match id to get profiles from- Returns:
- the
List
ofProfile
instances in theMultiMatch
- Throws:
MultiMatchNotFoundException
- if noMultiMatch
with the given ID exists
-
addProfile
Adds a newProfile
to theMultiMatch
.- Parameters:
multiMatchId
- the multi-match id receiving the profileprofile
- the profile to add- Returns:
- the updated
MultiMatch
-
removeProfile
Removes theProfile
to theMultiMatch
.- Parameters:
multiMatchId
- the multi-match id receiving the profileprofile
- the profile to add- Returns:
- the updated
MultiMatch
-
createMultiMatch
Creates a newMultiMatch
with no players.- Parameters:
multiMatch
- theMultiMatch
to create- Returns:
- the newly created
MultiMatch
-
updateMultiMatch
Creates a newMultiMatch
with no players.- Parameters:
configuration
- theMatchmakingApplicationConfiguration
to use- Returns:
- the newly created
MultiMatch
-
deleteMultiMatch
Deletes theMultiMatch
with the given ID, throwing an exception if it does not exist. -
tryDeleteMultiMatch
Deletes theMultiMatch
with the given ID, returning true if it was deleted, false if it did not exist. -
expireMultiMatch
Expires aMultiMatch
by 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 aMultiMatch
by 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.
-