public void setEnabled(boolean enabled) { delegate.setEnabled(enabled); }
public WMTSStoreInfo clone(final WMTSStoreInfo source, boolean allowEnvParametrization) { WMTSStoreInfo target; try { target = (WMTSStoreInfo) SerializationUtils.clone(source); if (target instanceof StoreInfoImpl && target.getCatalog() == null) { ((StoreInfoImpl) target).setCatalog(catalog); } } catch (Exception e) { target = catalog.getFactory().createWebMapTileServer(); target.setDescription(source.getDescription()); target.setEnabled(source.isEnabled()); target.setName(source.getName()); target.setType(source.getType()); target.setWorkspace(source.getWorkspace()); } setConnectionParameters(source, target); if (allowEnvParametrization) { // Resolve GeoServer Environment placeholders final GeoServerEnvironment gsEnvironment = GeoServerExtensions.bean(GeoServerEnvironment.class); if (gsEnvironment != null && GeoServerEnvironment.ALLOW_ENV_PARAMETRIZATION) { target.setCapabilitiesURL( (String) gsEnvironment.resolveValue(source.getCapabilitiesURL())); target.setUsername((String) gsEnvironment.resolveValue(source.getUsername())); target.setPassword((String) gsEnvironment.resolveValue(source.getPassword())); } } return target; }
store.setWorkspace(catalog.getWorkspaceByName(workspaceName)); store.setEnabled(true);
store.setWorkspace(workspace); store.setType("WMTS"); store.setEnabled(true); store.setName("wmts"); store.setCapabilitiesURL(capabilities);
@Test public void testPutNonDestructive() throws Exception { WMTSStoreInfo wsi = catalog.getStoreByName("sf", "demo", WMTSStoreInfo.class); wsi.setEnabled(true); catalog.save(wsi); assertTrue(wsi.isEnabled()); int maxConnections = wsi.getMaxConnections(); int readTimeout = wsi.getReadTimeout(); int connectTimeout = wsi.getConnectTimeout(); boolean useConnectionPooling = wsi.isUseConnectionPooling(); String xml = "<wmtsStore>" + "<name>demo</name>" + "</wmtsStore>"; MockHttpServletResponse response = putAsServletResponse( RestBaseController.ROOT_PATH + "/workspaces/sf/wmtsstores/demo", xml, "text/xml"); assertEquals(200, response.getStatus()); wsi = catalog.getStoreByName("sf", "demo", WMTSStoreInfo.class); assertTrue(wsi.isEnabled()); assertEquals(maxConnections, wsi.getMaxConnections()); assertEquals(readTimeout, wsi.getReadTimeout()); assertEquals(connectTimeout, wsi.getConnectTimeout()); assertEquals(useConnectionPooling, wsi.isUseConnectionPooling()); }