build: Add gradle build system and upgrade to use jndn version 0.9
Change-Id: I5e8c355dd3ad1e87d2ac06ec78dcf8fa66b9bc08
diff --git a/src/main/java/com/intel/jndn/mock/FaceExtension.java b/src/main/java/com/intel/jndn/mock/FaceExtension.java
index 3d6af4a..b3b9e3b 100644
--- a/src/main/java/com/intel/jndn/mock/FaceExtension.java
+++ b/src/main/java/com/intel/jndn/mock/FaceExtension.java
@@ -15,17 +15,8 @@
import java.io.IOException;
import java.nio.ByteBuffer;
-import net.named_data.jndn.Data;
-import net.named_data.jndn.Face;
-import net.named_data.jndn.ForwardingFlags;
-import net.named_data.jndn.Interest;
-import net.named_data.jndn.InterestFilter;
-import net.named_data.jndn.Name;
-import net.named_data.jndn.OnData;
-import net.named_data.jndn.OnInterest;
-import net.named_data.jndn.OnInterestCallback;
-import net.named_data.jndn.OnRegisterFailed;
-import net.named_data.jndn.OnTimeout;
+
+import net.named_data.jndn.*;
import net.named_data.jndn.encoding.EncodingException;
import net.named_data.jndn.encoding.WireFormat;
import net.named_data.jndn.util.Blob;
@@ -66,7 +57,6 @@
interest.setExclude(interestTemplate.getExclude());
interest.setChildSelector(interestTemplate.getChildSelector());
interest.setMustBeFresh(interestTemplate.getMustBeFresh());
- interest.setScope(interestTemplate.getScope());
interest.setInterestLifetimeMilliseconds(
interestTemplate.getInterestLifetimeMilliseconds());
} else {
@@ -77,12 +67,9 @@
}
public abstract long registerPrefix(Name prefix,
- OnInterestCallback onInterest, OnRegisterFailed onRegisterFailed, ForwardingFlags flags,
- WireFormat wireFormat) throws IOException, net.named_data.jndn.security.SecurityException;
-
- public abstract long registerPrefix(Name prefix, final OnInterest onInterest,
- OnRegisterFailed onRegisterFailed, ForwardingFlags flags,
- WireFormat wireFormat) throws IOException, net.named_data.jndn.security.SecurityException;
+ OnInterestCallback onInterest, OnRegisterFailed onRegisterFailed,
+ OnRegisterSuccess onRegisterSuccess, ForwardingFlags flags,
+ WireFormat wireFormat) throws IOException, net.named_data.jndn.security.SecurityException;
public abstract void removeRegisteredPrefix(long registeredPrefixId);
diff --git a/src/main/java/com/intel/jndn/mock/MockFace.java b/src/main/java/com/intel/jndn/mock/MockFace.java
index d858d25..c36b16e 100644
--- a/src/main/java/com/intel/jndn/mock/MockFace.java
+++ b/src/main/java/com/intel/jndn/mock/MockFace.java
@@ -18,22 +18,11 @@
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.logging.Logger;
-import net.named_data.jndn.Data;
-import net.named_data.jndn.Face;
-import net.named_data.jndn.ForwardingFlags;
-import net.named_data.jndn.Interest;
-import net.named_data.jndn.InterestFilter;
-import net.named_data.jndn.Name;
-import net.named_data.jndn.Node;
-import net.named_data.jndn.OnData;
-import net.named_data.jndn.OnInterest;
-import net.named_data.jndn.OnInterestCallback;
-import net.named_data.jndn.OnRegisterFailed;
-import net.named_data.jndn.OnTimeout;
+
+import net.named_data.jndn.*;
import net.named_data.jndn.encoding.EncodingException;
import net.named_data.jndn.encoding.WireFormat;
import net.named_data.jndn.security.SecurityException;
-import net.named_data.jndn.transport.Transport;
/**
* <p>
@@ -59,8 +48,8 @@
private static final Logger logger = Logger.getLogger(MockFace.class.getName());
private final Node node_;
- HashMap<String, Data> responseMap = new HashMap<>();
- HashMap<Long, MockOnInterestHandler> handlerMap = new HashMap<>();
+ HashMap<String, Data> responseMap = new HashMap<String, Data>();
+ HashMap<Long, MockOnInterestHandler> handlerMap = new HashMap<Long, MockOnInterestHandler>();
long lastPendingInterestId = 0;
long lastInterestFilterId = 0;
long lastRegisteredPrefixId = 0;
@@ -237,20 +226,10 @@
* find the private key for the certificateName.
*/
@Override
- public long registerPrefix(Name prefix, OnInterest onInterest, OnRegisterFailed onRegisterFailed,
- ForwardingFlags flags, WireFormat wireFormat) throws IOException, net.named_data.jndn.security.SecurityException {
- // since we don't send an Interest, ensure the transport is connected
- if (!getTransport().getIsConnected()) {
- getTransport().connect(node_.getConnectionInfo(), node_, null);
- }
-
- lastRegisteredPrefixId++;
- handlerMap.put(lastRegisteredPrefixId, new MockOnInterestHandler(prefix, onInterest, flags));
- return lastRegisteredPrefixId;
- }
-
- @Override
- public long registerPrefix(Name prefix, OnInterestCallback onInterest, OnRegisterFailed onRegisterFailed, ForwardingFlags flags, WireFormat wireFormat) throws IOException, SecurityException {
+ public long registerPrefix(Name prefix,
+ OnInterestCallback onInterest, OnRegisterFailed onRegisterFailed,
+ OnRegisterSuccess onRegisterSuccess, ForwardingFlags flags,
+ WireFormat wireFormat) throws IOException, net.named_data.jndn.security.SecurityException {
// since we don't send an Interest, ensure the transport is connected
if (!getTransport().getIsConnected()) {
getTransport().connect(node_.getConnectionInfo(), node_, null);