diff --git a/libreplan-webapp/src/main/java/org/libreplan/importers/JiraSyncInfo.java b/libreplan-webapp/src/main/java/org/libreplan/importers/JiraSyncInfo.java new file mode 100644 index 000000000..4ad510821 --- /dev/null +++ b/libreplan-webapp/src/main/java/org/libreplan/importers/JiraSyncInfo.java @@ -0,0 +1,64 @@ +/* + * This file is part of LibrePlan + * + * Copyright (C) 2012 Igalia, S.L. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package org.libreplan.importers; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Keeps track the synchronization info. + * + * @author Miciele Ghiorghis + */ +public class JiraSyncInfo { + + private Set syncFailedReasons = new HashSet(); + + /** + * Add the specified reason to syncFailedReasons list + * + * @param reason + * reason why synchronizition failed + */ + public void addSyncFailedReason(String reason) { + syncFailedReasons.add(reason); + } + + /** + * Is synchronization successful + * + * @return + */ + public boolean isSyncSuccessful() { + return syncFailedReasons.isEmpty(); + } + + /** + * returns reasons why synchronization is failed + */ + public List getSyncFailedReasons() { + List failedReasons = new ArrayList(); + failedReasons.addAll(syncFailedReasons); + return failedReasons; + } + +}