Skip to content

Releases: exaroton/java-exaroton-api

2.2.2-SNAPSHOT

12 May 11:48
2.2.2-SNAPSHOT
106a18a
Compare
Choose a tag to compare

Build System

  • Migrate to new Maven Central publishing system.

2.2.2

12 May 12:16
2.2.2
75289e9
Compare
Choose a tag to compare

Build System

  • Migrate to new Maven Central publishing system.

2.2.1

12 Mar 11:38
2.2.1
3d9fafd
Compare
Choose a tag to compare

2.2.1

Added

  • CreditPool#getClient()

Fixed

  • Objects returned by ExarotonClient#getServers and ExarotonClient#getCreditPools are now correctly initialized

2.2.0

Added

  • Server#getSocketAddress() which returns an InetSocketAddress 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 to ServerFile#get
  • Removed ExarotonClient#getGson() and WebsocketClient#getGson()
  • Removed Server#setClient and CreditPool#setClient
  • Removed ExarotonClient#getBaseUrl() and ExarotonClient#createConnection(String, String)
  • Many classes are now final
  • Added ApiStatus annotations to many classes and methods
  • Removed ExarotonClient#getApiToken()
  • ExarotonClient#setProtocol and ExarotonClient#getProtocol have been removed as HTTP is not supported by the API

Improvements

  • Update dependencies
  • Make jetbrains annotations compile only

2.2.0

11 Mar 16:05
2.2.0
9f95639
Compare
Choose a tag to compare

2.2.0

Added

  • Server#getSocketAddress() which returns an InetSocketAddress 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 to ServerFile#get
  • Removed ExarotonClient#getGson() and WebsocketClient#getGson()
  • Removed Server#setClient and CreditPool#setClient
  • Removed ExarotonClient#getBaseUrl() and ExarotonClient#createConnection(String, String)
  • Many classes are now final
  • Added ApiStatus annotations to many classes and methods
  • Removed ExarotonClient#getApiToken()
  • ExarotonClient#setProtocol and ExarotonClient#getProtocol have been removed as HTTP is not supported by the API

Improvements

  • Update dependencies
  • Make jetbrains annotations compile only

2.1.0

11 Mar 13:23
2.1.0
c3ee4b3
Compare
Choose a tag to compare

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 to ServerFile#get
  • Removed ExarotonClient#getGson() and WebsocketClient#getGson()
  • Removed Server#setClient and CreditPool#setClient
  • Removed ExarotonClient#getBaseUrl() and ExarotonClient#createConnection(String, String)
  • Many classes are now final
  • Added ApiStatus annotations to many classes and methods
  • Removed ExarotonClient#getApiToken()
  • ExarotonClient#setProtocol and ExarotonClient#getProtocol have been removed as HTTP is not supported by the API

Improvements

  • Update dependencies
  • Make jetbrains annotations compile only

2.0.0

11 Mar 12:22
2.0.0
1f18bb6
Compare
Choose a tag to compare

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 to ServerFile#get
  • Removed ExarotonClient#getGson() and WebsocketClient#getGson()
  • Removed Server#setClient and CreditPool#setClient
  • Removed ExarotonClient#getBaseUrl() and ExarotonClient#createConnection(String, String)
  • Many classes are now final
  • Added ApiStatus annotations to many classes and methods
  • Removed ExarotonClient#getApiToken()
  • ExarotonClient#setProtocol and ExarotonClient#getProtocol have been removed as HTTP is not supported by the API

Improvements

  • Update dependencies
  • Make jetbrains annotations compile only

1.6.2

09 Jan 15:24
1.6.2
02fa658
Compare
Choose a tag to compare

Remove v from version number

v1.6.1

23 Sep 12:45
v1.6.1
077dbf1
Compare
Choose a tag to compare
  • Add endpoints for the server config
  • Add endpoints for credit pools

v1.6.0

06 Dec 14:03
v1.6.0
0d3293d
Compare
Choose a tag to compare
  • Add endpoints for the server config
  • Add endpoints for credit pools

v1.5.2

06 May 16:28
v1.5.2
16510d1
Compare
Choose a tag to compare
  • Add option to use own credits to Server.start()
  • Use JSON body instead of form data
  • Update dependencies