Releases: exaroton/java-exaroton-api
2.2.2-SNAPSHOT
Build System
- Migrate to new Maven Central publishing system.
2.2.2
2.2.1
2.2.1
Added
CreditPool#getClient()
Fixed
- Objects returned by
ExarotonClient#getServers
andExarotonClient#getCreditPools
are now correctly initialized
2.2.0
Added
Server#getSocketAddress()
which returns anInetSocketAddress
of the server's IP and port if the server is online
2.1.0
Added
ServerConfig#setOptions(Collection<ConfigOption<?>>)
ServerConfig#setOptions(Map<String, ConfigOption<?>>)
2.0.0
Breaking Changes
Java 11
This library now requires Java 11 or higher.
Async API
All methods that make requests to the Exaroton API are now asynchronous. This means that all methods that return a value
now return a CompletableFuture
instead. To get the result of the request you can use CompletableFuture#get()
or
CompletableFuture#join()
.
This also changes where exceptions are thrown. Now the following rules apply:
- IOExceptions are thrown directly by the API methods
- APIExceptions cause the CompletableFuture to complete exceptionally
If you use join()
or get()
a CompletionException
containing the APIException
will be thrown.
Fetch methods
Many objects can be obtained from the API client without fetching their data (e.g. Server, CreditPool, ServerFile, ...).
The method to fetch their data has been renamed from get
to fetch
. It now also offers an override with a boolean
parameter that can be used to only fetch the object once server.fetch(false)
.
ServerStatus
The ServerStatus
class is now an enum instead of a class with static int
fields. Each status has a numeric
value (getValue
), a display name (getName
) and a brand color (getColor
).
If a status code is unknown because the API client has not been updated OFFLINE
will be returned.
SLF4J Implementation
This library no longer depends directly on any SLF4J implementation. If you want to see log messages
from this library, you must include an SLF4J implementation in your project.
API Requests
Request Bodies
ApiRequest#getBody()
and ApiRequest#getInputStream()
have been replaced by ApiRequest#getBodyPublisher()
. For a
JSON body you can use ApiRequest#jsonBodyPublisher(Object)
. This only affects users who extended the request classes.
PutFileDataRequest
's constructor has been changed to accept a Supplier<InputStream>
instead of an InputStream
.
Request Methods
ApiRequest#requestRaw()
, ApiRequest#requestString()
and ApiRequest#request()
have been replaced by
ExarotonClient#request(ApiRequest, HttpResponse.BodyHandler)
use the respective body handlers to get an input stream,
string or object.
WebSockets
The java-websocket
library has been replaced by the built-in Java 11 websocket implementation. Websocket connections
are now automatically created when a subscriber is registered and closed when the last subscriber is removed. Manually
closing a connection using Server#unsubscribe()
is still supported. This method does not throw an exception if there
is no connection to close.
The debug/error handler methods have been removed. Errors and debug messages are now exclusively logged using SLF4J
Subscribers
The Subscriber
classes are now interfaces and their methods have been renamed to make the more explicit and reduce
the chance of conflicts with other overrides.
Other
- Arrays have been Replaced by Collection's in almost all places
- Nullable return types have been replaced by Optional's
- Public final properties have been replaced by getters
- Config options now return a generic type instead of
Object
- Renamed
ServerFile#getInfo
toServerFile#get
- Removed
ExarotonClient#getGson()
andWebsocketClient#getGson()
- Removed
Server#setClient
andCreditPool#setClient
- Removed
ExarotonClient#getBaseUrl()
andExarotonClient#createConnection(String, String)
- Many classes are now final
- Added
ApiStatus
annotations to many classes and methods - Removed
ExarotonClient#getApiToken()
ExarotonClient#setProtocol
andExarotonClient#getProtocol
have been removed as HTTP is not supported by the API
Improvements
- Update dependencies
- Make jetbrains annotations compile only
2.2.0
2.2.0
Added
Server#getSocketAddress()
which returns anInetSocketAddress
of the server's IP and port if the server is online
2.1.0
Added
ServerConfig#setOptions(Collection<ConfigOption<?>>)
ServerConfig#setOptions(Map<String, ConfigOption<?>>)
2.0.0
Breaking Changes
Java 11
This library now requires Java 11 or higher.
Async API
All methods that make requests to the Exaroton API are now asynchronous. This means that all methods that return a value
now return a CompletableFuture
instead. To get the result of the request you can use CompletableFuture#get()
or
CompletableFuture#join()
.
This also changes where exceptions are thrown. Now the following rules apply:
- IOExceptions are thrown directly by the API methods
- APIExceptions cause the CompletableFuture to complete exceptionally
If you use join()
or get()
a CompletionException
containing the APIException
will be thrown.
Fetch methods
Many objects can be obtained from the API client without fetching their data (e.g. Server, CreditPool, ServerFile, ...).
The method to fetch their data has been renamed from get
to fetch
. It now also offers an override with a boolean
parameter that can be used to only fetch the object once server.fetch(false)
.
ServerStatus
The ServerStatus
class is now an enum instead of a class with static int
fields. Each status has a numeric
value (getValue
), a display name (getName
) and a brand color (getColor
).
If a status code is unknown because the API client has not been updated OFFLINE
will be returned.
SLF4J Implementation
This library no longer depends directly on any SLF4J implementation. If you want to see log messages
from this library, you must include an SLF4J implementation in your project.
API Requests
Request Bodies
ApiRequest#getBody()
and ApiRequest#getInputStream()
have been replaced by ApiRequest#getBodyPublisher()
. For a
JSON body you can use ApiRequest#jsonBodyPublisher(Object)
. This only affects users who extended the request classes.
PutFileDataRequest
's constructor has been changed to accept a Supplier<InputStream>
instead of an InputStream
.
Request Methods
ApiRequest#requestRaw()
, ApiRequest#requestString()
and ApiRequest#request()
have been replaced by
ExarotonClient#request(ApiRequest, HttpResponse.BodyHandler)
use the respective body handlers to get an input stream,
string or object.
WebSockets
The java-websocket
library has been replaced by the built-in Java 11 websocket implementation. Websocket connections
are now automatically created when a subscriber is registered and closed when the last subscriber is removed. Manually
closing a connection using Server#unsubscribe()
is still supported. This method does not throw an exception if there
is no connection to close.
The debug/error handler methods have been removed. Errors and debug messages are now exclusively logged using SLF4J
Subscribers
The Subscriber
classes are now interfaces and their methods have been renamed to make the more explicit and reduce
the chance of conflicts with other overrides.
Other
- Arrays have been Replaced by Collection's in almost all places
- Nullable return types have been replaced by Optional's
- Public final properties have been replaced by getters
- Config options now return a generic type instead of
Object
- Renamed
ServerFile#getInfo
toServerFile#get
- Removed
ExarotonClient#getGson()
andWebsocketClient#getGson()
- Removed
Server#setClient
andCreditPool#setClient
- Removed
ExarotonClient#getBaseUrl()
andExarotonClient#createConnection(String, String)
- Many classes are now final
- Added
ApiStatus
annotations to many classes and methods - Removed
ExarotonClient#getApiToken()
ExarotonClient#setProtocol
andExarotonClient#getProtocol
have been removed as HTTP is not supported by the API
Improvements
- Update dependencies
- Make jetbrains annotations compile only
2.1.0
2.1.0
Added
ServerConfig#setOptions(Collection<ConfigOption<?>>)
ServerConfig#setOptions(Map<String, ConfigOption<?>>)
2.0.0
Breaking Changes
Java 11
This library now requires Java 11 or higher.
Async API
All methods that make requests to the Exaroton API are now asynchronous. This means that all methods that return a value
now return a CompletableFuture
instead. To get the result of the request you can use CompletableFuture#get()
or
CompletableFuture#join()
.
This also changes where exceptions are thrown. Now the following rules apply:
- IOExceptions are thrown directly by the API methods
- APIExceptions cause the CompletableFuture to complete exceptionally
If you use join()
or get()
a CompletionException
containing the APIException
will be thrown.
Fetch methods
Many objects can be obtained from the API client without fetching their data (e.g. Server, CreditPool, ServerFile, ...).
The method to fetch their data has been renamed from get
to fetch
. It now also offers an override with a boolean
parameter that can be used to only fetch the object once server.fetch(false)
.
ServerStatus
The ServerStatus
class is now an enum instead of a class with static int
fields. Each status has a numeric
value (getValue
), a display name (getName
) and a brand color (getColor
).
If a status code is unknown because the API client has not been updated OFFLINE
will be returned.
SLF4J Implementation
This library no longer depends directly on any SLF4J implementation. If you want to see log messages
from this library, you must include an SLF4J implementation in your project.
API Requests
Request Bodies
ApiRequest#getBody()
and ApiRequest#getInputStream()
have been replaced by ApiRequest#getBodyPublisher()
. For a
JSON body you can use ApiRequest#jsonBodyPublisher(Object)
. This only affects users who extended the request classes.
PutFileDataRequest
's constructor has been changed to accept a Supplier<InputStream>
instead of an InputStream
.
Request Methods
ApiRequest#requestRaw()
, ApiRequest#requestString()
and ApiRequest#request()
have been replaced by
ExarotonClient#request(ApiRequest, HttpResponse.BodyHandler)
use the respective body handlers to get an input stream,
string or object.
WebSockets
The java-websocket
library has been replaced by the built-in Java 11 websocket implementation. Websocket connections
are now automatically created when a subscriber is registered and closed when the last subscriber is removed. Manually
closing a connection using Server#unsubscribe()
is still supported. This method does not throw an exception if there
is no connection to close.
The debug/error handler methods have been removed. Errors and debug messages are now exclusively logged using SLF4J
Subscribers
The Subscriber
classes are now interfaces and their methods have been renamed to make the more explicit and reduce
the chance of conflicts with other overrides.
Other
- Arrays have been Replaced by Collection's in almost all places
- Nullable return types have been replaced by Optional's
- Public final properties have been replaced by getters
- Config options now return a generic type instead of
Object
- Renamed
ServerFile#getInfo
toServerFile#get
- Removed
ExarotonClient#getGson()
andWebsocketClient#getGson()
- Removed
Server#setClient
andCreditPool#setClient
- Removed
ExarotonClient#getBaseUrl()
andExarotonClient#createConnection(String, String)
- Many classes are now final
- Added
ApiStatus
annotations to many classes and methods - Removed
ExarotonClient#getApiToken()
ExarotonClient#setProtocol
andExarotonClient#getProtocol
have been removed as HTTP is not supported by the API
Improvements
- Update dependencies
- Make jetbrains annotations compile only
2.0.0
Breaking Changes
Java 11
This library now requires Java 11 or higher.
Async API
All methods that make requests to the Exaroton API are now asynchronous. This means that all methods that return a value
now return a CompletableFuture
instead. To get the result of the request you can use CompletableFuture#get()
or
CompletableFuture#join()
.
This also changes where exceptions are thrown. Now the following rules apply:
- IOExceptions are thrown directly by the API methods
- APIExceptions cause the CompletableFuture to complete exceptionally
If you use join()
or get()
a CompletionException
containing the APIException
will be thrown.
Fetch methods
Many objects can be obtained from the API client without fetching their data (e.g. Server, CreditPool, ServerFile, ...).
The method to fetch their data has been renamed from get
to fetch
. It now also offers an override with a boolean
parameter that can be used to only fetch the object once server.fetch(false)
.
ServerStatus
The ServerStatus
class is now an enum instead of a class with static int
fields. Each status has a numeric
value (getValue
), a display name (getName
) and a brand color (getColor
).
If a status code is unknown because the API client has not been updated OFFLINE
will be returned.
SLF4J Implementation
This library no longer depends directly on any SLF4J implementation. If you want to see log messages
from this library, you must include an SLF4J implementation in your project.
API Requests
Request Bodies
ApiRequest#getBody()
and ApiRequest#getInputStream()
have been replaced by ApiRequest#getBodyPublisher()
. For a
JSON body you can use ApiRequest#jsonBodyPublisher(Object)
. This only affects users who extended the request classes.
PutFileDataRequest
's constructor has been changed to accept a Supplier<InputStream>
instead of an InputStream
.
Request Methods
ApiRequest#requestRaw()
, ApiRequest#requestString()
and ApiRequest#request()
have been replaced by
ExarotonClient#request(ApiRequest, HttpResponse.BodyHandler)
use the respective body handlers to get an input stream,
string or object.
WebSockets
The java-websocket
library has been replaced by the built-in Java 11 websocket implementation. Websocket connections
are now automatically created when a subscriber is registered and closed when the last subscriber is removed. Manually
closing a connection using Server#unsubscribe()
is still supported. This method does not throw an exception if there
is no connection to close.
The debug/error handler methods have been removed. Errors and debug messages are now exclusively logged using SLF4J
Subscribers
The Subscriber
classes are now interfaces and their methods have been renamed to make the more explicit and reduce
the chance of conflicts with other overrides.
Other
- Arrays have been Replaced by Collection's in almost all places
- Nullable return types have been replaced by Optional's
- Public final properties have been replaced by getters
- Config options now return a generic type instead of
Object
- Renamed
ServerFile#getInfo
toServerFile#get
- Removed
ExarotonClient#getGson()
andWebsocketClient#getGson()
- Removed
Server#setClient
andCreditPool#setClient
- Removed
ExarotonClient#getBaseUrl()
andExarotonClient#createConnection(String, String)
- Many classes are now final
- Added
ApiStatus
annotations to many classes and methods - Removed
ExarotonClient#getApiToken()
ExarotonClient#setProtocol
andExarotonClient#getProtocol
have been removed as HTTP is not supported by the API
Improvements
- Update dependencies
- Make jetbrains annotations compile only
1.6.2
Remove v from version number
v1.6.1
- Add endpoints for the server config
- Add endpoints for credit pools
v1.6.0
- Add endpoints for the server config
- Add endpoints for credit pools
v1.5.2
- Add option to use own credits to Server.start()
- Use JSON body instead of form data
- Update dependencies