commit | 13b11c5d7848130363bc0907e03304744f37fb0f | [log] [tgz] |
---|---|---|
author | andrewsbrown <andrew.brown@intel.com> | Thu Jul 02 14:23:15 2015 -0700 |
committer | andrewsbrown <andrew.brown@intel.com> | Wed Aug 05 11:28:45 2015 -0700 |
tree | cf2023877516575c462d6d0508aad21dcc55b1f0 | |
parent | 8d5ae29ee5eaad14e0a4e6a531c1735d55d05763 [diff] |
Re-factor and upgrade to support Java 8 CompletableFutures as well as AdvancedClient capabilities The squashed commits include: Move clients to separate package; fix SimpleClient integration test Move common test functionality to TestHelper Add SegmentedClient integration test Reduce logging messages; add documentation Bump version; remove unnecessary logging configuration doclint turns javadoc warnings into errors; ignore for now see http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html Add snapshot repository for deploying snapshots Bump major version due to platform change (Java 7 to Java 8) Add sync retrieval integration test Re-factor locations of classes: all interfaces in top level folder, change name of PipelineStage to ProcessingStage In progress commit, tests broken Refactor, WIP Tweak synchronization, processing of segmented packets Move tests around Fix TestHelper bug Complete tests WIP Add streaming test Fix segmented server integration test Finish refactoring Update POM and README Update documentation
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.
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>
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);
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.
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
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.