Committed by
Gerrit Code Review
Refactor: Rename to more descriptive name
Change-Id: I013c45690f7f405b66d656fd8e53d4a41c31e6da
Showing
4 changed files
with
12 additions
and
11 deletions
... | @@ -46,7 +46,7 @@ import org.onosproject.net.intent.OpticalCircuitIntent; | ... | @@ -46,7 +46,7 @@ import org.onosproject.net.intent.OpticalCircuitIntent; |
46 | import org.onosproject.net.intent.OpticalConnectivityIntent; | 46 | import org.onosproject.net.intent.OpticalConnectivityIntent; |
47 | import org.onosproject.net.intent.PointToPointIntent; | 47 | import org.onosproject.net.intent.PointToPointIntent; |
48 | import org.onosproject.net.newresource.ResourceService; | 48 | import org.onosproject.net.newresource.ResourceService; |
49 | -import org.onosproject.net.resource.device.DeviceResourceStore; | 49 | +import org.onosproject.net.resource.device.IntentSetMultimap; |
50 | import org.onosproject.net.resource.link.LinkResourceAllocations; | 50 | import org.onosproject.net.resource.link.LinkResourceAllocations; |
51 | import org.onosproject.net.resource.link.LinkResourceService; | 51 | import org.onosproject.net.resource.link.LinkResourceService; |
52 | import org.onosproject.net.topology.LinkWeight; | 52 | import org.onosproject.net.topology.LinkWeight; |
... | @@ -98,7 +98,7 @@ public class OpticalPathProvisioner { | ... | @@ -98,7 +98,7 @@ public class OpticalPathProvisioner { |
98 | protected DeviceService deviceService; | 98 | protected DeviceService deviceService; |
99 | 99 | ||
100 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 100 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
101 | - protected DeviceResourceStore deviceResourceStore; | 101 | + protected IntentSetMultimap intentSetMultimap; |
102 | 102 | ||
103 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 103 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
104 | protected LinkResourceService linkResourceService; | 104 | protected LinkResourceService linkResourceService; |
... | @@ -385,7 +385,7 @@ public class OpticalPathProvisioner { | ... | @@ -385,7 +385,7 @@ public class OpticalPathProvisioner { |
385 | } | 385 | } |
386 | } else if (intent instanceof OpticalCircuitIntent) { | 386 | } else if (intent instanceof OpticalCircuitIntent) { |
387 | resourceService.release(intent.id()); | 387 | resourceService.release(intent.id()); |
388 | - deviceResourceStore.releaseMapping(intent.id()); | 388 | + intentSetMultimap.releaseMapping(intent.id()); |
389 | if (lra != null) { | 389 | if (lra != null) { |
390 | linkResourceService.releaseResources(lra); | 390 | linkResourceService.releaseResources(lra); |
391 | } | 391 | } | ... | ... |
... | @@ -19,7 +19,7 @@ import org.onosproject.net.intent.IntentId; | ... | @@ -19,7 +19,7 @@ import org.onosproject.net.intent.IntentId; |
19 | 19 | ||
20 | import java.util.Set; | 20 | import java.util.Set; |
21 | 21 | ||
22 | -public interface DeviceResourceStore { | 22 | +public interface IntentSetMultimap { |
23 | 23 | ||
24 | /** | 24 | /** |
25 | * Allocates the mapping between the given intents. | 25 | * Allocates the mapping between the given intents. | ... | ... |
... | @@ -52,7 +52,7 @@ import org.onosproject.net.intent.impl.IntentCompilationException; | ... | @@ -52,7 +52,7 @@ import org.onosproject.net.intent.impl.IntentCompilationException; |
52 | import org.onosproject.net.newresource.ResourceAllocation; | 52 | import org.onosproject.net.newresource.ResourceAllocation; |
53 | import org.onosproject.net.newresource.ResourcePath; | 53 | import org.onosproject.net.newresource.ResourcePath; |
54 | import org.onosproject.net.newresource.ResourceService; | 54 | import org.onosproject.net.newresource.ResourceService; |
55 | -import org.onosproject.net.resource.device.DeviceResourceStore; | 55 | +import org.onosproject.net.resource.device.IntentSetMultimap; |
56 | import org.onosproject.net.resource.link.LinkResourceAllocations; | 56 | import org.onosproject.net.resource.link.LinkResourceAllocations; |
57 | import org.osgi.service.component.ComponentContext; | 57 | import org.osgi.service.component.ComponentContext; |
58 | import org.slf4j.Logger; | 58 | import org.slf4j.Logger; |
... | @@ -98,7 +98,7 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu | ... | @@ -98,7 +98,7 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu |
98 | protected ResourceService resourceService; | 98 | protected ResourceService resourceService; |
99 | 99 | ||
100 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 100 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
101 | - protected DeviceResourceStore deviceResourceStore; | 101 | + protected IntentSetMultimap intentSetMultimap; |
102 | 102 | ||
103 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 103 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
104 | protected IntentService intentService; | 104 | protected IntentService intentService; |
... | @@ -208,7 +208,7 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu | ... | @@ -208,7 +208,7 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu |
208 | circuitIntent = new FlowRuleIntent(appId, rules, intent.resources()); | 208 | circuitIntent = new FlowRuleIntent(appId, rules, intent.resources()); |
209 | 209 | ||
210 | // Save circuit to connectivity intent mapping | 210 | // Save circuit to connectivity intent mapping |
211 | - deviceResourceStore.allocateMapping(connIntent.id(), intent.id()); | 211 | + intentSetMultimap.allocateMapping(connIntent.id(), intent.id()); |
212 | intents.add(circuitIntent); | 212 | intents.add(circuitIntent); |
213 | 213 | ||
214 | return intents; | 214 | return intents; |
... | @@ -226,7 +226,7 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu | ... | @@ -226,7 +226,7 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu |
226 | return true; | 226 | return true; |
227 | } | 227 | } |
228 | 228 | ||
229 | - Set<IntentId> mapping = deviceResourceStore.getMapping(resource); | 229 | + Set<IntentId> mapping = intentSetMultimap.getMapping(resource); |
230 | 230 | ||
231 | if (mapping == null) { | 231 | if (mapping == null) { |
232 | return true; | 232 | return true; | ... | ... |
... | @@ -23,7 +23,7 @@ import org.apache.felix.scr.annotations.ReferenceCardinality; | ... | @@ -23,7 +23,7 @@ import org.apache.felix.scr.annotations.ReferenceCardinality; |
23 | import org.apache.felix.scr.annotations.Service; | 23 | import org.apache.felix.scr.annotations.Service; |
24 | import org.onosproject.net.device.DeviceService; | 24 | import org.onosproject.net.device.DeviceService; |
25 | import org.onosproject.net.intent.IntentId; | 25 | import org.onosproject.net.intent.IntentId; |
26 | -import org.onosproject.net.resource.device.DeviceResourceStore; | 26 | +import org.onosproject.net.resource.device.IntentSetMultimap; |
27 | import org.onosproject.store.serializers.KryoNamespaces; | 27 | import org.onosproject.store.serializers.KryoNamespaces; |
28 | import org.onosproject.store.service.ConsistentMap; | 28 | import org.onosproject.store.service.ConsistentMap; |
29 | import org.onosproject.store.service.Serializer; | 29 | import org.onosproject.store.service.Serializer; |
... | @@ -37,11 +37,12 @@ import java.util.Set; | ... | @@ -37,11 +37,12 @@ import java.util.Set; |
37 | import static org.slf4j.LoggerFactory.getLogger; | 37 | import static org.slf4j.LoggerFactory.getLogger; |
38 | 38 | ||
39 | /** | 39 | /** |
40 | - * Store that manages device resources using Copycat-backed TransactionalMaps. | 40 | + * A collection that maps Intent IDs as keys to values as Intent IDs, |
41 | + * where each key may associated with multiple values without duplication. | ||
41 | */ | 42 | */ |
42 | @Component(immediate = true, enabled = true) | 43 | @Component(immediate = true, enabled = true) |
43 | @Service | 44 | @Service |
44 | -public class ConsistentDeviceResourceStore implements DeviceResourceStore { | 45 | +public class ConsistentIntentSetMultimap implements IntentSetMultimap { |
45 | private final Logger log = getLogger(getClass()); | 46 | private final Logger log = getLogger(getClass()); |
46 | 47 | ||
47 | private static final String INTENT_MAPPING = "IntentMapping"; | 48 | private static final String INTENT_MAPPING = "IntentMapping"; | ... | ... |
-
Please register or login to post a comment