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 |
Rizwan Haider | e6ffdc0 | 2016-11-08 13:43:48 -0500 | [diff] [blame] | 5 | from synchronizers.metronetwork.invokers.servicespokeinvoker import ServiceSpokeInvoker |
| 6 | from synchronizers.metronetwork.invokers.vnodglobalserviceinvoker import VnodGlobalServiceInvoker |
| 7 | from synchronizers.metronetwork.invokers.remoteportinvoker import RemotePortInvoker |
Rizwan Haider | 65baf55 | 2016-09-28 16:47:28 -0400 | [diff] [blame] | 8 | |
| 9 | |
| 10 | class InvokerFactory(object): |
| 11 | @staticmethod |
| 12 | def getinvoker(obj): |
| 13 | # |
| 14 | # Here is where we build various invokers |
| 15 | # |
| 16 | if isinstance(obj, NetworkMultipointToMultipointConnection): |
| 17 | return NetworkMultipointToMultipointInvoker() |
| 18 | elif isinstance(obj, NetworkEdgeToEdgePointConnection): |
| 19 | return NetworkEdgeToEdgePointInvoker() |
| 20 | elif isinstance(obj, NetworkEdgeToMultipointConnection): |
| 21 | return NetworkEdgeToMultipointInvoker() |
Rizwan Haider | e6ffdc0 | 2016-11-08 13:43:48 -0500 | [diff] [blame] | 22 | elif isinstance(obj, ServiceSpoke): |
| 23 | return ServiceSpokeInvoker() |
| 24 | elif isinstance(obj, VnodGlobalService): |
| 25 | return VnodGlobalServiceInvoker() |
| 26 | elif isinstance(obj, RemotePort): |
| 27 | return RemotePortInvoker() |
Rizwan Haider | 65baf55 | 2016-09-28 16:47:28 -0400 | [diff] [blame] | 28 | else: |
| 29 | return None |