Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Remove powermock dependency from md-sal."
[controller.git]
/
opendaylight
/
containermanager
/
api
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
containermanager
/
ContainerFlowConfig.java
diff --git
a/opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/ContainerFlowConfig.java
b/opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/ContainerFlowConfig.java
index 9d65ad343c4c540e2d93d750524becac00a3e9b8..6abd1acd404956db9f3c0819109154ac85b1717d 100644
(file)
--- a/
opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/ContainerFlowConfig.java
+++ b/
opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/ContainerFlowConfig.java
@@
-24,6
+24,7
@@
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
+import org.opendaylight.controller.configuration.ConfigurationObject;
import org.opendaylight.controller.sal.match.Match;
import org.opendaylight.controller.sal.match.MatchType;
import org.opendaylight.controller.sal.packet.BitBufferHelper;
import org.opendaylight.controller.sal.match.Match;
import org.opendaylight.controller.sal.match.MatchType;
import org.opendaylight.controller.sal.packet.BitBufferHelper;
@@
-44,15
+45,12
@@
import org.slf4j.LoggerFactory;
*/
@XmlRootElement (name = "flow-spec-config")
@XmlAccessorType(XmlAccessType.NONE)
*/
@XmlRootElement (name = "flow-spec-config")
@XmlAccessorType(XmlAccessType.NONE)
-public class ContainerFlowConfig implements Serializable {
+public class ContainerFlowConfig
extends ConfigurationObject
implements Serializable {
private static Logger log = LoggerFactory.getLogger(ContainerFlowConfig.class);
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
private static Logger log = LoggerFactory.getLogger(ContainerFlowConfig.class);
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
- /** The Constant regexName. */
- private static final String regexName = "^[\\w-+.@]+$";
-
/** Flow Spec name. */
@XmlElement
private String name;
/** Flow Spec name. */
@XmlElement
private String name;
@@
-596,7
+594,7
@@
public class ContainerFlowConfig implements Serializable {
* @return true, if is valid
*/
public Status validate() {
* @return true, if is valid
*/
public Status validate() {
- if (!
hasValidName(
)) {
+ if (!
isValidResourceName(name
)) {
return new Status(StatusCode.BADREQUEST, "Invalid name");
}
Status status = validateVlan();
return new Status(StatusCode.BADREQUEST, "Invalid name");
}
Status status = validateVlan();
@@
-619,15
+617,6
@@
public class ContainerFlowConfig implements Serializable {
return new Status(StatusCode.SUCCESS);
}
return new Status(StatusCode.SUCCESS);
}
- /**
- * Checks if this flow specification configuration has a valid name.
- *
- * @return true, if successful
- */
- private boolean hasValidName() {
- return (name != null && !name.isEmpty() && name.matches(regexName));
- }
-
/**
* Validates the vlan number
*
/**
* Validates the vlan number
*