[Ndn-lib] Closure deprecated in NDN-JS

Thompson, Jeff jefft0 at remap.ucla.edu
Thu Sep 24 16:24:45 PDT 2015


Hello NDN-JS users,

As mentioned in the previous message, there is a new release of NDN-JS which removes deprecated support for NDNx, including the use of Closure. I'm sending a special email for NDN-JS since it had a lot of extra legacy NDNx code which is removed. Here are details from the CHANGELOG:

* In Face.registerPrefix, removed deprecated support to register with NDNx.
* In Face.expressInterest and registerPrefix, removed deprecated support for NDNx Closure.
* In the Face constructor, removed deprecated support for the NDNx verify flag.
* In Interest, removed deprecated NDNx get/setPublisherPublicKeyDigest,
  get/setScope and get/setAnswerOriginKind.
* In Data, removed deprecated NDNx methods sign and verify.
* In Sha256WithRsaSignature, removed deprecated NDNx get/setPublisherPublicKeyDigest,
  get/setWitness and get/setDigestAlgorithm.
* In ForwardingFlags, removed deprecated NDNx flags active, advertise, last,
  local, tap and captureOK.
* In KeyLocator, removed deprecated NDNx types KEY and CERTIFICATE.
* In MetaInfo, removed deprecated NDNx setFields and get/setTimestamp.
* In MetaInfo get/setType, removed deprecated NDNx types DATA, ENCR and GONE.
* In MetaInfo, removed NDNx locator. You should use get/setKeyLocator in the
     Signature object get/setKeyLocator().
* Removed deprecated NDNx classes ForwardingEntry, FaceInstance, KeyManager,
  NameEnumeration, ExponentialReExpressClosure, Closure, KeyName, KeyNameType,
  PublisherID, PublisherType, NDNTime, SignedInfo (use MetaInfo),
  Signature (use Sha256WithRsaSignature), ContentObject (use Data) and NDN (use Face).
* Removed deprecated NDNx BinaryXmlWireFormat and support for binary XML packets.
* In WireFormat, removed ENABLE_NDNX since all NDNx support is now removed.

Thank you,
- Jeff T

From: Jeff Thompson <jefft0 at remap.ucla.edu<mailto:jefft0 at remap.ucla.edu>>
Date: Thursday, May 14, 2015 at 9:13:00
To: NDN Lib <ndn-lib at lists.cs.ucla.edu<mailto:ndn-lib at lists.cs.ucla.edu>>
Subject: Closure deprecated in NDN-JS

Hello NDN-JS users,

As mentioned in the previous message, NDNx support has been deprecated in NDN-JS. This also includes support for NDNx-style "Closure" callbacks in expressInterest and registerPrefix. A lot of old NDN-JS apps used Closure, so I wanted to bring special attention to this. For example your code may have something like:

var closure = {
  upcall: function(kind, upcallInfo) { ... }
};
face.expressInterest(name, closure);

NDN-JS will throw an exception "expressInterest with NDNx-style Closure is deprecated. To enable while you upgrade your code to use function callbacks, set WireFormat.ENABLE_NDNX = true". You need to change your code to use function callbacks for expressInterest and registerPrefix. For example:

var onData = function(interest, data) { ... };
var onTimeout = function(interest) { ... };
face.expressInterest(name, onData, onTimeout);

For details, see the Common Client Library API docs:
http://named-data.net/doc/ndn-ccl-api/face.html#face-expressinterest-methods
http://named-data.net/doc/ndn-ccl-api/face.html#face-registerprefix-method

To enable NDNx and Closure support while you upgrade your code, add this line to your main function:
WireFormat.ENABLE_NDNX = true;

In the next platform release (about 3 months), NDNx and Closure support will be completely removed. If you need help converting your code from Closure to function callbacks, send me a message.

Thank you,
- Jeff T
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndn-lib/attachments/20150924/e0aa8840/attachment.html>


More information about the Ndn-lib mailing list