gpt4 book ai didi

org.geoserver.catalog.WMTSStoreInfo类的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 11:57:05 25 4
gpt4 key购买 nike

本文整理了Java中org.geoserver.catalog.WMTSStoreInfo类的一些代码示例,展示了WMTSStoreInfo类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WMTSStoreInfo类的具体详情如下:
包路径:org.geoserver.catalog.WMTSStoreInfo
类名称:WMTSStoreInfo

WMTSStoreInfo介绍

[英]A store backed by a WebMapTileServer, allows for WMTS cascading
[中]由WebMapTileServer支持的商店允许WMT级联

代码示例

代码示例来源:origin: geoserver/geoserver

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;
}

代码示例来源:origin: geoserver/geoserver

@Override
public WebMapTileServer getWebMapTileServer(ProgressListener listener) throws IOException {
  return delegate.getWebMapTileServer(listener);
}

代码示例来源:origin: geoserver/geoserver

EntityResolver entityResolver = getEntityResolver();
String id = info.getId();
WebMapTileServer wmts = wmtsCache.get(id);
    if (wmts == null) {
      HTTPClient client = getHTTPClient(expandedStore);
      String capabilitiesURL = expandedStore.getCapabilitiesURL();
      URL serverURL = new URL(capabilitiesURL);
      wmts = new WebMapTileServer(serverURL, client, null);
      if (StringUtils.isNotEmpty(info.getHeaderName())
          && StringUtils.isNotEmpty(info.getHeaderValue())) {
        wmts.getHeaders().put(info.getHeaderName(), info.getHeaderValue());

代码示例来源:origin: geoserver/geoserver

/**
 * @param source
 * @param target
 */
private void setConnectionParameters(final WMTSStoreInfo source, WMTSStoreInfo target) {
  target.setCapabilitiesURL(source.getCapabilitiesURL());
  target.setUsername(source.getUsername());
  target.setPassword(source.getPassword());
  target.setUseConnectionPooling(source.isUseConnectionPooling());
  target.setMaxConnections(source.getMaxConnections());
  target.setConnectTimeout(source.getConnectTimeout());
  target.setReadTimeout(source.getReadTimeout());
}

代码示例来源:origin: geoserver/geoserver

wmtss.setName("wmtsName");
wmtss.setType("WMTS");
wmtss.setCapabilitiesURL("http://fake.wmts.url");
wmtss.setWorkspace(ws);

代码示例来源:origin: org.geoserver/gs-restconfig

UriComponentsBuilder builder) {
if (store.getWorkspace() != null) {
  WorkspaceInfo ws = store.getWorkspace();
  if (!workspaceName.equals(ws.getName())) {
    throw new RestException(
  store.setWorkspace(catalog.getWorkspaceByName(workspaceName));
store.setEnabled(true);
String storeName = store.getName();
LOGGER.info("POST wmts store " + storeName);
UriComponents uriComponents =

代码示例来源:origin: org.geoserver/gs-restconfig

@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());
}

代码示例来源:origin: org.geoserver/gs-restconfig

if (info.getWorkspace() != null && !original.getWorkspace().equals(info.getWorkspace())) {
  throw new RestException(
      "Attempting to move "
          + storeName
          + " from "
          + original.getWorkspace().getName()
          + " to "
          + info.getWorkspace().getName()
          + " via PUT",
      HttpStatus.FORBIDDEN);
if (!original.getName().equals(info.getName())) {
  throw new RestException(
      "Attempting to rename " + storeName + " to " + info.getName() + " via PUT",
      HttpStatus.FORBIDDEN);

代码示例来源:origin: geoserver/geoserver

public String getName() {
  return delegate.getName();
}

代码示例来源:origin: geoserver/geoserver

public String getCapabilitiesURL() {
  return delegate.getCapabilitiesURL();
}

代码示例来源:origin: geoserver/geoserver

wmts.setWorkspace(ws);
wmts.setName("foo");
wmts.setCapabilitiesURL("http://fake.host/wmts?request=getCapabilities");
catalog.add(wmts);

代码示例来源:origin: geoserver/geoserver

@Test
public void testAddWMTSStore() {
  assertTrue(catalog.getStores(WMTSStoreInfo.class).isEmpty());
  addWMTSStore();
  assertEquals(1, catalog.getStores(WMTSStoreInfo.class).size());
  WMTSStoreInfo retrieved = catalog.getStore(wmtss.getId(), WMTSStoreInfo.class);
  assertNotNull(retrieved);
  WMTSStoreInfo wmts2 = catalog.getFactory().createWebMapTileServer();
  wmts2.setName("wmts2Name");
  wmts2.setWorkspace(ws);
  catalog.add(wmts2);
  assertEquals(2, catalog.getStores(WMTSStoreInfo.class).size());
}

代码示例来源:origin: geoserver/geoserver

@Test
public void testModifyWMTSStore() throws Exception {
  testAddWMTSStore();
  WMTSStoreInfo wmts = catalog.getStoreByName("acme", "demowmts", WMTSStoreInfo.class);
  assertNull(wmts.getCapabilitiesURL());
  String capsURL =
      "http://demo.opengeo.org:8080/geoserver/gwc?request=GetCapabilites&service=WMTS";
  wmts.setCapabilitiesURL(capsURL);
  catalog.save(wmts);
  File f =
      new File(testData.getDataDirectoryRoot(), "workspaces/acme/demowmts/wmtsstore.xml");
  Document dom = dom(f);
  assertXpathEvaluatesTo(capsURL, "/wmtsStore/capabilitiesURL/text()", dom);
}

代码示例来源:origin: geoserver/geoserver

public void setCapabilitiesURL(String url) {
  delegate.setCapabilitiesURL(url);
}

代码示例来源:origin: org.geoserver.web/gs-web-core

LOGGER.log(Level.INFO, "Adding the store for " + info.getCapabilitiesURL(), e);
  throw new IllegalArgumentException(
      "The WMTS store could not be saved. Failure message: " + e.getMessage());
try {
  layerChooserPage = new NewLayerPage(savedStore.getId());
} catch (RuntimeException e) {
  LOGGER.log(
      Level.INFO,
      "Getting list of layers for the WMTS store " + info.getCapabilitiesURL(),
      e);

代码示例来源:origin: geoserver/geoserver

@Test
public void testAddWMTSStore() throws Exception {
  testAddWorkspace();
  File dir = new File(testData.getDataDirectoryRoot(), "workspaces/acme/demowmts");
  assertFalse(dir.exists());
  WMTSStoreInfo wmts = catalog.getFactory().createWebMapTileServer();
  wmts.setName("demowmts");
  wmts.setWorkspace(catalog.getWorkspaceByName("acme"));
  catalog.add(wmts);
  assertTrue(dir.exists());
  assertTrue(new File(dir, "wmtsstore.xml").exists());
}

代码示例来源:origin: geoserver/geoserver

public void setEnabled(boolean enabled) {
  delegate.setEnabled(enabled);
}

代码示例来源:origin: geoserver/geoserver

public void setWorkspace(WorkspaceInfo workspace) {
  delegate.setWorkspace(workspace);
}

代码示例来源:origin: geoserver/geoserver

public String getId() {
  return delegate.getId();
}

代码示例来源:origin: geoserver/geoserver

public boolean isEnabled() {
  return delegate.isEnabled();
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com