diff --git a/marconi/queues/storage/__init__.py b/marconi/queues/storage/__init__.py index dce0b8514..1bd1dcbcf 100644 --- a/marconi/queues/storage/__init__.py +++ b/marconi/queues/storage/__init__.py @@ -7,7 +7,7 @@ from marconi.queues.storage import errors # NOQA ControlDriverBase = base.ControlDriverBase DataDriverBase = base.DataDriverBase CatalogueBase = base.CatalogueBase -ClaimBase = base.ClaimBase -MessageBase = base.MessageBase -QueueBase = base.QueueBase +Claim = base.Claim +Message = base.Message +Queue = base.Queue ShardsBase = base.ShardsBase diff --git a/marconi/queues/storage/base.py b/marconi/queues/storage/base.py index f38e357d0..2a1aeec21 100644 --- a/marconi/queues/storage/base.py +++ b/marconi/queues/storage/base.py @@ -138,7 +138,7 @@ class ControllerBase(object): @six.add_metaclass(abc.ABCMeta) -class QueueBase(ControllerBase): +class Queue(ControllerBase): """This class is responsible for managing queues. Queue operations include CRUD, monitoring, etc. @@ -231,7 +231,7 @@ class QueueBase(ControllerBase): @six.add_metaclass(abc.ABCMeta) -class MessageBase(ControllerBase): +class Message(ControllerBase): """This class is responsible for managing message CRUD.""" @abc.abstractmethod @@ -347,7 +347,7 @@ class MessageBase(ControllerBase): @six.add_metaclass(abc.ABCMeta) -class ClaimBase(ControllerBase): +class Claim(ControllerBase): @abc.abstractmethod def get(self, queue, claim_id, project=None): diff --git a/marconi/queues/storage/mongodb/claims.py b/marconi/queues/storage/mongodb/claims.py index 4df2a6f1c..42ade9a6a 100644 --- a/marconi/queues/storage/mongodb/claims.py +++ b/marconi/queues/storage/mongodb/claims.py @@ -35,7 +35,7 @@ from marconi.queues.storage.mongodb import utils LOG = logging.getLogger(__name__) -class ClaimController(storage.ClaimBase): +class ClaimController(storage.Claim): """Implements claim resource operations using MongoDB. No dedicated collection is being used diff --git a/marconi/queues/storage/mongodb/messages.py b/marconi/queues/storage/mongodb/messages.py index ccb830815..53e952e8a 100644 --- a/marconi/queues/storage/mongodb/messages.py +++ b/marconi/queues/storage/mongodb/messages.py @@ -108,7 +108,7 @@ TRANSACTION_INDEX_FIELDS = [ ] -class MessageController(storage.MessageBase): +class MessageController(storage.Message): """Implements message resource operations using MongoDB. Messages are scoped by project + queue. diff --git a/marconi/queues/storage/mongodb/queues.py b/marconi/queues/storage/mongodb/queues.py index 6c9ee2855..510468e28 100644 --- a/marconi/queues/storage/mongodb/queues.py +++ b/marconi/queues/storage/mongodb/queues.py @@ -34,7 +34,7 @@ from marconi.queues.storage.mongodb import utils LOG = logging.getLogger(__name__) -class QueueController(storage.QueueBase): +class QueueController(storage.Queue): """Implements queue resource operations using MongoDB. Queues are scoped by project, which is prefixed to the diff --git a/marconi/queues/storage/sqlite/claims.py b/marconi/queues/storage/sqlite/claims.py index f99781d57..792b827c8 100644 --- a/marconi/queues/storage/sqlite/claims.py +++ b/marconi/queues/storage/sqlite/claims.py @@ -18,7 +18,7 @@ from marconi.queues.storage import errors from marconi.queues.storage.sqlite import utils -class ClaimController(base.ClaimBase): +class ClaimController(base.Claim): def get(self, queue, claim_id, project): if project is None: diff --git a/marconi/queues/storage/sqlite/messages.py b/marconi/queues/storage/sqlite/messages.py index 6207ae5d9..30bac7671 100644 --- a/marconi/queues/storage/sqlite/messages.py +++ b/marconi/queues/storage/sqlite/messages.py @@ -19,7 +19,7 @@ from marconi.queues.storage import errors from marconi.queues.storage.sqlite import utils -class MessageController(base.MessageBase): +class MessageController(base.Message): def get(self, queue, message_id, project): if project is None: diff --git a/marconi/queues/storage/sqlite/queues.py b/marconi/queues/storage/sqlite/queues.py index 9057e43f2..e785e622d 100644 --- a/marconi/queues/storage/sqlite/queues.py +++ b/marconi/queues/storage/sqlite/queues.py @@ -19,7 +19,7 @@ from marconi.queues.storage import errors from marconi.queues.storage.sqlite import utils -class QueueController(base.QueueBase): +class QueueController(base.Queue): def list(self, project, marker=None, limit=None, detailed=False): diff --git a/marconi/queues/transport/wsgi/public/driver.py b/marconi/queues/transport/wsgi/public/driver.py index 766810784..d159c3aed 100644 --- a/marconi/queues/transport/wsgi/public/driver.py +++ b/marconi/queues/transport/wsgi/public/driver.py @@ -37,7 +37,7 @@ class Driver(driver.DriverBase): return [ # Home ('/', - v1.V1Resource()), + v1.Resource()), # Queues Endpoints ('/queues', diff --git a/marconi/queues/transport/wsgi/v1.py b/marconi/queues/transport/wsgi/v1.py index 028abe13a..19d85b133 100644 --- a/marconi/queues/transport/wsgi/v1.py +++ b/marconi/queues/transport/wsgi/v1.py @@ -130,7 +130,7 @@ JSON_HOME = { } -class V1Resource(object): +class Resource(object): def __init__(self): document = json.dumps(JSON_HOME, ensure_ascii=False, indent=4) diff --git a/marconi/tests/faulty_storage.py b/marconi/tests/faulty_storage.py index 39d104091..083e19f9f 100644 --- a/marconi/tests/faulty_storage.py +++ b/marconi/tests/faulty_storage.py @@ -54,7 +54,7 @@ class ControlDriver(storage.ControlDriverBase): return None -class QueueController(storage.QueueBase): +class QueueController(storage.Queue): def __init__(self, driver): pass @@ -80,7 +80,7 @@ class QueueController(storage.QueueBase): raise NotImplementedError() -class MessageController(storage.MessageBase): +class MessageController(storage.Message): def __init__(self, driver): pass diff --git a/marconi/tests/queues/storage/base.py b/marconi/tests/queues/storage/base.py index 5b5d778e7..cffca534b 100644 --- a/marconi/tests/queues/storage/base.py +++ b/marconi/tests/queues/storage/base.py @@ -74,7 +74,7 @@ class ControllerBaseTest(testing.TestBase): @ddt.ddt class QueueControllerTest(ControllerBaseTest): """Queue Controller base tests.""" - controller_base_class = storage.QueueBase + controller_base_class = storage.Queue def setUp(self): super(QueueControllerTest, self).setUp() @@ -224,7 +224,7 @@ class MessageControllerTest(ControllerBaseTest): to clean up storage's state. """ queue_name = 'test_queue' - controller_base_class = storage.MessageBase + controller_base_class = storage.Message # Specifies how often expired messages are purged, in sec. gc_interval = 0 @@ -458,7 +458,7 @@ class ClaimControllerTest(ControllerBaseTest): to clean up storage's state. """ queue_name = 'test_queue' - controller_base_class = storage.ClaimBase + controller_base_class = storage.Claim def setUp(self): super(ClaimControllerTest, self).setUp()