Class MongoMatchDao
java.lang.Object
dev.getelements.elements.dao.mongo.match.MongoMatchDao
- All Implemented Interfaces:
MatchDao
Created by patricktwohig on 7/25/17.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateMatch
(Match match) Crates an instance ofMatch
in the database.void
deleteMatch
(String profileId, String matchId) dev.morphia.Datastore
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 queryString) 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.getMatchmaker
(MatchingAlgorithm matchingAlgorithm) Returns aMatchmaker
instance for the suppliedMatchingAlgorithm
.getMongoMatch
(String matchId) getMongoMatchForPlayer
(String playerId, String matchId) void
setDatastore
(dev.morphia.Datastore datastore) void
setDozerMapper
(MapperRegistry dozerMapperRegistry) void
setMatchmakerSupplierFunction
(Matchmaker.Factory matchmakerSupplierFunction) void
setMongoConcurrentUtils
(MongoConcurrentUtils mongoConcurrentUtils) void
setMongoDBUtils
(MongoDBUtils mongoDBUtils) void
setMongoMatchUtils
(MongoMatchUtils mongoMatchUtils) void
setMongoProfileDao
(MongoProfileDao mongoProfileDao) void
setValidationHelper
(ValidationHelper validationHelper) void
-
Constructor Details
-
MongoMatchDao
public MongoMatchDao()
-
-
Method Details
-
getMatchForPlayer
Description copied from interface:MatchDao
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()
- Specified by:
getMatchForPlayer
in interfaceMatchDao
- 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.
-
getMongoMatchForPlayer
-
getMongoMatch
-
getMatchesForPlayer
Description copied from interface:MatchDao
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()
- Specified by:
getMatchesForPlayer
in interfaceMatchDao
- Parameters:
playerId
- as specified by the value ofProfile.getId()
ofMatch.getPlayer()
offset
- the offsetcount
- the count- Returns:
- the
Match
, never null
-
getMatchesForPlayer
public Pagination<Match> getMatchesForPlayer(String playerId, int offset, int count, String queryString) Description copied from interface:MatchDao
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()
- Specified by:
getMatchesForPlayer
in interfaceMatchDao
- Parameters:
playerId
- as specified by the value ofProfile.getId()
ofMatch.getPlayer()
offset
- the offsetcount
- the countqueryString
- a search query to filterMatch
instances- Returns:
- the
Match
, never null
-
createMatch
Description copied from interface:MatchDao
Crates an instance ofMatch
in the database. Note that this does not- Specified by:
createMatch
in interfaceMatchDao
- Parameters:
match
- theMatch
to create- Returns:
- a
Match
as it was written to the database
-
deleteMatch
Description copied from interface:MatchDao
Delets aMatch
, specyifying the id of theMatch
. Note that aMatch
may not be deleted if it is already matched to an opponent.- Specified by:
deleteMatch
in interfaceMatchDao
- Parameters:
profileId
- the id of theProfile
as determined byProfile.getId()
matchId
- the id of theMatch
, specified byMatch.getId()
-
getMatchmaker
Description copied from interface:MatchDao
Returns aMatchmaker
instance for the suppliedMatchingAlgorithm
.- Specified by:
getMatchmaker
in interfaceMatchDao
- Parameters:
matchingAlgorithm
- the requestedMatchingAlgorithm
- Returns:
- a
Matchmaker
-
validate
-
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
getDozerMapper
-
setDozerMapper
-
getMongoProfileDao
-
setMongoProfileDao
-
getMongoDBUtils
-
setMongoDBUtils
-
getValidationHelper
-
setValidationHelper
-
getMongoConcurrentUtils
-
setMongoConcurrentUtils
-
getMatchmakerSupplierFunction
-
setMatchmakerSupplierFunction
-
getMongoMatchUtils
-
setMongoMatchUtils
-