Add sub-types to distinguish type of resources

Change-Id: Ia43cbf4a13937c9bd9dbc97221062ef5fa3e578f
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalConnectivityIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
index 05caa66..a4ed551 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
@@ -107,8 +107,8 @@
         log.debug("Compiling optical connectivity intent between {} and {}", src, dst);
 
         // Reserve OCh ports
-        ResourcePath srcPortPath = new ResourcePath(src.deviceId(), src.port());
-        ResourcePath dstPortPath = new ResourcePath(dst.deviceId(), dst.port());
+        ResourcePath srcPortPath = ResourcePath.discrete(src.deviceId(), src.port());
+        ResourcePath dstPortPath = ResourcePath.discrete(dst.deviceId(), dst.port());
         List<org.onosproject.net.newresource.ResourceAllocation> allocation =
                 resourceService.allocate(intent.id(), srcPortPath, dstPortPath);
         if (allocation.isEmpty()) {
@@ -182,7 +182,7 @@
 
         IndexedLambda minLambda = findFirstLambda(lambdas);
         List<ResourcePath> lambdaResources = path.links().stream()
-                .map(x -> new ResourcePath(linkKey(x.src(), x.dst())))
+                .map(x -> ResourcePath.discrete(linkKey(x.src(), x.dst())))
                 .map(x -> x.child(minLambda))
                 .collect(Collectors.toList());
 
@@ -196,7 +196,7 @@
 
     private Set<IndexedLambda> findCommonLambdasOverLinks(List<Link> links) {
         return links.stream()
-                .map(x -> new ResourcePath(linkKey(x.src(), x.dst())))
+                .map(x -> ResourcePath.discrete(linkKey(x.src(), x.dst())))
                 .map(resourceService::getAvailableResources)
                 .map(x -> Iterables.filter(x, r -> r.last() instanceof IndexedLambda))
                 .map(x -> Iterables.transform(x, r -> (IndexedLambda) r.last()))