Pre-release
Pre-release

@nicoruti nicoruti released this Jan 27, 2014 · 1304 commits to master since this release

Assets 3

The first release of the Hive2Hive library. It does not contain all features yet, but the basic private file operations. This means, that it's possible to

  • register a new user
  • login as a registered user
  • add, delete, move, update a file, folder or a whole (recursive) file tree
  • logout when the user is done

When a user is logged in on multiple clients, they automatically synchronize in real-time, meaning that notifications are sent around when something has changed.

Note that there is also a (beta) function to share a folder (with all including children). This function is not well tested yet, but kept in this release to soft-soap you. This great feature and more are planned for the next release.

Here's the short basics how to use it:

// use the builder to create a Hive2Hive node
// create a master peer
H2HNodeBuilder masterBuilder = new H2HNodeBuilder().setIsMaster(true);
IH2HNode masterNode = masterBuilder.build();
// or a client peer
H2HNodeBuilder clientBuilder = new H2HNodeBuilder().setIsMaster(false).setBootstrapAddress(InetAddress.getByName("192.168.1.100"));
IH2HNode clientNode = clientBuilder.build();

Once you have created and connected a node, you can start using it:

// register a new user
UserCredentials userCredentials = new UserCredentials("user@hive2hive.com", "password", "1234");
IProcess register = clientNode.getUserManagement().register(userCredentials);
// pause & continue the process
register.pause();
register.continueProcess();
// add listeners that are called when finished
register.addListener(new IProcessListener() {
    @Override
    public void onSuccess() {
        System.out.println("finished");
    }
    @Override
    public void onFail(Exception exception) {
        System.out.println("Failed! Reason: " + exception.getMessage());
    }
});