import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import org.opendaylight.controller.config.api.jmx.ObjectNameUtil;
import org.opendaylight.controller.config.util.AttributeEntry;
+
abstract class ListableJolokiaClient {
protected final J4pClient j4pClient;
protected final String url;
J4pResponse<J4pListRequest> response = execute(req);
JSONObject listJSONResponse = response.getValue();
JSONObject attributes = (JSONObject) listJSONResponse.get("attr");
- Map<String, JSONObject> listMap = new HashMap<String, JSONObject>();
+
+ // Empty attributes list
+ if(attributes == null)
+ return Collections.emptyMap();
+
+ Map<String, JSONObject> listMap = new HashMap<>();
+
for (Object entryObject : attributes.entrySet()) {
Entry<String, Object> entry = (Entry<String, Object>) entryObject;
JSONObject entryVal = (JSONObject) entry.getValue();