ImportInformationMissingCollection.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */

  20. package org.openspcoop2.protocol.engine.archive;

  21. import java.io.Serializable;
  22. import java.util.ArrayList;
  23. import java.util.HashMap;
  24. import java.util.List;
  25. import java.util.Map;

  26. import org.openspcoop2.protocol.sdk.ProtocolException;

  27. /**
  28.  *  ImportInformationMissingCollection
  29.  *
  30.  * @author Poli Andrea (apoli@link.it)
  31.  * @author $Author$
  32.  * @version $Rev$, $Date$
  33.  */
  34. public class ImportInformationMissingCollection implements Serializable {

  35.     /**
  36.      *
  37.      */
  38.     private static final long serialVersionUID = 1L;
  39.    
  40.     private Map<String,ImportInformationMissing> importInformationMissing = new HashMap<String, ImportInformationMissing>();


  41.     public Map<String, ImportInformationMissing> getImportInformationMissing() {
  42.         return this.importInformationMissing;
  43.     }
  44.     public void setImportInformationMissing(
  45.             Map<String, ImportInformationMissing> importInformationMissing) {
  46.         this.importInformationMissing = importInformationMissing;
  47.     }
  48.    
  49.     public void add(String objectId,ImportInformationMissing importInformationMissing) throws ProtocolException{
  50.         if(this.importInformationMissing.containsKey(objectId)){
  51.             throw new ProtocolException("ImportInformationMissing with id ["+objectId+"] already exists");
  52.         }
  53.         this.importInformationMissing.put(objectId,importInformationMissing);
  54.     }
  55.     public ImportInformationMissing get(String objectId){
  56.         return this.importInformationMissing.get(objectId);
  57.     }
  58.     public ImportInformationMissing remove(String objectId){
  59.         return this.importInformationMissing.remove(objectId);
  60.     }
  61.     public boolean exists(String objectId){
  62.         return this.importInformationMissing.containsKey(objectId);
  63.     }
  64.     public int size(){
  65.         return this.importInformationMissing.size();
  66.     }
  67.     public List<String> keys(){
  68.         List<String> keys = null;
  69.         if(this.importInformationMissing!=null && !this.importInformationMissing.isEmpty()) {
  70.             keys = new ArrayList<>();
  71.             keys.addAll(this.importInformationMissing.keySet());
  72.         }
  73.         return keys;
  74.     }
  75. }