pubSubFactory.py
Go to the documentation of this file.
00001 # MIT License
00002 #
00003 # Copyright (c) <2015> <Ikergune, Etxetar>
00004 #
00005 # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
00006 # (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
00007 # publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
00008 # subject to the following conditions:
00009 #
00010 # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
00011 #
00012 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00013 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
00014 # FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00015 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00016 
00017 from include.pubsub.iPubSub import Ipublisher, Isubscriber, IqueryBuilder
00018 
00019 from include.pubsub.contextbroker.cbPublisher import CbPublisher
00020 from include.pubsub.contextbroker.cbSubscriber import CbSubscriber
00021 from include.pubsub.contextbroker.cbQueryBuilder import CbQueryBuilder
00022 
00023 PUBSUB_TYPE = "ContextBroker"
00024 
00025 
00026 class PublisherFactory:
00027     @staticmethod
00028     def create():
00029         if PUBSUB_TYPE is "ContextBroker":
00030             return CbPublisher()
00031         else:
00032             return Ipublisher()
00033 
00034     @staticmethod
00035     def getClass():
00036         if PUBSUB_TYPE is "ContextBroker":
00037             return CbPublisher
00038         else:
00039             return Ipublisher
00040 
00041 
00042 class SubscriberFactory:
00043     @staticmethod
00044     def create():
00045         if PUBSUB_TYPE is "ContextBroker":
00046             return CbSubscriber()
00047         else:
00048             return Isubscriber()
00049 
00050     @staticmethod
00051     def getClass():
00052         if PUBSUB_TYPE is "ContextBroker":
00053             return CbSubscriber
00054         else:
00055             return Isubscriber
00056 
00057 
00058 class QueryBuilderFactory:
00059     @staticmethod
00060     def create():
00061         if PUBSUB_TYPE is "ContextBroker":
00062             return CbQueryBuilder()
00063         else:
00064             return IqueryBuilder()
00065 
00066     @staticmethod
00067     def getClass():
00068         if PUBSUB_TYPE is "ContextBroker":
00069             return CbQueryBuilder
00070         else:
00071             return IqueryBuilder


firos
Author(s): IƱigo Gonzalez, igonzalez@ikergune.com
autogenerated on Thu Jun 6 2019 17:51:04