+/*
+ * Copyright (c) 2014, 2015 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
package org.opendaylight.ovsdb.northbound;
import com.fasterxml.jackson.databind.SerializationFeature;
import java.io.InputStream;
+import java.util.Collections;
import java.util.List;
import javax.ws.rs.Consumes;
public Response getNodes() throws JsonProcessingException {
OvsdbConnectionService connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
List<Node> nodes = connectionService.getNodes();
- if (nodes == null) return Response.noContent().build();
+ if (nodes == null) {
+ return Response.noContent().build();
+ }
List<String> nodeIds = Lists.newArrayList();
for (Node node : nodes) {
nodeIds.add(node.getId().getValue());
}
+ Collections.sort(nodeIds);
String response = objectMapper.writeValueAsString(nodeIds);
return Response.status(Response.Status.OK)