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.up; 019 020import org.simpleframework.xml.Element; 021import org.simpleframework.xml.Root; 022import org.syncany.operations.OperationOptions; 023import org.syncany.operations.status.StatusOperationOptions; 024 025@Root(name = "up") 026public class UpOperationOptions implements OperationOptions { 027 // The transaction size limit determines how much data (in bytes) is combined into a single transaction during an 028 // up operation. Note that this is a lower bound; the Indexer and Deduper iterate through all changed files, and 029 // create and commit a new DatabaseVersion whenever MultiChunks with a total size of at least this limit have been 030 // processed, or when all files have been processed. 031 public static final long DEFAULT_TRANSACTION_SIZE_LIMIT = 50 * 1024 * 1024; 032 public static final long DEFAULT_TRANSACTION_FILE_LIMIT = 10000; 033 034 @Element(name = "status", required = false) 035 private StatusOperationOptions statusOptions = new StatusOperationOptions(); 036 037 @Element(required = false) 038 private boolean forceUploadEnabled = false; 039 040 @Element(required = false) 041 private boolean resume = true; 042 043 @Element(required = false) 044 private long transactionSizeLimit = DEFAULT_TRANSACTION_SIZE_LIMIT; 045 046 @Element(required = false) 047 private long transactionFileLimit = DEFAULT_TRANSACTION_FILE_LIMIT; 048 049 public StatusOperationOptions getStatusOptions() { 050 return statusOptions; 051 } 052 053 public void setStatusOptions(StatusOperationOptions statusOptions) { 054 this.statusOptions = statusOptions; 055 } 056 057 public boolean forceUploadEnabled() { 058 return forceUploadEnabled; 059 } 060 061 public void setForceUploadEnabled(boolean forceUploadEnabled) { 062 this.forceUploadEnabled = forceUploadEnabled; 063 } 064 065 public boolean isResume() { 066 return resume; 067 } 068 069 public void setResume(boolean resume) { 070 this.resume = resume; 071 } 072 073 public long getTransactionSizeLimit() { 074 return transactionSizeLimit; 075 } 076 077 public void setTransactionSizeLimit(long transactionSizeLimit) { 078 this.transactionSizeLimit = transactionSizeLimit; 079 } 080 081 public long getTransactionFileLimit() { 082 return transactionFileLimit; 083 } 084 085 public void setTransactionFileLimit(long transactionFileLimit) { 086 this.transactionFileLimit = transactionFileLimit; 087 } 088}