import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.codehaus.jackson.map.ObjectMapper;
+import com.fasterxml.jackson.databind.ObjectMapper;
import org.opendaylight.controller.connectionmanager.IConnectionManager;
import org.opendaylight.controller.forwarding.staticrouting.IForwardingStaticRouting;
import org.opendaylight.controller.forwarding.staticrouting.StaticRouteConfig;
Set<Node> nodes = connectionManager.getLocalNodes();
List<NodeJsonBean> result = new LinkedList<NodeJsonBean>();
+ if (nodes == null) {
+ return result;
+ }
for (Node node : nodes) {
Description descriptionProperty = (Description) switchManager.getNodeProp(node, "description");
- String description = descriptionProperty.getValue();
+ String description = node.toString();
+ if (descriptionProperty != null) {
+ description = descriptionProperty.getValue();
+ }
NodeJsonBean nodeBean = new NodeJsonBean();
nodeBean.setNodeId(node.getNodeIDString());
nodeBean.setNodeType(node.getType());
return "forward:" + "/";
}
-}
\ No newline at end of file
+}