org.geoserver.platform.Service.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(87)

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

Service.<init>介绍

[英]Creates a new service descriptor.
[中]创建一个新的服务描述符。

代码示例

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

new Service(
    "directCallService",
    serviceBean,

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

protected void setUp() throws Exception {
  super.setUp();
  HelloWorld helloWorld = new HelloWorld();
  Service service =
      new Service(
          "hello",
          helloWorld,
          new Version("1.0.0"),
          Collections.singletonList("hello"));
  request =
      new MockHttpServletRequest() {
        public int getServerPort() {
          return 8080;
        }
      };
  request.setScheme("http");
  request.setServerName("localhost");
  request.setContextPath("geoserver");
  response = new MockHttpServletResponse();
  handler = new DefaultServiceExceptionHandler();
  requestInfo = new Request();
  requestInfo.setHttpRequest(request);
  requestInfo.setHttpResponse(response);
  requestInfo.setService("hello");
  requestInfo.setVersion("1.0.0");
}

代码示例来源:origin: org.geoserver.community/gs-nsg-wfs-profile

@Override
public Service serviceDispatched(Request request, Service service) throws ServiceException {
  Object req = request.getKvp().get("REQUEST");
  if ("wfs".equals(service.getId().toLowerCase()) && PAGE_RESULTS.equals(req)) {
    // allow the request to be successfully parsed as a GetFeature (needs at least a
    // typename or a featureId)
    request.getKvp().put("featureId", Collections.singletonList("dummy"));
    // replace the service
    return new Service(
        service.getId(), this.service, service.getVersion(), service.getOperations());
  }
  return service;
}

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

Operation op(String name, String service, String version, Object request) {
  return new Operation(
      name,
      new Service(service, null, new Version(version), null),
      null,
      new Object[] {request});
}

代码示例来源:origin: org.geoserver.extension/monitor-core

Operation op(String name, String service, String version, Object request) {
  return new Operation(name, new Service(service, null, new Version(version), null), 
    null, new Object[]{request});
}

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

protected void setUp() throws Exception {
  geoServerImpl = new GeoServerImpl();
  List<String> operations = new ArrayList<String>();
  csw = new Service("csw", new DefaultWebCatalogService(geoServerImpl), new Version("2.0.2"), operations); 
  params = new HashMap<String, String>();
}

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

private void invokeQualifyRequest() {
    TransactionType transactionType = Wfs20Factory.eINSTANCE.createTransactionType();
    ReplaceType replaceType = Wfs20Factory.eINSTANCE.createReplaceType();
    EList<AbstractTransactionActionType> action =
        transactionType.getAbstractTransactionAction();
    action.add(replaceType);
    replaceType.getAny().add(mockFeature);

    Version version = new Version("2.0.0");
    Service service =
        new Service("id", "service", version, Collections.singletonList("Transaction"));
    Operation operation = new Operation("id", service, null, new Object[] {transactionType});

    replay(
        mockCatalog,
        mockFeature,
        mockFeatureType,
        mockName,
        mockNamespaceInfo,
        mockWorkspaceInfo);
    sut.qualifyRequest(mockWorkspaceInfo, null, operation, null);
  }
}

代码示例来源:origin: org.geoserver.community/gs-ows-simulate

@Test
public void test() {
  Foo foo = new Foo();
  Service srv = new Service("test", null, new Version("1.0.0"), ImmutableList.of("foo"));
  Operation op = new Operation("foo", srv, null, new Object[] {foo});
  JSONObject obj =
      JSONObject.fromObject(new SimulateCallback().toJSON(op, Collections.emptyMap()));
  System.out.println(obj.toString(2));
}

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

Service serviceDesc = new Service("wms", null, null, Collections.EMPTY_LIST);
Operation opDescriptor = new Operation("", serviceDesc, null, new Object[] {gfreq});
outputFormat.write(features, out, opDescriptor);

代码示例来源:origin: org.geoserver/wms

Service serviceDesc = new Service("wms", null, null);
Operation opDescriptor = new Operation("",serviceDesc,null, new Object[] { gfreq });

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

Service serviceDesc = new Service("wms", null, null, Collections.EMPTY_LIST);
Operation opDescriptor = new Operation("", serviceDesc, null, new Object[] {gfreq});

代码示例来源:origin: org.geoserver.extension/monitor-core

new Operation("foo", new Service("bar", null, null, null), null, null));

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

