Rizwan Haider | 65baf55 | 2016-09-28 16:47:28 -0400 | [diff] [blame^] | 1 | from services.metronetwork.models import * |
| 2 | from synchronizers.metronetwork.invokers.networkmultipointtomultipointinvoker import NetworkMultipointToMultipointInvoker |
| 3 | from synchronizers.metronetwork.invokers.networkedgetoedgepointinvoker import NetworkEdgeToEdgePointInvoker |
| 4 | from synchronizers.metronetwork.invokers.networkedgetomultipointinvoker import NetworkEdgeToMultipointInvoker |
| 5 | |
| 6 | |
| 7 | class InvokerFactory(object): |
| 8 | @staticmethod |
| 9 | def getinvoker(obj): |
| 10 | # |
| 11 | # Here is where we build various invokers |
| 12 | # |
| 13 | if isinstance(obj, NetworkMultipointToMultipointConnection): |
| 14 | return NetworkMultipointToMultipointInvoker() |
| 15 | elif isinstance(obj, NetworkEdgeToEdgePointConnection): |
| 16 | return NetworkEdgeToEdgePointInvoker() |
| 17 | elif isinstance(obj, NetworkEdgeToMultipointConnection): |
| 18 | return NetworkEdgeToMultipointInvoker() |
| 19 | else: |
| 20 | return None |