Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.
/ jiffybox Public archive

Java implementation of the JiffyBox API

License

Notifications You must be signed in to change notification settings

jnodorp/jiffybox

Repository files navigation

This project has been archived on May 30th 2024, alongside the JiffyBox product. See the official statement by DomainFactory (German).

Build Status Coverage Status

JiffyBox API

Java implementation of the JiffyBox API.

Introduction

Cloud servers on demand by JiffyBox are virtual servers which's resources are not fixed but coming from a large pool, the "cloud". Without an inflexible price corset and without a minimal runtime the billing is calculated by actual usage only. Further information on features and pricing of JiffyBoxes can be found at the JiffyBox website:

A complete documentation on the API's features can be found at http://www.df.eu/fileadmin/media/doc/jiffybox-api-dokumentation.pdf

For the javadoc look at http://jnodorp.github.io/jiffybox/

This project is a Java implementation of the JiffyBox API. It is licensed under the MIT License.

Usage

For details on how to import this package into your project see the published package versions here: https://github.com/jnodorp/jiffybox/packages

Basic usage is

import io.github.jnodorp.jiffybox.JiffyBoxApi;
import io.github.jnodorp.jiffybox.models.Backup;
import io.github.jnodorp.jiffybox.models.Message;
import io.github.jnodorp.jiffybox.models.Response;
import io.github.jnodorp.jiffybox.modules.ModuleBackups;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public class Main {

    /**
     * Demonstrate the basic usage of the JiffyBox API.
     */
    public static void main(String args[]) throws IOException {
        // Get an API instance using the <Your API token> token.
        JiffyBoxApi api = new JiffyBoxApi("<Your API token>");

        // Get a module (e. g. backups).
        ModuleBackups backups = api.getModuleBackups();

        // Make a call to the module (e. g. requesting a list of all backups).
        Response<Map<String, Backup>> response = backups.getBackups();

        // Get the messages sent by the API.
        List<Message> messages = response.getMessages();

        // Get the result sent by the API.
        Map<String, Backup> result = response.getResult();
    }
}

Make sure to handle IOExceptions which occur when either an API limit is exceeded or the API server is unreachable for whatever reason.

For further examples see the test cases.

Testing

The test cases are written using WireMock (http://wiremock.org/) by Tom Akehurst (http://www.tomakehurst.com/about/). To add or examine test cases there has to be a mapping within the src/test/resources/mappings folder (or a sub folder).

About

Java implementation of the JiffyBox API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages