Commit 550b4480 authored by Noel Alonso's avatar Noel Alonso
Browse files

Merge branch 'dev' into 'master'

Añade clases para majenar respuestas de elastic

See merge request redmic-project/server/library/models!2
parents 340760c9 7177ccb2
Loading
Loading
Loading
Loading
+108 −15
Original line number Diff line number Diff line
@@ -3,19 +3,45 @@
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<parent>
		<groupId>es.redmic.lib</groupId>
		<artifactId>libs</artifactId>
		<version>0.6.0</version>
		<groupId>org.springframework.boot</groupId>
   		<artifactId>spring-boot-starter-parent</artifactId>
    	<version>2.0.0.RELEASE</version>
		<relativePath/>
	</parent>

	<modelVersion>4.0.0</modelVersion>
	<groupId>es.redmic.lib</groupId>
	<artifactId>models</artifactId>
	<packaging>jar</packaging>
	<version>0.6.0</version>
	<name>Models</name>
	<description>Models</description>
	<description>Input-output classes and models</description>

	<properties>
		<checkstyle.config.location>src/main/resources/checkstyle.xml</checkstyle.config.location>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<java.version>1.8</java.version>

		<!-- REDMIC -->
		<redmic.exceptions.version>0.6.0</redmic.exceptions.version>
		<redmic.jackson-jsonschema.version>0.6.0</redmic.jackson-jsonschema.version>

		<!-- OTHERS -->
		<commons-beanutils.version>1.9.3</commons-beanutils.version>
		<geotools.version>19.0</geotools.version>
		<commons-io.version>2.6</commons-io.version>
		<jackson-datatype-jts.version>2.4</jackson-datatype-jts.version>
		
		<hibernate-validator.version>6.0.8.Final</hibernate-validator.version>
		<org.mockito-version>1.10.19</org.mockito-version>

		<!-- Version plugins -->
		<jacoco.version>0.8.1</jacoco.version>

		<!-- Environment variables -->
		<env.MAVEN_REPO_URL>https://artifactory.redmic.net/artifactory</env.MAVEN_REPO_URL>
	</properties>

	<dependencies>
@@ -24,10 +50,16 @@
		<dependency>
			<groupId>es.redmic.lib</groupId>
			<artifactId>exceptions</artifactId>
			<version>${redmic.version}</version>
			<version>${redmic.exceptions.version}</version>
			<scope>provided</scope>
		</dependency>
		
		<dependency>
			<groupId>es.redmic.lib</groupId>
			<artifactId>jackson-jsonschema</artifactId>
			<version>${redmic.jackson-jsonschema.version}</version>
		</dependency>

		<!-- Spring -->
		<!-- Para multpartfile -->
		<dependency>
@@ -42,12 +74,6 @@

		<!-- Otros -->

		<dependency>
			<groupId>es.redmic.lib</groupId>
			<artifactId>jackson-jsonschema</artifactId>
			<version>${redmic.version}</version>
		</dependency>

		<!-- Bean compare -->
		<dependency>
			<groupId>commons-beanutils</groupId>
@@ -104,8 +130,6 @@
			<artifactId>commons-lang3</artifactId>
		</dependency>
		
		<!-- test -->

		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-validator</artifactId>
@@ -113,11 +137,80 @@
			<scope>provided</scope>
		</dependency>
		
		<!-- Logs -->
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<scope>provided</scope>
		</dependency>
		
		<!-- test -->
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>${org.mockito-version}</version>
			<scope>test</scope>
		</dependency>
		
		<dependency>
			<groupId>org.skyscreamer</groupId>
			<artifactId>jsonassert</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.glassfish</groupId>
			<artifactId>javax.el</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<distributionManagement>
		<repository>
			<id>central</id>
			<name>redmic-releases</name>
			<url>${env.MAVEN_REPO_URL}/libs-release-local</url>
		</repository>
		<snapshotRepository>
			<id>snapshots</id>
			<name>redmic-snapshots</name>
			<url>${env.MAVEN_REPO_URL}/libs-snapshot-local</url>
			<uniqueVersion>false</uniqueVersion>
		</snapshotRepository>
	</distributionManagement>
	<repositories>
		<repository>
			<id>osgeo</id>
			<name>Open Source Geospatial Foundation Repository</name>
			<url>http://download.osgeo.org/webdav/geotools/</url>
		</repository>
	</repositories>
	<build>
		<plugins>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>${jacoco.version}</version>
				<executions>
					<execution>
						<id>pre-unit-test</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>post-unit-test</id>
						<phase>test</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
