Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
Ray Milkey | 34c9590 | 2015-04-15 09:47:53 -0700 | [diff] [blame] | 2 | * Copyright 2014-2015 Open Networking Laboratory |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.resource.impl; |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 17 | |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 18 | import org.apache.felix.scr.annotations.Activate; |
| 19 | import org.apache.felix.scr.annotations.Component; |
| 20 | import org.apache.felix.scr.annotations.Deactivate; |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 21 | import org.apache.felix.scr.annotations.Reference; |
| 22 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 23 | import org.apache.felix.scr.annotations.Service; |
Changhoon Yoon | 541ef71 | 2015-05-23 17:18:34 +0900 | [diff] [blame^] | 24 | import org.onosproject.core.Permission; |
Simon Hunt | ff66374 | 2015-05-14 13:33:05 -0700 | [diff] [blame] | 25 | import org.onosproject.event.ListenerRegistry; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 26 | import org.onosproject.event.EventDeliveryService; |
| 27 | import org.onosproject.net.Link; |
| 28 | import org.onosproject.net.intent.IntentId; |
Brian O'Connor | 6de2e20 | 2015-05-21 14:30:41 -0700 | [diff] [blame] | 29 | import org.onosproject.net.resource.link.BandwidthResourceAllocation; |
| 30 | import org.onosproject.net.resource.link.BandwidthResourceRequest; |
| 31 | import org.onosproject.net.resource.link.DefaultLinkResourceAllocations; |
| 32 | import org.onosproject.net.resource.link.LambdaResource; |
| 33 | import org.onosproject.net.resource.link.LambdaResourceAllocation; |
| 34 | import org.onosproject.net.resource.link.LambdaResourceRequest; |
| 35 | import org.onosproject.net.resource.link.LinkResourceAllocations; |
| 36 | import org.onosproject.net.resource.link.LinkResourceEvent; |
| 37 | import org.onosproject.net.resource.link.LinkResourceListener; |
| 38 | import org.onosproject.net.resource.link.LinkResourceRequest; |
| 39 | import org.onosproject.net.resource.link.LinkResourceService; |
| 40 | import org.onosproject.net.resource.link.LinkResourceStore; |
| 41 | import org.onosproject.net.resource.link.LinkResourceStoreDelegate; |
| 42 | import org.onosproject.net.resource.link.MplsLabel; |
| 43 | import org.onosproject.net.resource.link.MplsLabelResourceAllocation; |
| 44 | import org.onosproject.net.resource.link.MplsLabelResourceRequest; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 45 | import org.onosproject.net.resource.ResourceAllocation; |
| 46 | import org.onosproject.net.resource.ResourceRequest; |
| 47 | import org.onosproject.net.resource.ResourceType; |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 48 | import org.slf4j.Logger; |
| 49 | |
Marc De Leenheer | 8b3e80b | 2015-03-06 14:27:03 -0800 | [diff] [blame] | 50 | import java.util.Collections; |
| 51 | import java.util.HashMap; |
| 52 | import java.util.HashSet; |
| 53 | import java.util.Iterator; |
| 54 | import java.util.Map; |
| 55 | import java.util.Set; |
| 56 | |
| 57 | import static com.google.common.base.Preconditions.checkArgument; |
| 58 | import static com.google.common.base.Preconditions.checkNotNull; |
| 59 | import static org.slf4j.LoggerFactory.getLogger; |
Changhoon Yoon | 541ef71 | 2015-05-23 17:18:34 +0900 | [diff] [blame^] | 60 | import static org.onosproject.security.AppGuard.checkPermission; |
| 61 | |
Marc De Leenheer | 8b3e80b | 2015-03-06 14:27:03 -0800 | [diff] [blame] | 62 | |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 63 | /** |
| 64 | * Provides basic implementation of link resources allocation. |
| 65 | */ |
| 66 | @Component(immediate = true) |
| 67 | @Service |
| 68 | public class LinkResourceManager implements LinkResourceService { |
| 69 | |
| 70 | private final Logger log = getLogger(getClass()); |
| 71 | |
Simon Hunt | ff66374 | 2015-05-14 13:33:05 -0700 | [diff] [blame] | 72 | protected final ListenerRegistry<LinkResourceEvent, LinkResourceListener> |
| 73 | listenerRegistry = new ListenerRegistry<>(); |
Ray Milkey | e97ede9 | 2014-11-20 10:43:12 -0800 | [diff] [blame] | 74 | |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 75 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 76 | private LinkResourceStore store; |
Ray Milkey | caa450b | 2014-10-29 15:54:24 -0700 | [diff] [blame] | 77 | |
Ray Milkey | e97ede9 | 2014-11-20 10:43:12 -0800 | [diff] [blame] | 78 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 79 | protected EventDeliveryService eventDispatcher; |
| 80 | |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 81 | @Activate |
| 82 | public void activate() { |
Ray Milkey | e97ede9 | 2014-11-20 10:43:12 -0800 | [diff] [blame] | 83 | eventDispatcher.addSink(LinkResourceEvent.class, listenerRegistry); |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 84 | log.info("Started"); |
| 85 | } |
| 86 | |
| 87 | @Deactivate |
| 88 | public void deactivate() { |
| 89 | log.info("Stopped"); |
| 90 | } |
| 91 | |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 92 | /** |
| 93 | * Returns available lambdas on specified link. |
| 94 | * |
| 95 | * @param link the link |
| 96 | * @return available lambdas on specified link |
| 97 | */ |
Sho SHIMIZU | 94b7ff4 | 2015-05-06 17:51:49 -0700 | [diff] [blame] | 98 | private Set<LambdaResource> getAvailableLambdas(Link link) { |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 99 | checkNotNull(link); |
| 100 | Set<ResourceAllocation> resAllocs = store.getFreeResources(link); |
| 101 | if (resAllocs == null) { |
| 102 | return Collections.emptySet(); |
| 103 | } |
Sho SHIMIZU | 94b7ff4 | 2015-05-06 17:51:49 -0700 | [diff] [blame] | 104 | Set<LambdaResource> lambdas = new HashSet<>(); |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 105 | for (ResourceAllocation res : resAllocs) { |
| 106 | if (res.type() == ResourceType.LAMBDA) { |
| 107 | lambdas.add(((LambdaResourceAllocation) res).lambda()); |
| 108 | } |
| 109 | } |
| 110 | return lambdas; |
Toshio Koide | 9be539e | 2014-10-23 18:43:30 -0700 | [diff] [blame] | 111 | } |
| 112 | |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 113 | |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 114 | /** |
| 115 | * Returns available lambdas on specified links. |
| 116 | * |
| 117 | * @param links the links |
| 118 | * @return available lambdas on specified links |
| 119 | */ |
Sho SHIMIZU | 94b7ff4 | 2015-05-06 17:51:49 -0700 | [diff] [blame] | 120 | private Iterable<LambdaResource> getAvailableLambdas(Iterable<Link> links) { |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 121 | checkNotNull(links); |
| 122 | Iterator<Link> i = links.iterator(); |
| 123 | checkArgument(i.hasNext()); |
Sho SHIMIZU | 94b7ff4 | 2015-05-06 17:51:49 -0700 | [diff] [blame] | 124 | Set<LambdaResource> lambdas = new HashSet<>(getAvailableLambdas(i.next())); |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 125 | while (i.hasNext()) { |
| 126 | lambdas.retainAll(getAvailableLambdas(i.next())); |
| 127 | } |
| 128 | return lambdas; |
| 129 | } |
Ray Milkey | caa450b | 2014-10-29 15:54:24 -0700 | [diff] [blame] | 130 | |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 131 | |
| 132 | /** |
| 133 | * Returns available MPLS label on specified link. |
| 134 | * |
| 135 | * @param link the link |
| 136 | * @return available MPLS labels on specified link |
| 137 | */ |
| 138 | private Iterable<MplsLabel> getAvailableMplsLabels(Link link) { |
| 139 | Set<ResourceAllocation> resAllocs = store.getFreeResources(link); |
| 140 | if (resAllocs == null) { |
| 141 | return Collections.emptySet(); |
| 142 | } |
| 143 | Set<MplsLabel> mplsLabels = new HashSet<>(); |
| 144 | for (ResourceAllocation res : resAllocs) { |
| 145 | if (res.type() == ResourceType.MPLS_LABEL) { |
| 146 | |
| 147 | mplsLabels.add(((MplsLabelResourceAllocation) res).mplsLabel()); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | return mplsLabels; |
| 152 | } |
| 153 | |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 154 | @Override |
| 155 | public LinkResourceAllocations requestResources(LinkResourceRequest req) { |
Changhoon Yoon | 541ef71 | 2015-05-23 17:18:34 +0900 | [diff] [blame^] | 156 | checkPermission(Permission.LINK_WRITE); |
| 157 | |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 158 | // TODO Concatenate multiple bandwidth requests. |
| 159 | // TODO Support multiple lambda resource requests. |
| 160 | // TODO Throw appropriate exception. |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 161 | Set<ResourceAllocation> allocs = new HashSet<>(); |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 162 | Map<Link, Set<ResourceAllocation>> allocsPerLink = new HashMap<>(); |
Toshio Koide | 9be539e | 2014-10-23 18:43:30 -0700 | [diff] [blame] | 163 | for (ResourceRequest r : req.resources()) { |
Toshio Koide | ca0fcff | 2014-10-23 14:08:36 -0700 | [diff] [blame] | 164 | switch (r.type()) { |
| 165 | case BANDWIDTH: |
Toshio Koide | ca0fcff | 2014-10-23 14:08:36 -0700 | [diff] [blame] | 166 | BandwidthResourceRequest br = (BandwidthResourceRequest) r; |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 167 | allocs.add(new BandwidthResourceAllocation(br.bandwidth())); |
Toshio Koide | ca0fcff | 2014-10-23 14:08:36 -0700 | [diff] [blame] | 168 | break; |
| 169 | case LAMBDA: |
Sho SHIMIZU | 94b7ff4 | 2015-05-06 17:51:49 -0700 | [diff] [blame] | 170 | Iterator<LambdaResource> lambdaIterator = |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 171 | getAvailableLambdas(req.links()).iterator(); |
Toshio Koide | 9be539e | 2014-10-23 18:43:30 -0700 | [diff] [blame] | 172 | if (lambdaIterator.hasNext()) { |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 173 | allocs.add(new LambdaResourceAllocation(lambdaIterator.next())); |
| 174 | } else { |
| 175 | log.info("Failed to allocate lambda resource."); |
| 176 | return null; |
Toshio Koide | 9be539e | 2014-10-23 18:43:30 -0700 | [diff] [blame] | 177 | } |
Toshio Koide | ca0fcff | 2014-10-23 14:08:36 -0700 | [diff] [blame] | 178 | break; |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 179 | case MPLS_LABEL: |
| 180 | for (Link link : req.links()) { |
| 181 | if (allocsPerLink.get(link) == null) { |
| 182 | allocsPerLink.put(link, |
| 183 | new HashSet<ResourceAllocation>()); |
| 184 | } |
| 185 | Iterator<MplsLabel> mplsIter = getAvailableMplsLabels(link) |
| 186 | .iterator(); |
| 187 | if (mplsIter.hasNext()) { |
| 188 | allocsPerLink.get(link) |
| 189 | .add(new MplsLabelResourceAllocation(mplsIter |
| 190 | .next())); |
| 191 | } else { |
| 192 | log.info("Failed to allocate MPLS resource."); |
| 193 | break; |
| 194 | } |
| 195 | } |
| 196 | break; |
Toshio Koide | ca0fcff | 2014-10-23 14:08:36 -0700 | [diff] [blame] | 197 | default: |
| 198 | break; |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | Map<Link, Set<ResourceAllocation>> allocations = new HashMap<>(); |
Toshio Koide | 9be539e | 2014-10-23 18:43:30 -0700 | [diff] [blame] | 203 | for (Link link : req.links()) { |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 204 | allocations.put(link, new HashSet<ResourceAllocation>(allocs)); |
Marc De Leenheer | 8b3e80b | 2015-03-06 14:27:03 -0800 | [diff] [blame] | 205 | Set<ResourceAllocation> linkAllocs = allocsPerLink.get(link); |
| 206 | if (linkAllocs != null) { |
| 207 | allocations.get(link).addAll(linkAllocs); |
| 208 | } |
Toshio Koide | ca0fcff | 2014-10-23 14:08:36 -0700 | [diff] [blame] | 209 | } |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 210 | LinkResourceAllocations result = |
| 211 | new DefaultLinkResourceAllocations(req, allocations); |
| 212 | store.allocateResources(result); |
| 213 | return result; |
| 214 | |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | @Override |
| 218 | public void releaseResources(LinkResourceAllocations allocations) { |
Changhoon Yoon | 541ef71 | 2015-05-23 17:18:34 +0900 | [diff] [blame^] | 219 | checkPermission(Permission.LINK_WRITE); |
| 220 | |
Ray Milkey | e97ede9 | 2014-11-20 10:43:12 -0800 | [diff] [blame] | 221 | final LinkResourceEvent event = store.releaseResources(allocations); |
| 222 | if (event != null) { |
| 223 | post(event); |
| 224 | } |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 225 | } |
| 226 | |
| 227 | @Override |
Thomas Vachuska | f997695 | 2014-10-24 11:55:05 -0700 | [diff] [blame] | 228 | public LinkResourceAllocations updateResources(LinkResourceRequest req, |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 229 | LinkResourceAllocations oldAllocations) { |
Changhoon Yoon | 541ef71 | 2015-05-23 17:18:34 +0900 | [diff] [blame^] | 230 | checkPermission(Permission.LINK_WRITE); |
| 231 | |
| 232 | releaseResources(oldAllocations); |
weibit | 00c94f5 | 2014-11-16 07:09:05 -0800 | [diff] [blame] | 233 | return requestResources(req); |
Thomas Vachuska | f997695 | 2014-10-24 11:55:05 -0700 | [diff] [blame] | 234 | } |
| 235 | |
| 236 | @Override |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 237 | public Iterable<LinkResourceAllocations> getAllocations() { |
Changhoon Yoon | 541ef71 | 2015-05-23 17:18:34 +0900 | [diff] [blame^] | 238 | checkPermission(Permission.LINK_READ); |
| 239 | |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 240 | return store.getAllocations(); |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | @Override |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 244 | public Iterable<LinkResourceAllocations> getAllocations(Link link) { |
Changhoon Yoon | 541ef71 | 2015-05-23 17:18:34 +0900 | [diff] [blame^] | 245 | checkPermission(Permission.LINK_READ); |
| 246 | |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 247 | return store.getAllocations(link); |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | @Override |
Toshio Koide | 9be539e | 2014-10-23 18:43:30 -0700 | [diff] [blame] | 251 | public LinkResourceAllocations getAllocations(IntentId intentId) { |
Changhoon Yoon | 541ef71 | 2015-05-23 17:18:34 +0900 | [diff] [blame^] | 252 | checkPermission(Permission.LINK_READ); |
| 253 | |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 254 | return store.getAllocations(intentId); |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 255 | } |
| 256 | |
| 257 | @Override |
Toshio Koide | 9be539e | 2014-10-23 18:43:30 -0700 | [diff] [blame] | 258 | public Iterable<ResourceRequest> getAvailableResources(Link link) { |
Changhoon Yoon | 541ef71 | 2015-05-23 17:18:34 +0900 | [diff] [blame^] | 259 | checkPermission(Permission.LINK_READ); |
| 260 | |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 261 | Set<ResourceAllocation> freeRes = store.getFreeResources(link); |
| 262 | Set<ResourceRequest> result = new HashSet<>(); |
| 263 | for (ResourceAllocation alloc : freeRes) { |
| 264 | switch (alloc.type()) { |
| 265 | case BANDWIDTH: |
| 266 | result.add(new BandwidthResourceRequest( |
| 267 | ((BandwidthResourceAllocation) alloc).bandwidth())); |
| 268 | break; |
| 269 | case LAMBDA: |
| 270 | result.add(new LambdaResourceRequest()); |
| 271 | break; |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 272 | case MPLS_LABEL: |
| 273 | result.add(new MplsLabelResourceRequest()); |
Sho SHIMIZU | 3fa9e8d | 2015-05-05 11:40:04 -0700 | [diff] [blame] | 274 | break; |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 275 | default: |
| 276 | break; |
| 277 | } |
| 278 | } |
Ray Milkey | caa450b | 2014-10-29 15:54:24 -0700 | [diff] [blame] | 279 | return result; |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 280 | } |
| 281 | |
Thomas Vachuska | f997695 | 2014-10-24 11:55:05 -0700 | [diff] [blame] | 282 | @Override |
weibit | 00c94f5 | 2014-11-16 07:09:05 -0800 | [diff] [blame] | 283 | public Iterable<ResourceRequest> getAvailableResources(Link link, |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 284 | LinkResourceAllocations allocations) { |
Changhoon Yoon | 541ef71 | 2015-05-23 17:18:34 +0900 | [diff] [blame^] | 285 | checkPermission(Permission.LINK_READ); |
| 286 | |
weibit | 00c94f5 | 2014-11-16 07:09:05 -0800 | [diff] [blame] | 287 | Set<ResourceRequest> result = new HashSet<>(); |
| 288 | Set<ResourceAllocation> allocatedRes = allocations.getResourceAllocation(link); |
| 289 | result = (Set<ResourceRequest>) getAvailableResources(link); |
| 290 | result.addAll(allocatedRes); |
| 291 | return result; |
Thomas Vachuska | f997695 | 2014-10-24 11:55:05 -0700 | [diff] [blame] | 292 | } |
| 293 | |
Ray Milkey | e97ede9 | 2014-11-20 10:43:12 -0800 | [diff] [blame] | 294 | @Override |
| 295 | public void addListener(LinkResourceListener listener) { |
Changhoon Yoon | 541ef71 | 2015-05-23 17:18:34 +0900 | [diff] [blame^] | 296 | checkPermission(Permission.LINK_EVENT); |
| 297 | |
Ray Milkey | e97ede9 | 2014-11-20 10:43:12 -0800 | [diff] [blame] | 298 | listenerRegistry.addListener(listener); |
| 299 | } |
| 300 | |
| 301 | @Override |
| 302 | public void removeListener(LinkResourceListener listener) { |
Changhoon Yoon | 541ef71 | 2015-05-23 17:18:34 +0900 | [diff] [blame^] | 303 | checkPermission(Permission.LINK_EVENT); |
| 304 | |
Ray Milkey | e97ede9 | 2014-11-20 10:43:12 -0800 | [diff] [blame] | 305 | listenerRegistry.removeListener(listener); |
| 306 | } |
| 307 | |
| 308 | /** |
| 309 | * Posts the specified event to the local event dispatcher. |
| 310 | */ |
| 311 | private void post(LinkResourceEvent event) { |
| 312 | if (event != null) { |
| 313 | eventDispatcher.post(event); |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | /** |
| 318 | * Store delegate to re-post events emitted from the store. |
| 319 | */ |
| 320 | private class InternalStoreDelegate implements LinkResourceStoreDelegate { |
| 321 | @Override |
| 322 | public void notify(LinkResourceEvent event) { |
| 323 | post(event); |
| 324 | } |
| 325 | } |
Toshio Koide | 50df38d | 2014-10-23 10:36:51 -0700 | [diff] [blame] | 326 | } |