public DataAccess<?, ?> access(Name name) { String workspace = name.getNamespaceURI(); String localName = name.getLocalPart(); DataStoreInfo info = getCatalog().getDataStoreByName(workspace, localName); if (info == null) { info = getCatalog().getDataStoreByName(localName); if (info == null) { return null; } } try { return info.getDataStore(null); } catch (IOException ex) { throw new RuntimeException(ex); } }
public List<DataStore> getDataStores() { List<DataStore> dataStores = new ArrayList<DataStore>(); for (DataStoreInfo ds : getCatalog().getDataStores()) { if (!ds.isEnabled()) { continue; } try { DataAccess da = ds.getDataStore(null); if (da instanceof DataStore) { dataStores.add((DataStore) da); } } catch (IOException e) { LOGGER.log(Level.WARNING, "Unable to get datastore '" + ds.getName() + "'", e); } } return dataStores; }