+4 −0
Original line number Diff line number Diff line
@@ -54,8 +54,11 @@ public final class DataPrefixType {
		classesHash.put(GeoFixedObjectCollectingSeriesDTO.class, new Type(OBJECT_COLLECTING, 32L));
		classesHash.put(GeoFixedTimeSeriesDTO.class, new Type(FIXED_TIMESERIES, new ArrayList<Long>() {
			{
				add(4L);
				add(5L);
				add(6L);
				add(7L);
				add(30L);
				add(31L);
			}
		}));
@@ -84,6 +87,7 @@ public final class DataPrefixType {
				add(18L);
				add(19L);
				add(20L);
				add(46L);
			}
		}));
		classesHash.put(ToponymDTO.class, new Type(TOPONYM));
+5 −0
Original line number Diff line number Diff line
package es.redmic.models.es.common.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * @author oag
 * @version 1.0
 * @created 09-jun-2015 11:55:18
 */

@JsonIgnoreProperties(ignoreUnknown = true)
public abstract class BaseAbstractStringES implements BaseES<String> {

	private String id;
@@ -12,6 +16,7 @@ public abstract class BaseAbstractStringES implements BaseES<String> {
	public BaseAbstractStringES() {
	}

	@Override
	public String getId() {
		return id;
	}
+36 −0
Original line number Diff line number Diff line
package es.redmic.models.es.common.model;

import org.joda.time.DateTime;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import es.redmic.models.es.common.deserializer.CustomDateTimeDeserializer;
import es.redmic.models.es.common.serializer.CustomDateTimeSerializer;

public abstract class BaseUpdatableES extends BaseAbstractStringES {

	@JsonSerialize(using = CustomDateTimeSerializer.class)
	@JsonDeserialize(using = CustomDateTimeDeserializer.class)
	private DateTime inserted;

	@JsonSerialize(using = CustomDateTimeSerializer.class)
	@JsonDeserialize(using = CustomDateTimeDeserializer.class)
	private DateTime updated;

	public DateTime getInserted() {
		return inserted;
	}

	public void setInserted(DateTime inserted) {
		this.inserted = inserted;
	}

	public DateTime getUpdated() {
		return updated;
	}

	public void setUpdated(DateTime updated) {
		this.updated = updated;
	}
}
+89 −0
Original line number Diff line number Diff line
package es.redmic.models.es.geojson.base;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.vividsolutions.jts.geom.Geometry;

import es.redmic.models.es.common.model.BaseAbstractStringES;
import es.redmic.models.es.geojson.GeoJSONFeatureType;

public class Feature<TProperties extends Properties, TGeometry extends Geometry> extends BaseAbstractStringES {

	@NotNull
	@Size(min = 1, max = 50)
	private String uuid;

	protected GeoJSONFeatureType type;

	private TProperties properties;

	private TGeometry geometry;

	public Feature() {
		super();
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public void setType(GeoJSONFeatureType type) {
		this.type = type;
	}

	public GeoJSONFeatureType getType() {
		return type;
	}

	public void setProperties(TProperties properties) {
		this.properties = properties;
	}

	public TProperties getProperties() {
		return properties;
	}

	public TGeometry getGeometry() {
		return geometry;
	}

	public void setGeometry(TGeometry geometry) {
		this.geometry = geometry;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;
		if (!super.equals(o))
			return false;
		@SuppressWarnings("rawtypes")
		Feature feature = (Feature) o;
		if (properties != null ? !properties.equals(feature.properties) : feature.properties != null)
			return false;
		if (geometry != null ? !geometry.equals(feature.geometry) : feature.geometry != null)
			return false;
		return !(getId() != null ? !(getId() == feature.getId()) : feature.getId() != null);
	}

	@Override
	public int hashCode() {
		int result = super.hashCode();
		result = 31 * result + (properties != null ? properties.hashCode() : 0);
		result = 31 * result + (geometry != null ? geometry.hashCode() : 0);
		result = 31 * result + (getId() != null ? getId().hashCode() : 0);
		return result;
	}

	@Override
	public String toString() {
		return "Feature{properties=" + properties + ", geometry=" + geometry + ", id='" + getId() + "'}";
	}
}
 No newline at end of file
Loading