new Operation(
    "DescribeFeatureType",
    new Service("WFS", null, null, null),
    null,
    new Object[] {request.getAdaptee()});

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

callback.operationDispatched(
    new Request(),
    new Operation("foo", new Service("bar", null, null, null), null, null));

代码示例来源:origin: org.geoserver.community/gs-ows-simulate

@Test
public void testFilterAsCQL() throws Exception {
  Foo foo = new Foo();
  FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
  foo.filter =
      ff.equals(
          ff.function("in", ff.literal("prop1"), ff.literal(1), ff.literal(2)),
          ff.literal(true));
  Service srv = new Service("test", null, new Version("1.0.0"), ImmutableList.of("foo"));
  Operation op = new Operation("foo", srv, null, new Object[] {foo});
  JSONObject obj =
      JSONObject.fromObject(new SimulateCallback().toJSON(op, Collections.emptyMap()));
  obj.getJSONObject("operation").getJSONObject("request").getString("filter");
}

代码示例来源:origin: org.geoserver.extension/ogr

@Override
protected void setUp() throws Exception {
  // the data source we'll use for the tests
  dataStore = new PropertyDataStore(new File("./src/test/java/org/geoserver/wfs/response"));
  // the output format (and let's add a few output formats to play with
  ogr = new Ogr2OgrOutputFormat(new GeoServerImpl());
  ogr.addFormat(new OgrFormat("KML", "OGR-KML", ".kml", true, "application/vnd.google-earth.kml"));
  ogr.addFormat(new OgrFormat("KML", "OGR-KML-ZIP", ".kml", false, "application/vnd.google-earth.kml"));
  ogr.addFormat(new OgrFormat("CSV", "OGR-CSV", ".csv", true, "text/csv"));
  ogr.addFormat(new OgrFormat("SHP", "OGR-SHP", ".shp", false, null));
  ogr.addFormat(new OgrFormat("MapInfo File", "OGR-MIF", ".mif", false, null, "-dsco", "FORMAT=MIF"));
  
  ogr.setOgrExecutable(Ogr2OgrTestUtil.getOgr2Ogr());
  ogr.setGdalData(Ogr2OgrTestUtil.getGdalData());
  // the EMF objects used to talk with the output format
  gft = WfsFactory.eINSTANCE.createGetFeatureType();
  fct = WfsFactory.eINSTANCE.createFeatureCollectionType();
  op = new Operation("GetFeature", new Service("WFS", null, new Version("1.0.0"), 
      Arrays.asList("GetFeature")), null, new Object[] { gft });
}

代码示例来源:origin: org.geoserver.extension/gs-ogr-wfs

@Before
public void setUp() throws Exception {
  // check if we can run the tests
  Assume.assumeTrue(Ogr2OgrTestUtil.isOgrAvailable());
  // the data source we'll use for the tests
  dataStore = new PropertyDataStore(new File("./src/test/java/org/geoserver/wfs/response"));
  // the output format (and let's add a few output formats to play with
  ogr = new Ogr2OgrOutputFormat(new GeoServerImpl(), new OGRWrapperFactory());
  ogr.addFormat(
      new OgrFormat("KML", "OGR-KML", ".kml", true, "application/vnd.google-earth.kml"));
  ogr.addFormat(
      new OgrFormat(
          "KML", "OGR-KML-ZIP", ".kml", false, "application/vnd.google-earth.kml"));
  ogr.addFormat(new OgrFormat("CSV", "OGR-CSV", ".csv", true, "text/csv"));
  ogr.addFormat(new OgrFormat("SHP", "OGR-SHP", ".shp", false, null));
  ogr.addFormat(
      new OgrFormat(
          "MapInfo File", "OGR-MIF", ".mif", false, null, "-dsco", "FORMAT=MIF"));
  ogr.setExecutable(Ogr2OgrTestUtil.getOgr2Ogr());
  ogr.setEnvironment(Collections.singletonMap("GDAL_DATA", Ogr2OgrTestUtil.getGdalData()));
  // the EMF objects used to talk with the output format
  gft = WfsFactory.eINSTANCE.createGetFeatureType();
  fct = WfsFactory.eINSTANCE.createFeatureCollectionType();
  op =
      new Operation(
          "GetFeature",
          new Service("WFS", null, new Version("1.0.0"), Arrays.asList("GetFeature")),
          null,
          new Object[] {gft});
}

相关文章