Class RpcRequestHelper
java.lang.Object
net.bjmsw.hda.vs.buchmacher.helper.RpcRequestHelper
The RpcRequestHelper class provides static methods for making RPC requests to a Buchmacher service.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDeletes a specific Wettangebot.Retrieves all Buchmacher and their Spiele.static List<BuchmacherOuterClass.Spiel> getAllSpiele(BuchmacherGrpc.BuchmacherBlockingStub stub, String token) Retrieves all spiele (games) from the Buchmacher service.static List<BuchmacherOuterClass.Wettangebot> getAllWettAngeboteForSpiel(long spielID, BuchmacherGrpc.BuchmacherBlockingStub stub, String token) Returns a list of wettangebote (bet offers) for a given spiel (game) ID.static doublegetQuoteForSelectedTeam(BuchmacherOuterClass.Wette wette, int team) Returns the quote for the selected team in a given bet.static List<BuchmacherOuterClass.Wettangebot> getWettangeboteForBuchmacher(long buchmacherId, BuchmacherGrpc.BuchmacherBlockingStub stub, String token) Retrieves a list of betting offers for a given bookmaker.static List<BuchmacherOuterClass.Wette> getWettenForBuchmacher(long buchmacherId, BuchmacherGrpc.BuchmacherBlockingStub stub, String token) Retrieves the wetten (bets) associated with a specific buchmacher (bookmaker).
-
Constructor Details
-
RpcRequestHelper
public RpcRequestHelper()
-
-
Method Details
-
getAllWettAngeboteForSpiel
public static List<BuchmacherOuterClass.Wettangebot> getAllWettAngeboteForSpiel(long spielID, BuchmacherGrpc.BuchmacherBlockingStub stub, String token) Returns a list of wettangebote (bet offers) for a given spiel (game) ID.- Parameters:
spielID- The ID of the spiel for which to retrieve the wettangebote.stub- The gRPC blocking stub for communication with the buchmacher (bookmaker) service.token- The token for authentication and authorization.- Returns:
- A list of wettangebote (bet offers) for the specified spiel (game) ID.
-
getWettenForBuchmacher
public static List<BuchmacherOuterClass.Wette> getWettenForBuchmacher(long buchmacherId, BuchmacherGrpc.BuchmacherBlockingStub stub, String token) Retrieves the wetten (bets) associated with a specific buchmacher (bookmaker).- Parameters:
buchmacherId- the ID of the buchmacherstub- the gRPC stub used to make the requesttoken- the token for authentication- Returns:
- a list of BuchmacherOuterClass.Wette objects representing the wetten (bets) for the given buchmacher (bookmaker)
-
getWettangeboteForBuchmacher
public static List<BuchmacherOuterClass.Wettangebot> getWettangeboteForBuchmacher(long buchmacherId, BuchmacherGrpc.BuchmacherBlockingStub stub, String token) Retrieves a list of betting offers for a given bookmaker.- Parameters:
buchmacherId- The ID of the bookmaker.stub- The gRPC blocking stub used to communicate with the bookmaker service.token- The token to authenticate the request.- Returns:
- A list of betting offers for the specified bookmaker.
-
getAllBuchmacherAndTheirSpiele
public static List<BuchmacherOuterClass.BuchmacherSpiele> getAllBuchmacherAndTheirSpiele(BuchmacherGrpc.BuchmacherBlockingStub stub, String token) Retrieves all Buchmacher and their Spiele.- Parameters:
stub- The BuchmacherBlockingStub object for making gRPC calls.token- The authentication token for authorizing the request.- Returns:
- A list of BuchmacherSpiele objects representing the Spiele associated with each Buchmacher.
-
getAllSpiele
public static List<BuchmacherOuterClass.Spiel> getAllSpiele(BuchmacherGrpc.BuchmacherBlockingStub stub, String token) Retrieves all spiele (games) from the Buchmacher service.- Parameters:
stub- the gRPC stub used to communicate with the Buchmacher servicetoken- the authentication token- Returns:
- a list of spiele (games)
-
getQuoteForSelectedTeam
Returns the quote for the selected team in a given bet.- Parameters:
wette- The bet containing the quotes for each team.team- The selected team (0, 1, or 2).- Returns:
- The quote for the selected team.
-
deleteWettangebot
Deletes a specific Wettangebot.- Parameters:
wa- the Wettangebot to be deleted
-