/** * Builds a store. * * <p>The workspace of the resulting store is {@link #workspace} if set, else the default * workspace from the catalog. */ void buildStore(StoreInfo info, String name) { info.setName(name); info.setEnabled(true); // set workspace, falling back on default if none specified if (workspace != null) { info.setWorkspace(workspace); } else { info.setWorkspace(catalog.getDefaultWorkspace()); } }
/** Test that a request for a resource from a disabled store fails. */ @Test public void testRequestDisabledStore() throws Exception { Catalog catalog = getCatalog(); StoreInfo store = catalog.getStoreByName("cdf", DataStoreInfo.class); try { store.setEnabled(false); catalog.save(store); Document doc = getAsDOM( "wfs?service=WFS&version=1.0.0&request=GetFeature&typename=cdf:Fifteen"); // print(doc); XMLAssert.assertXpathEvaluatesTo("1", "count(//ogc:ServiceException)", doc); XMLAssert.assertXpathEvaluatesTo( "InvalidParameterValue", "//ogc:ServiceException/@code", doc); XMLAssert.assertXpathEvaluatesTo("typeName", "//ogc:ServiceException/@locator", doc); } finally { store.setEnabled(true); catalog.save(store); } }
si.setDescription(generalParams.description); si.getConnectionParameters().putAll(params); si.setEnabled(true); si.setType(factory.getDisplayName()); getCatalog().add(si);
void doIndirectImport(ImportTask task) throws IOException { if (!task.getStore().isEnabled()) { task.getStore().setEnabled(true);
void doIndirectImport(ImportTask task) throws IOException { if (!task.getStore().isEnabled()) { task.getStore().setEnabled(true);
StoreInfo store = new DataStoreInfoImpl(null); store.setName(resourceName + "-store"); store.setEnabled(true);