Skip to content
This repository has been archived by the owner on Dec 6, 2017. It is now read-only.
/ eve-crest-java Public archive

Java library for Eve Online CREST

License

Notifications You must be signed in to change notification settings

evanova/eve-crest-java

Repository files navigation

Build Status

eve-crest-java

Eve Online CREST implementation in Java.

Getting Started

  • Insert Jitpack Dependency in Gradle
repositories {
    maven { url "https://jitpack.io" }
}
  • Add project to dependencies
compile 'com.github.evanova:eve-crest-java:master-SNAPSHOT'
  • If you don't want the latest version of master, Replace master-SNAPSHOT with a release version - current is 1.0

Using the library

  • Configure a CrestClient
final CrestClient client =
    CrestClient.TQ()
    .id("Your CREST application ID")
    .key("Your CREST application key")
    .build();

There are more options available to build a client. Please see CrestClient.Builder for more details.

 //Public CREST access
 service = client.newCrestService();
 
 //Obtain a token from an authorization code 
 CrestToken token = client.fromAuthCode(authCode);
 
 //or an existing refresh token
 CrestToken token = client.fromRefresh(refreshToken);
 
 //use the refresh value
 //Authenticated CREST access
 service = client.newCrestService(token.getRefreshToken());

From then on, the CrestService will use the refresh token to get proper access to CREST and will take care of refreshing its access token as necessary.

  • Interact with CREST

Once you obtained a CrestService, all methods in the interface are available to you.

 final List<CrestContact> contacts = service.getContacts();
 Assert.assertFalse("No contact found. Do you have any friend?", contacts.isEmpty());

 service.deleteContact(contact.getContact().getId());
 service.addContact(contact);

Testing

You will need to edit the crest.properties file in the test folder and fill it with the required information (see that file for details), then remove the Ignore tag on the tests. Run ./gradlew check afterward.

Further documentation

Eve Online 3rd Party documentation

Contributing

You are encouraged to add more CrestService method and/or add new CREST endpoints to the CREST Retrofit interface. Ask around on slack/#devfleet for details.

Dependencies

This library uses

Jackson

Retrofit2

OkKHttp3

OpenPojo

About

Java library for Eve Online CREST

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages