001/* 002 * Syncany, www.syncany.org 003 * Copyright (C) 2011-2016 Philipp C. Heckel <philipp.heckel@gmail.com> 004 * 005 * This program is free software: you can redistribute it and/or modify 006 * it under the terms of the GNU General Public License as published by 007 * the Free Software Foundation, either version 3 of the License, or 008 * (at your option) any later version. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU General Public License for more details. 014 * 015 * You should have received a copy of the GNU General Public License 016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 017 */ 018package org.syncany.operations.down; 019 020import java.util.ArrayList; 021import java.util.HashSet; 022import java.util.List; 023import java.util.Set; 024 025import org.syncany.database.DatabaseVersionHeader; 026import org.syncany.database.MultiChunkEntry.MultiChunkId; 027import org.syncany.operations.ChangeSet; 028import org.syncany.operations.OperationResult; 029import org.syncany.operations.ls_remote.LsRemoteOperationResult; 030 031public class DownOperationResult implements OperationResult { 032 public enum DownResultCode { 033 OK_NO_REMOTE_CHANGES, OK_WITH_REMOTE_CHANGES, NOK 034 } 035 036 private DownResultCode resultCode; 037 private ChangeSet changeSet = new ChangeSet(); 038 private List<DatabaseVersionHeader> dirtyDatabasesCreated = new ArrayList<DatabaseVersionHeader>(); 039 private Set<String> downloadedUnknownDatabases = new HashSet<String>(); 040 private Set<MultiChunkId> downloadedMultiChunks = new HashSet<MultiChunkId>(); 041 private LsRemoteOperationResult lsRemoteResult = null; 042 043 public DownResultCode getResultCode() { 044 return resultCode; 045 } 046 047 public void setResultCode(DownResultCode resultCode) { 048 this.resultCode = resultCode; 049 } 050 051 public void setChangeSet(ChangeSet ChangeSet) { 052 this.changeSet = ChangeSet; 053 } 054 055 public ChangeSet getChangeSet() { 056 return changeSet; 057 } 058 059 public List<DatabaseVersionHeader> getDirtyDatabasesCreated() { 060 return dirtyDatabasesCreated; 061 } 062 063 public void setDirtyDatabasesCreated(List<DatabaseVersionHeader> dirtyDatabasesCreated) { 064 this.dirtyDatabasesCreated = dirtyDatabasesCreated; 065 } 066 067 public Set<String> getDownloadedUnknownDatabases() { 068 return downloadedUnknownDatabases; 069 } 070 071 public void setDownloadedUnknownDatabases(Set<String> downloadedUnknownDatabases) { 072 this.downloadedUnknownDatabases = downloadedUnknownDatabases; 073 } 074 075 public Set<MultiChunkId> getDownloadedMultiChunks() { 076 return downloadedMultiChunks; 077 } 078 079 public void setDownloadedMultiChunks(Set<MultiChunkId> downloadedMultiChunks) { 080 this.downloadedMultiChunks = downloadedMultiChunks; 081 } 082 083 public LsRemoteOperationResult getLsRemoteResult() { 084 return lsRemoteResult; 085 } 086 087 public void setLsRemoteResult(LsRemoteOperationResult lsRemoteResult) { 088 this.lsRemoteResult = lsRemoteResult; 089 } 090}