Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added dispatcher and output format #1

Open
wants to merge 16 commits into
base: ogc-nsg-profile
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/en/user/source/community/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ officially part of the GeoServer releases. They are however built along with the
onelogin/index
wmts-multidimensional/index
notification/index
nsg-profile/index
12 changes: 12 additions & 0 deletions doc/en/user/source/community/nsg-profile/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _community_nsg_profile:

NSG Profile
===========


Index Result Type
-----------------


PageResults Operation
---------------------
95 changes: 95 additions & 0 deletions src/community/nsg-profile/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geoserver</groupId>
<artifactId>community</artifactId>
<version>2.12-SNAPSHOT</version>
</parent>
<groupId>org.geoserver.community</groupId>
<artifactId>gs-nsg-profile</artifactId>
<packaging>jar</packaging>
<version>2.12-SNAPSHOT</version>
<name>NSG Profile</name>
<dependencies>
<!-- geoserver dependencies -->
<dependency>
<groupId>org.geoserver</groupId>
<artifactId>gs-main</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.geoserver</groupId>
<artifactId>gs-wfs</artifactId>
</dependency>
<dependency>
<groupId>org.geoserver.web</groupId>
<artifactId>gs-web-core</artifactId>
</dependency>
<!-- geotools dependencies -->
<dependency>
<groupId>org.geotools.jdbc</groupId>
<artifactId>gt-jdbc-h2</artifactId>
</dependency>
<!-- emf dependencies-->
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.xmi</artifactId>
<version>2.12.0</version>
</dependency>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to declare the version here (and it should not be done here anyway), GS root pom.xml dependency-management section already declare this dependency with the same version.

All dependencies should always be declared on the root pom.xml dependency management section to force every core module, extension and community module to sue the same version.

<!-- geoserver tests dependencies -->
<dependency>
<groupId>org.geoserver</groupId>
<artifactId>gs-wfs</artifactId>
<classifier>tests</classifier>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.geoserver.web</groupId>
<artifactId>gs-web-core</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<!-- other tests dependencies -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
<includes>
<include>**/*.html</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
</build>
</project>

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/* (c) 2017 Open Source Geospatial Foundation - all rights reserved
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/

package org.geoserver.nsg.pagination.random;

import java.util.Map;

import org.geoserver.platform.resource.Resource;
import org.geotools.data.DataStore;

/**
*
* Class used to store the index result type configuration managed by {@link IndexInitializer}
*
* @author sandr
*
*/
public class IndexConfiguration {

private static DataStore currentDataStore;

private static Resource storageResource;

private static Long timeToLive = 600l;

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The time unit used should be explicitly stayed.

private static Map<String, Object> currentDataStoreParams;

/**
* Store the DB parameters and the relative {@link DataStore}
*
* @param currentDataStoreParams
* @param currentDataStore
*/
public static void setCurrentDataStore(Map<String, Object> currentDataStoreParams,
DataStore currentDataStore) {
IndexConfiguration.currentDataStoreParams = currentDataStoreParams;
IndexConfiguration.currentDataStore = currentDataStore;
}

/**
* Store the reference to resource used to archive the serialized GetFeatureRequest
*
* @param currentDataStoreParams
* @param currentDataStore
*/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid java-doc @param values, this function has only one parameter.

public static void setStorageResource(Resource storageResource) {
IndexConfiguration.storageResource = storageResource;
}

/**
* Store the value of time to live of stored GetFeatureRequest
*
* @param timeToLive
*/
public static void setTimeToLive(Long timeToLive) {
IndexConfiguration.timeToLive = timeToLive;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When dealing with times the time unit should always be clearly defined, for example timeToLiveSec or better the method could named setTimeToLiveInSec, another more advanced option is too explicitly ask the invoker to provide the time unit using the TimeUnit enum.

}

public static DataStore getCurrentDataStore() {
return currentDataStore;
}

public static Map<String, Object> getCurrentDataStoreParams() {
return currentDataStoreParams;
}

public static Resource getStorageResource() {
return storageResource;
}

public static Long getTimeToLive() {
return timeToLive;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the setter method, the time unit used should be clearly stayed, for example getTimeToLiveInSec or getSecondsToLive.


}
Loading