<sonar.language>java</sonar.language>
</properties>
<build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.5.3.201107060350</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.5.3.201107060350</version>
+ <version>${jacoco.version}</version>
<configuration>
<destFile>../implementation/target/jacoco-it.exec</destFile>
<includes>org.opendaylight.controller.*</includes>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.5.3.201107060350</version>
+ <version>${jacoco.version}</version>
</plugin>
</plugins>
</pluginManagement>
<sample-toaster.version>1.0-SNAPSHOT</sample-toaster.version>
<releaseplugin.version>2.3.2</releaseplugin.version>
<commons.lang.version>3.1</commons.lang.version>
+ <jacoco.version>0.5.3.201107060350</jacoco.version>
</properties>
<pluginRepositories>
@Override
public boolean doesContainerExist(String ContainerId) {
- // TODO Auto-generated method stub
- return false;
+ return GlobalConstants.DEFAULT.toString().equalsIgnoreCase(ContainerId);
}
@Override
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.5.3.201107060350</version>
+ <version>${jacoco.version}</version>
</plugin>
</plugins>
</pluginManagement>
}
}
if (target != null) {
- // Program the network node
- Status status = (target.installInHw()) ? this.uninstallFlowEntry(target.getFlowEntry()) : this
- .installFlowEntry(target.getFlowEntry());
+ Status status = target.validate(container);
+ if (!status.isSuccess()) {
+ log.warn(status.getDescription());
+ return status;
+ }
+ status = (target.installInHw()) ? this.uninstallFlowEntry(target.getFlowEntry()) : this
+ .installFlowEntry(target.getFlowEntry());
if (status.isSuccess()) {
// Update Configuration database
target.setStatus(SUCCESS);
<sonar.language>java</sonar.language>
</properties>
<build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.5.3.201107060350</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.5.3.201107060350</version>
+ <version>${jacoco.version}</version>
<configuration>
<destFile>../implementation/target/jacoco-it.exec</destFile>
<includes>org.opendaylight.controller.*</includes>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.5.3.201107060350</version>
+ <version>${jacoco.version}</version>
</plugin>
</plugins>
</pluginManagement>
</properties>\r
\r
<build>\r
+ <pluginManagement>\r
+ <plugins>\r
+ <plugin>\r
+ <groupId>org.jacoco</groupId>\r
+ <artifactId>jacoco-maven-plugin</artifactId>\r
+ <version>0.5.3.201107060350</version>\r
+ </plugin>\r
+ </plugins>\r
+ </pluginManagement>\r
<plugins>\r
<plugin>\r
<groupId>org.jacoco</groupId>\r
<artifactId>jacoco-maven-plugin</artifactId>\r
- <version>0.5.3.201107060350</version>\r
+ <version>${jacoco.version}</version>\r
<configuration>\r
<destFile>../implementation/target/jacoco-it.exec</destFile>\r
<includes>org.opendaylight.controller.*</includes>\r
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.5.3.201107060350</version>
+ <version>${jacoco.version}</version>
</plugin>
</plugins>
</pluginManagement>
* until the Barrier reply arrives.
*/
public Object asyncSendBarrierMessage();
+
+ /**
+ * Send a FLOW_MOD message with a wildcard match and action=DELETE.
+ */
+ public void deleteAllFlows();
}
// send feature request
OFMessage featureRequest = factory.getMessage(OFType.FEATURES_REQUEST);
asyncFastSend(featureRequest);
- // delete all pre-existing flows
- OFMatch match = new OFMatch().setWildcards(OFMatch.OFPFW_ALL);
- OFFlowMod flowMod = (OFFlowMod) factory.getMessage(OFType.FLOW_MOD);
- flowMod.setMatch(match).setCommand(OFFlowMod.OFPFC_DELETE).setOutPort(OFPort.OFPP_NONE)
- .setLength((short) OFFlowMod.MINIMUM_LENGTH);
- asyncFastSend(flowMod);
this.state = SwitchState.WAIT_FEATURES_REPLY;
startSwitchTimer();
break;
return result;
}
}
+
+ @Override
+ public void deleteAllFlows() {
+ logger.trace("deleteAllFlows on switch {}", HexString.toHexString(this.sid));
+ OFMatch match = new OFMatch().setWildcards(OFMatch.OFPFW_ALL);
+ OFFlowMod flowMod = (OFFlowMod) factory.getMessage(OFType.FLOW_MOD);
+ flowMod.setMatch(match).setCommand(OFFlowMod.OFPFC_DELETE).setOutPort(OFPort.OFPP_NONE)
+ .setLength((short) OFFlowMod.MINIMUM_LENGTH);
+ asyncFastSend(flowMod);
+ }
}
if (sw == null) {
return;
}
+ Node node = NodeCreator.createOFNode(sw.getId());
+ if ((nodeProps.get(node) != null) && (connectionOutService.isLocal(node))) {
+ logger.debug("Ignore switchAdded {}", sw);
+ return;
+ }
// Add all the nodeConnectors of this switch
Map<NodeConnector, Set<Property>> ncProps = InventoryServiceHelper
for (String container : containers) {
notifyInventoryShimInternalListener(container, node, type, props);
}
-
// Notify external listener
notifyInventoryShimExternalListener(node, type, props);
props.add(b);
}
+ if ((nodeProps.get(node) == null) && (connectionOutService.isLocal(node))) {
+ // The switch is connected for the first time, flush all flows
+ // that may exist on this switch
+ sw.deleteAllFlows();
+ }
nodeProps.put(node, props);
// Notify all internal and external listeners
notifyInventoryShimListener(node, type, props);
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.5.3.201107060350</version>
+ <version>${jacoco.version}</version>
</plugin>
</plugins>
</pluginManagement>
<sonar.language>java</sonar.language>
</properties>
<build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.5.3.201107060350</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.5.3.201107060350</version>
+ <version>${jacoco.version}</version>
<configuration>
<destFile>../implementation/target/jacoco-it.exec</destFile>
<includes>org.opendaylight.controller.*</includes>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.5.3.201107060350</version>
+ <version>${jacoco.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.5.3.201107060350</version>
+ <version>${jacoco.version}</version>
</plugin>
</plugins>
</pluginManagement>
</properties>
<build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <version>0.5.3.201107060350</version>
- </plugin>
- </plugins>
- </pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <version>0.5.3.201107060350</version>
+ <version>${jacoco.version}</version>
<configuration>
<destFile>../implementation/target/jacoco-it.exec</destFile>
<includes>org.opendaylight.controller.*</includes>