BUG-2218: Keep existing link augmentations during discovery process
[controller.git] / opendaylight / protocol_plugins / stub / src / main / java / org / opendaylight / controller / protocol_plugins / stub / internal / TopologyServices.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.controller.protocol_plugins.stub.internal;
10
11 import org.opendaylight.controller.sal.core.Edge;
12 import org.opendaylight.controller.sal.core.Property;
13 import org.opendaylight.controller.sal.core.UpdateType;
14 import org.opendaylight.controller.sal.topology.IPluginInTopologyService;
15 import org.opendaylight.controller.sal.topology.IPluginOutTopologyService;
16 import org.opendaylight.controller.sal.topology.TopoEdgeUpdate;
17
18 import java.util.ArrayList;
19 import java.util.List;
20 import java.util.Set;
21
22 public class TopologyServices implements IPluginInTopologyService {
23     private IPluginOutTopologyService pluginOutTopologyService;
24
25
26     @Override
27     public void sollicitRefresh() {
28     }
29
30     public void setPluginOutTopologyService(IPluginOutTopologyService pluginOutTopologyService){
31         this.pluginOutTopologyService = pluginOutTopologyService;
32     }
33
34     public void unsetPluginOutTopologyService(IPluginOutTopologyService pluginOutTopologyService){
35         this.pluginOutTopologyService = null;
36     }
37
38
39     public void addEdge(Edge edge, Set<Property> properties, UpdateType updateType){
40
41         List<TopoEdgeUpdate > topoedgeupdateList = new ArrayList<TopoEdgeUpdate>();
42
43         topoedgeupdateList.add(new TopoEdgeUpdate(edge, properties, updateType));
44
45         this.pluginOutTopologyService.edgeUpdate(topoedgeupdateList);
46
47     }
48 }