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;
*/
@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;
- /** The Constant regexName. */
- private static final String regexName = "^[\\w-+.@]+$";
-
/** Flow Spec name. */
@XmlElement
private String name;
* @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.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
*