blob: e37853dc8e3976dcf027c643841253bfa384595f [file] [log] [blame] [view]
Andrew Browne96c16d2015-02-21 15:44:42 -08001# jndn-utils
2
3This project is a collection of tools to simplify synchronous and asynchronous data transfer over the NDN network. It relies on the [NDN Protocol](https://named-data.net) and its associated [client library](https://github.com/named-data/jndn).
4
5## Install
6With Maven, add the following to your POM:
7```
8<dependency>
9 <groupId>com.intel.jndn.utils</groupId>
10 <artifactId>jndn-utils</artifactId>
11 <version>RELEASE</version> <!-- or a specific version -->
12</dependency>
13```
14
15## Use
andrewsbrown20ccfdd2015-04-07 09:34:31 -070016Use `SimpleClient` or `SegmentedClient` to retrieve data from the network. For example:
Andrew Browne96c16d2015-02-21 15:44:42 -080017```
andrewsbrown7fff8672015-04-07 09:24:17 -070018// retrieve a single Data packet synchronously, will block until complete
19Data singleData = Client.getDefault().getSync(face, name);
20
21// retrieve a segmented Data packet (i.e. with a last Component containing a segment number and a valid FinalBlockId) by name
22Data segmentedData = SegmentedClient.getDefault().getSync(face, name);
andrewsbrown20ccfdd2015-04-07 09:34:31 -070023```
andrewsbrown7fff8672015-04-07 09:24:17 -070024
andrewsbrown20ccfdd2015-04-07 09:34:31 -070025Use `SimpleServer` or `SegmentedServer` to serve data on the network. For example:
26```
andrewsbrown7fff8672015-04-07 09:24:17 -070027// segment and serve Data packet under a specific prefix
28RepositoryServer server = new SegmentedServer(face, prefix);
29server.serve(largeDataPacket); // call face.processEvents() in an event loop
30
andrewsbrown20ccfdd2015-04-07 09:34:31 -070031// add signatures; this pipeline stage will sign each Data packet prior to being encoded for transport
andrewsbrown7fff8672015-04-07 09:24:17 -070032server.addPipelineStage(new SigningStage(keyChain, signingCertificateName));
Andrew Browne96c16d2015-02-21 15:44:42 -080033```
34
andrewsbrown7fff8672015-04-07 09:24:17 -070035For full API, see the [Javadoc](http://01org.github.io/jndn-utils/).
36
Andrew Browne96c16d2015-02-21 15:44:42 -080037## License
andrewsbrown4feb2da2015-03-03 16:05:29 -080038Copyright © 2015, Intel Corporation.
39
40This 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.
41
42This 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](https://github.com/01org/jndn-utils/blob/master/LICENSE) for more details.