This library is under development and no stable version has been released yet. The API can change at any moment.
- High performance: we take efficiency very seriously
- Full support to Matchbook REST API: all Matchbook powerful REST API is implemented in the SDK
- Session management: user sessions are managed automatically
- Configurable: we provide a number of configuration options to control the SDK behaviour at runtime
- Multi-platform: all Java 8+ versions are supported
You should update your pom.xml to pull SNAPSHOT version from Sonatype Release Repository (OSSRH).
<repositories>
<repository>
<id>oss.sonatype.org-snapshot</id>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
ClientConfig clientConfig = new ClientConfig.Builder("my-username".toCharArray(), "my-password".toCharArray()).build();
ConnectionManager connectionManager = new ConnectionManager.Builder(clientConfig).build();
new EventsClientRest(connectionManager).getEvents(new EventsRequest.Builder().build(),
new StreamObserver<Event>() {
@Override
public void onNext(Event event) {
// add your business logic here
}
@Override
public void onCompleted() {
// all messages successfully processed
}
@Override
public <E extends MatchbookSDKException> void onError(E error) {
// handle error
}
});
OfferPostRequest offerPostRequest = new OfferPostRequest.Builder(
1295512601550017L,
Side.BACK,
new BigDecimal("2.5"),
new BigDecimal("100")
).build();
List<OfferPostRequest> offers = new ArrayList();
offers.add(offerPostRequest);
OffersPostRequest offersPostRequest = new OffersPostRequest.Builder(
OddsType.DECIMAL,
ExchangeType.BACK_LAY,
offers
).build();
new OffersClientRest(connectionManager).submitOffers(offersPostRequest,
new StreamObserver<Offer>() {
@Override
public void onNext(Offer offer) {
// add your business logic here
}
@Override
public void onCompleted() {
// all messages successfully processed
}
@Override
public <E extends MatchbookSDKException> void onError(E error) {
// handle error
}
});
new OffersClientRest(connectionManager).cancelOffer(new OfferDeleteRequest.Builder(1000L).build(),
new StreamObserver<Offer>() {
@Override
public void onNext(Offer offer) {
// add your business logic here
}
@Override
public void onCompleted() {
// all messages successfully processed
}
@Override
public <E extends MatchbookSDKException> void onError(E error) {
// handle error
}
});
- okhttp - An efficient HTTP client
- jackson - JSON serialisation/deserialisation
- slf4j - Logging facade for Java
- maven - Dependency management system
Please, read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests to us.
Please, use our custom Code Style when contribute to the MB-SDK project.
Spotted an error? Something doesn't make sense? Send a pull request! Please avoid making stylistic changes, though. They are unlikely to be accepted. Thanks!
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.