v2.3.0: Implemented caching to GET methods
This version implements caching for the different get methods (e.g. getBotlists(String)
).
This is used as a sort of ratelimit prevention as the requested data is kept in cache and used for 2 minutes before a new request is made.
Additional changes are:
getBotlists()
andgetBotlist(String|Site)
now have an additional String parameter used for the cache.
So the new methods aregetBotlists(String)
andgetBotlist(String, String|Site)
- The JSON used for post requests is no longer a single main field, making this version more thread save.
- You can disable the caching through the RequestHandler (Although it's not recommended).
- To do this just add the boolean
true
when making an instance of the RequestHandler.
Example:RequestHandler handler = new RequestHandler(true);
- This was suggested by @DavidRockin
- To do this just add the boolean
Installation
Gradle
repositories{
jcenter()
}
dependencies{
compile group: 'com.andre601', name: 'JavaBotBlockAPI', version: '2.3.0'
}
Maven
<repositories>
<repository>
<id>jcenter</id>
<url>https://dl.bintray.com/andre601/maven</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.andre601</groupId>
<artifactId>JavaBotBlockAPI</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>