From 29e44f39b8c5230a404c1511f1d64e07fcdea481 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Wed, 5 Feb 2014 20:12:44 -0800 Subject: [PATCH] Add validate() base method Now that all backends implement a validate that can be called to check if the backend is still useable we can add a base method to the base class that defines exactly what this new method does. Change-Id: Ica4571970bad2de16ce2071a645abf24c25c110b --- taskflow/persistence/backends/base.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/taskflow/persistence/backends/base.py b/taskflow/persistence/backends/base.py index 1f76aeab..cdd8e710 100644 --- a/taskflow/persistence/backends/base.py +++ b/taskflow/persistence/backends/base.py @@ -68,6 +68,14 @@ class Connection(object): """Clear all entries from this backend.""" pass + @abc.abstractmethod + def validate(self): + """Validates that a backend is still ok to be used (the semantics + of this vary depending on the backend). On failure a backend specific + exception is raised that will indicate why the failure occurred. + """ + pass + @abc.abstractmethod def update_task_details(self, task_detail): """Updates a given task details and returns the updated version.