@Override public synchronized DataNode getRootNode() throws DataStoreException { if (rootNode == null) { rootNode = new DefaultDataNode(); final AbstractWMSCapabilities capa; try { capa = getCapabilities(); } catch (CapabilitiesException ex) { throw new DataStoreException(ex); } final List<AbstractLayer> layers = capa.getLayers(); for (AbstractLayer al : layers) { final String name = al.getName(); if (name != null) { final GenericName nn = NamesExt.valueOf(name); final CoverageReference ref = createReference(nn); rootNode.getChildren().add(ref); } } } return rootNode; }