GithubHelp home page GithubHelp logo

isabella232 / jndn-utils Goto Github PK

View Code? Open in Web Editor NEW

This project forked from intel/jndn-utils

0.0 0.0 0.0 567 KB

A collection of tools to simplify synchronous and asynchronous data transfer over the NDN network

License: GNU Lesser General Public License v3.0

Java 99.58% HTML 0.42%

jndn-utils's Introduction

jndn-utils

This project is a collection of tools to simplify synchronous and asynchronous data transfer over the NDN network. It relies on the NDN Protocol and its associated client library.

Install

With Maven, add the following to your POM:

<dependency>
  <groupId>com.intel.jndn.utils</groupId>
  <artifactId>jndn-utils</artifactId>
  <version>RELEASE</version> <!-- or a specific version -->
</dependency>

Build

To build, run mvn install in the cloned directory. Additionally, you may want to run integration tests by running the nfd-integration-tests profile with a running NFD instance (see pom.xml for more details);

Use

This library provides Client, Server and Repository interfaces. These are implemented in their respective impl packages and require Java 8.

Use a SimpleClient or AdvancedClient (provides segmentation, retries, and streaming) to retrieve data from the network. For example:

// retrieve a single Data packet synchronously, will block until complete
Data singleData = SimpleClient.getDefault().getSync(face, name);

// retrieve segmented Data packets (i.e. with a last Component containing a segment number and a valid FinalBlockId) by name
CompletableFuture<Data> segmentedData = AdvancedClient.getDefault().getAsync(face, name);

Use SimpleServer or SegmentedServer to serve data on the network. For example:

// segment and serve Data packet under a specific prefix
RepositoryServer server = new SegmentedServer(face, prefix);
server.serve(largeDataPacket); // call face.processEvents() in an event loop

// add signatures; this pipeline stage will sign each Data packet prior to being encoded for transport
server.addPipelineStage(new SigningStage(keyChain, signingCertificateName));

For the full API, see the Javadoc.

Logging

jndn-utils uses Java's default logging utilities (see http://docs.oracle.com/javase/7/docs/api/java/util/logging/package-summary.html). Most messages are logged with the FINER or FINEST status; one way to change this is to add a logging.properties file in the classpath with the following lines:

handlers=java.util.logging.ConsoleHandler
.level=FINEST
java.util.logging.ConsoleHandler.level=FINEST

License

Copyright © 2015, Intel Corporation.

This program is free software; you can redistribute it and/or modify it under the terms and conditions of the GNU Lesser General Public License, version 3, as published by the Free Software Foundation.

This program is distributed in the hope it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

jndn-utils's People

Contributors

abrown avatar brianmcginn avatar hfp avatar tim-coppernoll avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.