Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe

Commits:

3 changed files:

Changes:

  • pom.xml
    ... ... @@ -152,7 +152,7 @@
    152 152
         <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
    
    153 153
         <buildDate>${maven.build.timestamp}</buildDate>
    
    154 154
     
    
    155
    -    <observeToolkitVersion>3.7.7-SNAPSHOT</observeToolkitVersion>
    
    155
    +    <observeToolkitVersion>3.7.7</observeToolkitVersion>
    
    156 156
         <!--lib.version.java4all.http>1.0.12</lib.version.java4all.http-->
    
    157 157
         <lib.version.nuiton.validation>3.1</lib.version.nuiton.validation>
    
    158 158
         <!--<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
    1
    +package fr.ird.observe.services.client.actions.synchro.referential.diff;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe :: Services client implementation
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import com.google.common.collect.ImmutableSet;
    
    26
    +import fr.ird.observe.dto.referential.ReferentialDto;
    
    27
    +import org.apache.http.HttpStatus;
    
    28
    +
    
    29
    +import java.util.concurrent.TimeUnit;
    
    30
    +
    
    31
    +public class ReferentialSynchronizeDiffServiceClient extends GeneratedReferentialSynchronizeDiffServiceClient {
    
    32
    +
    
    33
    +    @Override
    
    34
    +    public <R extends ReferentialDto> ImmutableSet<R> getReferential(Class<R> referentialName, ImmutableSet<String> ids) {
    
    35
    +        return executeRequest(create("getReferential")
    
    36
    +                                      .addParameter("referentialName", referentialName)
    
    37
    +                                      .addParameter("ids", ids, String.class)
    
    38
    +                                      .addAuthToken()
    
    39
    +                                      .setTimeout(TimeUnit.MINUTES, 1)
    
    40
    +                                      .post(), HttpStatus.SC_OK).toImmutableSet(referentialName);
    
    41
    +    }
    
    42
    +
    
    43
    +}
    \ No newline at end of file

  • services-client/src/main/java/fr/ird/observe/services/client/referential/ReferentialServiceClient.java
    1
    +package fr.ird.observe.services.client.referential;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe :: Services client implementation
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.dto.reference.ReferentialDtoReference;
    
    26
    +import fr.ird.observe.dto.referential.ReferentialDto;
    
    27
    +import fr.ird.observe.spi.DtoModelHelper;
    
    28
    +import org.apache.http.HttpStatus;
    
    29
    +
    
    30
    +import java.util.concurrent.TimeUnit;
    
    31
    +
    
    32
    +public class ReferentialServiceClient extends GeneratedReferentialServiceClient {
    
    33
    +
    
    34
    +    @Override
    
    35
    +    public <D extends ReferentialDto, R extends ReferentialDtoReference<D, R>> R loadReference(Class<D> type, String id) {
    
    36
    +        Class<R> rrClass = DtoModelHelper.fromReferentialDto(type).toReferenceType();
    
    37
    +        return executeRequest(create("loadReference")
    
    38
    +                                      .addParameter("type", type)
    
    39
    +                                      .addParameter("id", id)
    
    40
    +                                      .addAuthToken()
    
    41
    +                                      .setTimeout(TimeUnit.MINUTES, 1)
    
    42
    +                                      .get(), HttpStatus.SC_OK).toJson(rrClass);
    
    43
    +    }
    
    44
    +}
    \ No newline at end of file