Committed by
Gerrit Code Review
ONOS-3786 deletePort from specific bridge method and correct bridge name retrivi…
…al call in old add and delete ports of OsvdbBridgeConfig Change-Id: Ib23b90f7793f3afc5d62250b9f1f318b8042ad77
Showing
2 changed files
with
26 additions
and
2 deletions
| ... | @@ -71,6 +71,7 @@ public interface BridgeConfig extends HandlerBehaviour { | ... | @@ -71,6 +71,7 @@ public interface BridgeConfig extends HandlerBehaviour { |
| 71 | 71 | ||
| 72 | /** | 72 | /** |
| 73 | * Add a logical/virtual port. | 73 | * Add a logical/virtual port. |
| 74 | + * @deprecated version 1.5.0 - Falcon. | ||
| 74 | * | 75 | * |
| 75 | * @param port port number | 76 | * @param port port number |
| 76 | */ | 77 | */ |
| ... | @@ -87,12 +88,22 @@ public interface BridgeConfig extends HandlerBehaviour { | ... | @@ -87,12 +88,22 @@ public interface BridgeConfig extends HandlerBehaviour { |
| 87 | 88 | ||
| 88 | /** | 89 | /** |
| 89 | * Delete a logical/virtual port. | 90 | * Delete a logical/virtual port. |
| 91 | + * @deprecated version 1.5.0 - Falcon. | ||
| 90 | * | 92 | * |
| 91 | * @param port port number | 93 | * @param port port number |
| 92 | */ | 94 | */ |
| 95 | + @Deprecated | ||
| 93 | void deletePort(PortDescription port); | 96 | void deletePort(PortDescription port); |
| 94 | 97 | ||
| 95 | /** | 98 | /** |
| 99 | + * Removes a port from a given bridge. | ||
| 100 | + * | ||
| 101 | + * @param bridgeName bridge name | ||
| 102 | + * @param portName port name | ||
| 103 | + */ | ||
| 104 | + void deletePort(BridgeName bridgeName, String portName); | ||
| 105 | + | ||
| 106 | + /** | ||
| 96 | * Delete a logical/virtual port. | 107 | * Delete a logical/virtual port. |
| 97 | * | 108 | * |
| 98 | * @return collection of port | 109 | * @return collection of port | ... | ... |
| ... | @@ -16,6 +16,7 @@ | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | ||
| 17 | package org.onosproject.drivers.ovsdb; | 17 | package org.onosproject.drivers.ovsdb; |
| 18 | 18 | ||
| 19 | + | ||
| 19 | import org.onlab.packet.IpAddress; | 20 | import org.onlab.packet.IpAddress; |
| 20 | import org.onosproject.net.DefaultAnnotations; | 21 | import org.onosproject.net.DefaultAnnotations; |
| 21 | import org.onosproject.net.DeviceId; | 22 | import org.onosproject.net.DeviceId; |
| ... | @@ -41,6 +42,7 @@ import java.util.List; | ... | @@ -41,6 +42,7 @@ import java.util.List; |
| 41 | import java.util.Set; | 42 | import java.util.Set; |
| 42 | import java.util.stream.Collectors; | 43 | import java.util.stream.Collectors; |
| 43 | 44 | ||
| 45 | + | ||
| 44 | /** | 46 | /** |
| 45 | * The implementation of BridageConfig. | 47 | * The implementation of BridageConfig. |
| 46 | */ | 48 | */ |
| ... | @@ -92,6 +94,8 @@ public class OvsdbBridgeConfig extends AbstractHandlerBehaviour | ... | @@ -92,6 +94,8 @@ public class OvsdbBridgeConfig extends AbstractHandlerBehaviour |
| 92 | .collect(Collectors.toSet()); | 94 | .collect(Collectors.toSet()); |
| 93 | } | 95 | } |
| 94 | 96 | ||
| 97 | + //Deprecated from version 1.5.0 - Falcon | ||
| 98 | + @Deprecated | ||
| 95 | @Override | 99 | @Override |
| 96 | public void addPort(PortDescription port) { | 100 | public void addPort(PortDescription port) { |
| 97 | DriverHandler handler = handler(); | 101 | DriverHandler handler = handler(); |
| ... | @@ -99,7 +103,7 @@ public class OvsdbBridgeConfig extends AbstractHandlerBehaviour | ... | @@ -99,7 +103,7 @@ public class OvsdbBridgeConfig extends AbstractHandlerBehaviour |
| 99 | Set<OvsdbBridge> ovsdbSet = clientService.getBridges(); | 103 | Set<OvsdbBridge> ovsdbSet = clientService.getBridges(); |
| 100 | if (ovsdbSet != null && ovsdbSet.size() > 0) { | 104 | if (ovsdbSet != null && ovsdbSet.size() > 0) { |
| 101 | OvsdbBridge bridge = ovsdbSet.iterator().next(); | 105 | OvsdbBridge bridge = ovsdbSet.iterator().next(); |
| 102 | - clientService.createPort(bridge.bridgeName().toString(), port | 106 | + clientService.createPort(bridge.bridgeName().value(), port |
| 103 | .portNumber().toString()); | 107 | .portNumber().toString()); |
| 104 | } | 108 | } |
| 105 | } | 109 | } |
| ... | @@ -111,6 +115,8 @@ public class OvsdbBridgeConfig extends AbstractHandlerBehaviour | ... | @@ -111,6 +115,8 @@ public class OvsdbBridgeConfig extends AbstractHandlerBehaviour |
| 111 | clientService.createPort(bridgeName.name(), portName); | 115 | clientService.createPort(bridgeName.name(), portName); |
| 112 | } | 116 | } |
| 113 | 117 | ||
| 118 | + //Deprecated from version 1.5.0 - Falcon | ||
| 119 | + @Deprecated | ||
| 114 | @Override | 120 | @Override |
| 115 | public void deletePort(PortDescription port) { | 121 | public void deletePort(PortDescription port) { |
| 116 | DriverHandler handler = handler(); | 122 | DriverHandler handler = handler(); |
| ... | @@ -118,12 +124,19 @@ public class OvsdbBridgeConfig extends AbstractHandlerBehaviour | ... | @@ -118,12 +124,19 @@ public class OvsdbBridgeConfig extends AbstractHandlerBehaviour |
| 118 | Set<OvsdbBridge> ovsdbSet = clientService.getBridges(); | 124 | Set<OvsdbBridge> ovsdbSet = clientService.getBridges(); |
| 119 | if (ovsdbSet != null && ovsdbSet.size() > 0) { | 125 | if (ovsdbSet != null && ovsdbSet.size() > 0) { |
| 120 | OvsdbBridge bridge = ovsdbSet.iterator().next(); | 126 | OvsdbBridge bridge = ovsdbSet.iterator().next(); |
| 121 | - clientService.dropPort(bridge.bridgeName().toString(), port | 127 | + clientService.dropPort(bridge.bridgeName().value(), port |
| 122 | .portNumber().toString()); | 128 | .portNumber().toString()); |
| 123 | } | 129 | } |
| 124 | } | 130 | } |
| 125 | 131 | ||
| 126 | @Override | 132 | @Override |
| 133 | + public void deletePort(BridgeName bridgeName, String portName) { | ||
| 134 | + DriverHandler handler = handler(); | ||
| 135 | + OvsdbClientService clientService = getOvsdbClientService(handler); | ||
| 136 | + clientService.dropPort(bridgeName.name(), portName); | ||
| 137 | + } | ||
| 138 | + | ||
| 139 | + @Override | ||
| 127 | public Collection<PortDescription> getPorts() { | 140 | public Collection<PortDescription> getPorts() { |
| 128 | DriverHandler handler = handler(); | 141 | DriverHandler handler = handler(); |
| 129 | OvsdbClientService clientService = getOvsdbClientService(handler); | 142 | OvsdbClientService clientService = getOvsdbClientService(handler); | ... | ... |
-
Please register or login to post a comment