Skip to content

ctlove0523/gotify-java-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gotify-java-client

gotify-java-client is sync client of Gotify which written in Java.gotify-java-client can be used in Java or Android application.

Building from Source

You don't need to build from source to use gotify-java-client (binaries in release page), but if you want to try out the latest and greatest, gotify-java-client can be easily built with the maven. You also need JDK 1.8.

gotify-java-client requires Java 8 or + to run.

$ git clone https://github.com/ctlove0523/gotify-java-client.git
$ cd gotify-java-client
$ mvn clean package

If you want to publish the artifacts to your local Maven repository use:

$ mvn clean install

Add gotify-java-client to your project dependencies like this:

<dependency>
	<groupId>io.github.ctlove0523.gotify</groupId>
	<artifactId>gotify-java-client</artifactId>
	<version>{version}</version>
</dependency>

Getting Started

New to Gotify? Check this Gotify and the Gotify API. Here is a very simple example about get applications from gotify server.

Credential credential=new BasicCredential.Builder()
		.userName("admin")
		.password("admin")
		.build();

GotifyClientConfig config=new GotifyClientConfig.Builder()
		.endpoint("http://localhost")
		.credential(credential)
		.build();

GotifyClient gotifyClient=GotifyClient.build(config);

MessageClient messageClient = gotifyClient.getMessageClient();
messageClient.registerMessageHandler(message -> System.out.println(message.getMessage()));

All public method return one Resutl<T,E> object,when method success isSuccessful()method return true otherwise return false and get use error() to get server error response. Usual usage like below:

Result<List<Application>, GotifyResponseError> result = appClient.getApplications();
if (result.isSuccessful()) {
	// do something
} else {
	// process error/IOException
}

Getting help

Having trouble with gotify-java-client? We'd like to help!

Reporting Issues

gotify-java-client uses GitHub’s integrated issue tracking system to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:

  • Before you log a bug, please search the issue tracker to see if someone has already reported the problem.
  • If the issue doesn't already exist, create a new issue.
  • Please provide as much information as possible with the issue report, we like to know the version of gotify-java-client that you are using, as well as your Operating System and JVM version.

License

gotify-java-client is Open Source Software released under the MIT License.