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 "Prevent ConfigPusher from killing its thread"
[controller.git]
/
opendaylight
/
topologymanager
/
implementation
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
topologymanager
/
TopologyUserLinkConfig.java
diff --git
a/opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/TopologyUserLinkConfig.java
b/opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/TopologyUserLinkConfig.java
index 1b1e6f49d153d3b57ccfeb8e120bf2c3d6c7581d..3532ab78e0f10b2c4b4f428abc7b234c136b9b78 100644
(file)
--- a/
opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/TopologyUserLinkConfig.java
+++ b/
opendaylight/topologymanager/implementation/src/main/java/org/opendaylight/controller/topologymanager/TopologyUserLinkConfig.java
@@
-16,6
+16,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.core.NodeConnector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.controller.sal.core.NodeConnector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@
-25,7
+26,7
@@
import org.slf4j.LoggerFactory;
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class TopologyUserLinkConfig implements Serializable {
+public class TopologyUserLinkConfig
extends ConfigurationObject
implements Serializable {
private static final long serialVersionUID = 1L;
private static final Logger logger = LoggerFactory.getLogger(TopologyUserLinkConfig.class);
private static final long serialVersionUID = 1L;
private static final Logger logger = LoggerFactory.getLogger(TopologyUserLinkConfig.class);
@@
-38,19
+39,24
@@
public class TopologyUserLinkConfig implements Serializable {
private String name;
private String name;
+ @Override
public String toString() {
return name;
}
public static STATUS fromString(String str) {
public String toString() {
return name;
}
public static STATUS fromString(String str) {
- if (str == null)
+ if (str == null)
{
return LINKDOWN;
return LINKDOWN;
- if (str.equals(SUCCESS.toString()))
+ }
+ if (str.equals(SUCCESS.toString())) {
return SUCCESS;
return SUCCESS;
- if (str.equals(LINKDOWN.toString()))
+ }
+ if (str.equals(LINKDOWN.toString())) {
return LINKDOWN;
return LINKDOWN;
- if (str.equals(INCORRECT.toString()))
+ }
+ if (str.equals(INCORRECT.toString())) {
return INCORRECT;
return INCORRECT;
+ }
return LINKDOWN;
}
}
return LINKDOWN;
}
}
@@
-111,19
+117,18
@@
public class TopologyUserLinkConfig implements Serializable {
}
public boolean isValidNodeConnector(String nodeConnectorStr) {
}
public boolean isValidNodeConnector(String nodeConnectorStr) {
- NodeConnector nc = NodeConnector.fromString(nodeConnectorStr);
- if (nc == null) return false;
- return true;
+ return (NodeConnector.fromString(nodeConnectorStr) != null);
}
public boolean isValid() {
}
public boolean isValid() {
- if (name == null || srcNodeConnector == null || dstNodeConnector == null) {
+ if (!isValidResourceName(name)) {
+ logger.debug("Invalid name in user link: {}", name);
return false;
}
if (!isValidNodeConnector(srcNodeConnector) ||
!isValidNodeConnector(dstNodeConnector)) {
return false;
}
if (!isValidNodeConnector(srcNodeConnector) ||
!isValidNodeConnector(dstNodeConnector)) {
- logger.debug("Invalid NodeConnector in user link: {}",
this
);
+ logger.debug("Invalid NodeConnector in user link: {}",
name
);
return false;
}
return false;
}
@@
-146,23
+151,30
@@
public class TopologyUserLinkConfig implements Serializable {
@Override
public boolean equals(Object obj) {
@Override
public boolean equals(Object obj) {
- if (this == obj)
+ if (this == obj)
{
return true;
return true;
- if (obj == null)
+ }
+ if (obj == null) {
return false;
return false;
- if (getClass() != obj.getClass())
+ }
+ if (getClass() != obj.getClass()) {
return false;
return false;
+ }
TopologyUserLinkConfig other = (TopologyUserLinkConfig) obj;
if (dstNodeConnector == null) {
TopologyUserLinkConfig other = (TopologyUserLinkConfig) obj;
if (dstNodeConnector == null) {
- if (other.dstNodeConnector != null)
+ if (other.dstNodeConnector != null)
{
return false;
return false;
- } else if (!dstNodeConnector.equals(other.dstNodeConnector))
+ }
+ } else if (!dstNodeConnector.equals(other.dstNodeConnector)) {
return false;
return false;
+ }
if (srcNodeConnector == null) {
if (srcNodeConnector == null) {
- if (other.srcNodeConnector != null)
+ if (other.srcNodeConnector != null)
{
return false;
return false;
- } else if (!srcNodeConnector.equals(other.srcNodeConnector))
+ }
+ } else if (!srcNodeConnector.equals(other.srcNodeConnector)) {
return false;
return false;
+ }
return true;
}
return true;
}