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 ofMatchin the database.voiddeleteMatch(String profileId, String matchId) dev.morphia.DatastoregetMatchesForPlayer(String playerId, int offset, int count) Fetches allMatchinstances with the given profile ID, and match ID.getMatchesForPlayer(String playerId, int offset, int count, String queryString) 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.getMongoMatch(String matchId) getMongoMatchForPlayer(String playerId, String matchId) voidsetDatastore(dev.morphia.Datastore datastore) voidsetDozerMapper(MapperRegistry dozerMapperRegistry) voidsetMatchmakerSupplierFunction(Matchmaker.Factory matchmakerSupplierFunction) voidsetMongoConcurrentUtils(MongoConcurrentUtils mongoConcurrentUtils) voidsetMongoDBUtils(MongoDBUtils mongoDBUtils) voidsetMongoMatchUtils(MongoMatchUtils mongoMatchUtils) voidsetMongoProfileDao(MongoProfileDao mongoProfileDao) voidsetValidationHelper(ValidationHelper validationHelper) void
-
Constructor Details
-
MongoMatchDao
public MongoMatchDao()
-
-
Method Details
-
getMatchForPlayer
Description copied from interface:MatchDaoFetches 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()- Specified by:
getMatchForPlayerin 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:MatchDaoFetches 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()- Specified by:
getMatchesForPlayerin 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:MatchDaoFetches 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()- Specified by:
getMatchesForPlayerin interfaceMatchDao- Parameters:
playerId- as specified by the value ofProfile.getId()ofMatch.getPlayer()offset- the offsetcount- the countqueryString- a search query to filterMatchinstances- Returns:
- the
Match, never null
-
createMatch
Description copied from interface:MatchDaoCrates an instance ofMatchin the database. Note that this does not- Specified by:
createMatchin interfaceMatchDao- Parameters:
match- theMatchto create- Returns:
- a
Matchas it was written to the database
-
deleteMatch
Description copied from interface:MatchDaoDelets aMatch, specyifying the id of theMatch. Note that aMatchmay not be deleted if it is already matched to an opponent.- Specified by:
deleteMatchin interfaceMatchDao- Parameters:
profileId- the id of theProfileas determined byProfile.getId()matchId- the id of theMatch, specified byMatch.getId()
-
getMatchmaker
Description copied from interface:MatchDaoReturns aMatchmakerinstance for the suppliedMatchingAlgorithm.- Specified by:
getMatchmakerin 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
-