Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 366e6b1f by Tony Chemit at 2020-10-04T09:35:27+02:00 Remove unused API (replaced by BusinessProject API) - - - - - 3 changed files: - − common-dto/src/main/java/fr/ird/observe/dto/model/AggregateDtoModel.java - − common-dto/src/main/java/fr/ird/observe/dto/model/DtoModel.java - − common-dto/src/main/java/fr/ird/observe/dto/model/DtoModelSupport.java Changes: ===================================== common-dto/src/main/java/fr/ird/observe/dto/model/AggregateDtoModel.java deleted ===================================== @@ -1,82 +0,0 @@ -package fr.ird.observe.dto.model; - -/*- - * #%L - * ObServe Toolkit :: Common Dto - * %% - * Copyright (C) 2008 - 2020 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.data.DataDto; -import fr.ird.observe.dto.referential.ReferentialDto; -import io.ultreia.java4all.util.ServiceLoaders; - -import java.util.ServiceLoader; - -/** - * Created by tchemit on 26/05/2018. - * - * @author Tony Chemit - dev@tchemit.fr - */ -public abstract class AggregateDtoModel implements DtoModel { - - private static AggregateDtoModel instance; - private final String name; - private final ImmutableSet<DtoModel> models; - private final ImmutableSet<Class<? extends ReferentialDto>> referentialTypes; - private final ImmutableSet<Class<? extends DataDto>> dataTypes; - - protected AggregateDtoModel(String name) { - this.name = name; - ImmutableSet.Builder<DtoModel> modelsBuilder = ImmutableSet.builder(); - ImmutableSet.Builder<Class<? extends ReferentialDto>> referentialTypes = ImmutableSet.builder(); - ImmutableSet.Builder<Class<? extends DataDto>> dataTypes = ImmutableSet.builder(); - for (DtoModel dtoModel : ServiceLoader.load(DtoModel.class)) { - modelsBuilder.add(dtoModel); - referentialTypes.addAll(dtoModel.getReferentialTypes()); - dataTypes.addAll(dtoModel.getDataTypes()); - } - this.referentialTypes = referentialTypes.build(); - this.dataTypes = dataTypes.build(); - this.models = modelsBuilder.build(); - } - - public static synchronized AggregateDtoModel get() { - return instance == null ? instance = ServiceLoaders.loadUniqueService(AggregateDtoModel.class) : instance; - } - - @Override - public String getName() { - return name; - } - - @Override - public ImmutableSet<Class<? extends ReferentialDto>> getReferentialTypes() { - return referentialTypes; - } - - @Override - public ImmutableSet<Class<? extends DataDto>> getDataTypes() { - return dataTypes; - } - - public ImmutableSet<DtoModel> getModels() { - return models; - } -} ===================================== common-dto/src/main/java/fr/ird/observe/dto/model/DtoModel.java deleted ===================================== @@ -1,41 +0,0 @@ -package fr.ird.observe.dto.model; - -/*- - * #%L - * ObServe Toolkit :: Common Dto - * %% - * Copyright (C) 2008 - 2020 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.data.DataDto; -import fr.ird.observe.dto.referential.ReferentialDto; - -/** - * Created by tchemit on 26/05/2018. - * - * @author Tony Chemit - dev@tchemit.fr - */ -public interface DtoModel { - - String getName(); - - ImmutableSet<Class<? extends ReferentialDto>> getReferentialTypes(); - - ImmutableSet<Class<? extends DataDto>> getDataTypes(); -} ===================================== common-dto/src/main/java/fr/ird/observe/dto/model/DtoModelSupport.java deleted ===================================== @@ -1,61 +0,0 @@ -package fr.ird.observe.dto.model; - -/*- - * #%L - * ObServe Toolkit :: Common Dto - * %% - * Copyright (C) 2008 - 2020 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.data.DataDto; -import fr.ird.observe.dto.referential.ReferentialDto; - -/** - * Created by tchemit on 26/05/2018. - * - * @author Tony Chemit - dev@tchemit.fr - */ -public class DtoModelSupport implements DtoModel { - - private final String name; - - private final ImmutableSet<Class<? extends ReferentialDto>> referentialTypes; - private final ImmutableSet<Class<? extends DataDto>> dataTypes; - - public DtoModelSupport(String name, ImmutableSet<Class<? extends ReferentialDto>> referentialTypes, ImmutableSet<Class<? extends DataDto>> dataTypes) { - this.name = name; - this.referentialTypes = referentialTypes; - this.dataTypes = dataTypes; - } - - @Override - public String getName() { - return name; - } - - @Override - public ImmutableSet<Class<? extends ReferentialDto>> getReferentialTypes() { - return referentialTypes; - } - - @Override - public ImmutableSet<Class<? extends DataDto>> getDataTypes() { - return dataTypes; - } -} View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/366e6b1ff9a29a0b8b47d7f84a... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/commit/366e6b1ff9a29a0b8b47d7f84a... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT