Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe Commits: c6ac0a05 by Tony CHEMIT at 2018-09-18T02:27:47Z [LL] La suppression d'une marée en mode serveur provoque une exception - Closes #1049 - - - - - 3 changed files: - pom.xml - + services-client/src/main/java/fr/ird/observe/services/client/actions/synchro/referential/diff/ReferentialSynchronizeDiffServiceClient.java - + services-client/src/main/java/fr/ird/observe/services/client/referential/ReferentialServiceClient.java Changes: ===================================== pom.xml ===================================== @@ -152,7 +152,7 @@ <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format> <buildDate>${maven.build.timestamp}</buildDate> - <observeToolkitVersion>3.7.7-SNAPSHOT</observeToolkitVersion> + <observeToolkitVersion>3.7.7</observeToolkitVersion> <!--lib.version.java4all.http>1.0.12</lib.version.java4all.http--> <lib.version.nuiton.validation>3.1</lib.version.nuiton.validation> <!--<lib.version.java4all.config>1.0.3</lib.version.java4all.config>--> ===================================== services-client/src/main/java/fr/ird/observe/services/client/actions/synchro/referential/diff/ReferentialSynchronizeDiffServiceClient.java ===================================== @@ -0,0 +1,43 @@ +package fr.ird.observe.services.client.actions.synchro.referential.diff; + +/*- + * #%L + * ObServe :: Services client implementation + * %% + * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import com.google.common.collect.ImmutableSet; +import fr.ird.observe.dto.referential.ReferentialDto; +import org.apache.http.HttpStatus; + +import java.util.concurrent.TimeUnit; + +public class ReferentialSynchronizeDiffServiceClient extends GeneratedReferentialSynchronizeDiffServiceClient { + + @Override + public <R extends ReferentialDto> ImmutableSet<R> getReferential(Class<R> referentialName, ImmutableSet<String> ids) { + return executeRequest(create("getReferential") + .addParameter("referentialName", referentialName) + .addParameter("ids", ids, String.class) + .addAuthToken() + .setTimeout(TimeUnit.MINUTES, 1) + .post(), HttpStatus.SC_OK).toImmutableSet(referentialName); + } + +} \ No newline at end of file ===================================== services-client/src/main/java/fr/ird/observe/services/client/referential/ReferentialServiceClient.java ===================================== @@ -0,0 +1,44 @@ +package fr.ird.observe.services.client.referential; + +/*- + * #%L + * ObServe :: Services client implementation + * %% + * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import fr.ird.observe.dto.reference.ReferentialDtoReference; +import fr.ird.observe.dto.referential.ReferentialDto; +import fr.ird.observe.spi.DtoModelHelper; +import org.apache.http.HttpStatus; + +import java.util.concurrent.TimeUnit; + +public class ReferentialServiceClient extends GeneratedReferentialServiceClient { + + @Override + public <D extends ReferentialDto, R extends ReferentialDtoReference<D, R>> R loadReference(Class<D> type, String id) { + Class<R> rrClass = DtoModelHelper.fromReferentialDto(type).toReferenceType(); + return executeRequest(create("loadReference") + .addParameter("type", type) + .addParameter("id", id) + .addAuthToken() + .setTimeout(TimeUnit.MINUTES, 1) + .get(), HttpStatus.SC_OK).toJson(rrClass); + } +} \ No newline at end of file View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/c6ac0a059c1f5a1ea987f5774b52... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/c6ac0a059c1f5a1ea987f5774b52... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT