summaryrefslogtreecommitdiff
path: root/src/core/src/sync/AbstractSyncTask.java
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2014-09-20 09:17:18 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2015-04-14 07:44:29 +0200
commitd6f22a2af48f83d63b5381118d2029797458194e (patch)
treecb6bef9a98335a7af2aee40b0752d14fcee0916e /src/core/src/sync/AbstractSyncTask.java
parent774194091e9bcee08e48fcdf4127f9afd9d6d644 (diff)
downloadsssync-d6f22a2af48f83d63b5381118d2029797458194e.tar.gz
sssync-d6f22a2af48f83d63b5381118d2029797458194e.tar.bz2
sssync-d6f22a2af48f83d63b5381118d2029797458194e.zip
Early development stages (before SCM) : WIP_1
Early development stages (before SCM) : WIP_2 Early development stages (before SCM) : WIP_3 Early development stages (before SCM) : WIP_4 Early development stages (before SCM) : WIP_6 Early development stages (before SCM) : WIP_7 Early development stages (before SCM) : WIP_8 Adds documentation folder as an Eclipse project. Adds README for github. Decent source tree by tuning Eclise project's location One forgetten file while movign everything :) Adding Copyright, licencing (GPL v3), correcting README
Diffstat (limited to 'src/core/src/sync/AbstractSyncTask.java')
-rw-r--r--src/core/src/sync/AbstractSyncTask.java71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/core/src/sync/AbstractSyncTask.java b/src/core/src/sync/AbstractSyncTask.java
new file mode 100644
index 0000000..e2ae94d
--- /dev/null
+++ b/src/core/src/sync/AbstractSyncTask.java
@@ -0,0 +1,71 @@
+/*
+ * SSSync, a Simple and Stupid Synchronizer for data with multi-valued attributes
+ * Copyright (C) 2014 Ludovic Pouzenc <ludovic@pouzenc.fr>
+ *
+ * This file is part of SSSync.
+ *
+ * SSSync 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.
+ *
+ * SSSync 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 SSSync. If not, see <http://www.gnu.org/licenses/>
+ */
+
+package sync;
+
+import java.util.concurrent.Callable;
+
+/**
+ * Abstract class to define a common base of all kind of synchronization algorithms.
+ *
+ * @author lpouzenc
+ */
+public abstract class AbstractSyncTask implements Callable<Boolean> {
+
+ /**
+ * Pretty task name to be inserted in log lines
+ */
+ protected String taskName="(unknown task)";
+
+ /**
+ * Dry-run mode flag (disabled by default)
+ */
+ protected boolean dryRun=false;
+
+ /**
+ * Main method that do the actual sync
+ */
+ public abstract Boolean call();
+
+
+ // Boring accessors
+
+ /**
+ * @return the dryRun mode status (enabled/disabled)
+ */
+ public boolean isDryRun() {
+ return dryRun;
+ }
+
+ /**
+ * @param dryRun the dryRun mode to set (enabled/disabled)
+ */
+ public void setDryRun(boolean dryRun) {
+ this.dryRun = dryRun;
+ }
+
+ /**
+ * @return the taskName
+ */
+ public String getTaskName() {
+ return taskName;
+ }
+
+}