<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>
config.getName()));
}
}
+ } else {
+ // Check for conflicting names with existing cFlows
+ List<String> conflicting = new ArrayList<String>(existingNames);
+ conflicting.retainAll(proposedNames);
+ if (!conflicting.isEmpty()) {
+ return new Status(StatusCode.CONFLICT,
+ "Invalid Flow Spec configuration: flow spec name(s) conflict with existing flow specs: "
+ + conflicting.toString());
+ }
+
+ /*
+ * Check for conflicting flow spec match (we only check for strict
+ * equality). Remove this in case (*) is reintroduced
+ */
+ if (this.containerFlows != null && !this.containerFlows.isEmpty()) {
+ Set<Match> existingMatches = new HashSet<Match>();
+ for (ContainerFlowConfig existing : this.containerFlows) {
+ existingMatches.addAll(existing.getMatches());
+ }
+ for (ContainerFlowConfig proposed : cFlowConfigs) {
+ if (existingMatches.removeAll(proposed.getMatches())) {
+ return new Status(StatusCode.CONFLICT, String.format(
+ "Invalid Flow Spec configuration: %s conflicts with existing flow spec",
+ proposed.getName()));
+ }
+ }
+ }
}
+
/*
* Revisit the following flow-spec confict validation later based on more testing.
- */
- /*
+ * (*)
if (!delete) {
// Check for overlapping container flows in the request
int size = cFlowConfigs.size();
<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>
<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>\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>
--- /dev/null
+module opendaylight-group-types {
+ namespace "urn:opendaylight:group:types";
+ prefix group;
+
+ import ietf-inet-types {prefix inet;}
+ import ietf-yang-types {prefix yang;}
+ import opendaylight-flow-types {prefix flow-types;}
+
+ revision "2013-09-17" {
+ description "Initial revision of group service";
+ }
+
+ typedef group-ref {
+ type instance-identifier;
+ }
+
+ grouping group-types {
+ leaf group-type {
+ type enumeration {
+ enum group-all;
+ enum group_select;
+ enum group_indirect;
+ enum group_ff;
+ }
+ }
+ }
+
+ grouping group {
+
+ uses group-types;
+
+ leaf group-id {
+ type group-ref;
+ }
+
+ container buckets {
+ list bucket {
+ key "order";
+ leaf order {
+ type int32;
+ }
+
+ leaf weight {
+ type uint16;
+ }
+
+ leaf watch_port {
+ type uint32;
+ }
+
+ leaf watch_group {
+ type uint32;
+ }
+
+ container actions {
+ list action {
+ key "action-order";
+ leaf action-order {
+ type int32;
+ }
+
+ uses flow-types:action;
+ }
+ }
+ }
+ }
+ }
+
+ grouping group-statistics-request {
+ list group-stats {
+ key "group-id";
+
+ leaf group-id {
+ type int32;
+ }
+ }
+ }
+
+ grouping group-statistics {
+
+ leaf group-id {
+ type int32;
+ }
+
+ leaf ref-count {
+ type yang:counter32;
+ }
+
+ leaf packet-count {
+ type yang:counter64;
+ }
+
+ leaf byte-count {
+ type yang:counter64;
+ }
+
+ container duration {
+ leaf second {
+ type yang:counter32;
+ }
+ leaf nanosecond {
+ type yang:counter32;
+ }
+ }
+
+ container buckets {
+ list bucket-counter {
+ key "order";
+ leaf order {
+ type int32;
+ }
+
+ leaf packet-count {
+ type yang:counter64;
+ }
+
+ leaf byte-count {
+ type yang:counter64;
+ }
+ }
+ }
+ }
+
+ grouping group-statistics-reply {
+ list group-stats {
+ key "group-stats-order";
+ leaf group-stats-order {
+ type int32;
+ }
+
+ uses group-statistics;
+ }
+ }
+
+ grouping group-desc-stats {
+ list group-desc-stats {
+ key "order-id";
+
+ leaf order-id {
+ type int32;
+ }
+
+ uses group;
+ }
+ }
+
+ grouping group-features {
+ list group-features {
+ key "order";
+ leaf order {
+ type int32;
+ }
+
+ uses group-types;
+ type capabilities {
+ enum select-weight;
+ enum select-liveness;
+ enum chaining;
+ enum chaining-checks;
+ }
+
+ leaf-list max-groups {
+ type uint32;
+ description "Maximum number of groups for each type";
+ max-elements 4;
+ }
+
+ leaf-list actions {
+ type uint32;
+ description "Bitmap number OFPAT_* that are supported";
+ max-elements 4;
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+module sal-group {
+ namespace "urn:opendaylight:group:service";
+ prefix group;
+
+ import yang-ext {prefix ext;}
+ import opendaylight-inventory {prefix inv;}
+ import ietf-inet-types {prefix inet;}
+ import opendaylight-group-types {prefix group-type;}
+
+ revision "2013-09-17" {
+ description "Initial revision of group service";
+ }
+
+ grouping node-group {
+ leaf node {
+ type inv:node-ref;
+ }
+
+ uses group-type:group;
+ }
+
+ /** Base configuration structure **/
+ grouping group-update {
+ container original-group {
+ uses group-type:group;
+ }
+ container updated-group {
+ uses group-type:group;
+ }
+ }
+
+ rpc add-group {
+ input {
+ uses node-group;
+ }
+ }
+
+ rpc remove-group {
+ input {
+ uses node-group;
+ }
+ }
+
+ rpc update-group {
+ input {
+ uses node-group;
+ }
+ }
+}
\ No newline at end of file
<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>
<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>
import java.util.ArrayList;
import java.util.List;
-import org.opendaylight.controller.sal.core.ConstructionException;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
-import org.opendaylight.controller.sal.core.NodeConnector.NodeConnectorIDType;
import org.opendaylight.controller.sal.utils.GUIField;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
public ArrayList<NodeConnector> getPortArrayList() {
- Node node = Node.fromString(nodeId);
ArrayList<NodeConnector> portList = new ArrayList<NodeConnector>();
String[] elemArray = spanPort.split(",");
for (String elem : elemArray) {
- if (elem.contains("-")) {
- String[] limits = elem.split("-");
- for (short j = Short.valueOf(limits[0]); j <= Short
- .valueOf(limits[1]); j++) {
- try {
- portList.add(new NodeConnector(
- NodeConnectorIDType.OPENFLOW, Short.valueOf(j),
- node));
- } catch (ConstructionException e) {
- logger.error("",e);
- }
- }
- } else {
- try {
- portList.add(new NodeConnector(
- NodeConnectorIDType.OPENFLOW, Short.valueOf(elem),
- node));
- } catch (NumberFormatException e) {
- logger.error("",e);
- } catch (ConstructionException e) {
- logger.error("",e);
- }
+ NodeConnector nodeConnector = NodeConnector.fromString(elem);
+ if (nodeConnector != null) {
+ portList.add(nodeConnector);
}
}
return portList;
<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>