Commit 1380fbcb authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade implementación del repositorio para settings

Se necesita la implementación de un repositorio para almacenar las
configuraciones y selecciones. Este no puede estar en view base, por lo que se
ha optado por una implementación de elasticsearch para todos los
microservicios que hagan uso de esta funcionalidad
parent 3a2fe796
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
		<redmic.models.version>0.10.0-feature-cleanAtlasComponents</redmic.models.version>
		<redmic.exceptions.version>0.9.0-feature-atlasExceptions</redmic.exceptions.version>
		<redmic.broker-lib.version>0.10.0-feature-atlasMicroservice</redmic.broker-lib.version>
		<redmic.elasticsearch-lib.version>0.10.0-feature-parentChildIndex</redmic.elasticsearch-lib.version>
		<redmic.test-utils.version>0.9.0-feature-atlasMicroservice</redmic.test-utils.version>
		<!-- OTHERS -->
	</properties>
@@ -45,6 +46,12 @@
			<version>${redmic.broker-lib.version}</version>
		</dependency>
		
		<dependency>
			<groupId>es.redmic.lib</groupId>
			<artifactId>elasticsearch-lib</artifactId>
			<version>${redmic.elasticsearch-lib.version}</version>
		</dependency>
		
		<dependency>
			<groupId>es.redmic.lib</groupId>
			<artifactId>test-utils</artifactId>
+53 −0
Original line number Diff line number Diff line
package es.redmic.usersettingslib.repository;

/*-
 * #%L
 * user-settings-lib
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import es.redmic.elasticsearchlib.data.repository.RWDataESRepository;
import es.redmic.models.es.common.dto.EventApplicationResult;
import es.redmic.models.es.common.query.dto.SimpleQueryDTO;
import es.redmic.usersettingslib.model.Settings;

public abstract class SettingsRepositoryImpl extends RWDataESRepository<Settings, SimpleQueryDTO> {

	private static String[] INDEX = { "layer" };
	private static String TYPE = "_doc";

	public SettingsRepositoryImpl() {
		super(INDEX, TYPE);
	}

	@Override
	protected EventApplicationResult checkInsertConstraintsFulfilled(Settings modelToIndex) {
		// TODO Comprobar que no exista esa setting con el nombre ...
		return new EventApplicationResult(true);
	}

	@Override
	protected EventApplicationResult checkUpdateConstraintsFulfilled(Settings modelToIndex) {
		// TODO Comprobar que no exista esa setting con el nombre ...
		return new EventApplicationResult(true);
	}

	@Override
	protected EventApplicationResult checkDeleteConstraintsFulfilled(String modelToIndex) {
		return new EventApplicationResult(true);
	}
}