+package org.simantics.backup;\r
+\r
+import java.nio.file.Path;\r
+import java.util.concurrent.Future;\r
+\r
+/**\r
+ * Interface for providing backup capabilities to Simantics products.\r
+ * BackupProviders are used in {@link BackupProviderService}.\r
+ * \r
+ * @author Jani Simomaa\r
+ */\r
+public interface IBackupProvider {\r
+\r
+ /**\r
+ * Lock the resources that are going to be backed up in a way that allows\r
+ * making an atomic and consistent copy of the backed up resources.\r
+ */\r
+ void lock() throws BackupException;\r
+\r
+ /**\r
+ * Initiates or executes the backing up procedure of this provider. The\r
+ * backup procedure is allowed to return from this method and complete\r
+ * asynchronously. A {@link Future} is returned to allow waiting for backup\r
+ * to complete.\r
+ * \r
+ * @param targetPath\r
+ * @param revision\r
+ * @return a future that can be waited upon to wait for the backup procedure\r
+ * to complete.\r
+ */\r
+ Future<BackupException> backup(Path targetPath, int revision) throws BackupException;\r
+\r
+ /**\r
+ * The counterpart of {@link #lock()} that must be invoked and invoked only\r
+ * after {@link #lock()} has been successfully invoked\r
+ */\r
+ void unlock() throws BackupException;\r
+\r
+ /**\r
+ * Restore implementation for this provider.\r
+ * \r
+ * @param fromPath\r
+ * @param revision\r
+ * \r
+ * TODO: change to return {@link Future} that can be waited upon\r
+ */\r
+ void restore(Path fromPath, int revision) throws BackupException;\r
+\r
+}\r