blob: 5f0baaa16ce40daf349df2c43379da53b9fe835b [file] [log] [blame]
Matteo Scandolofcf842e2017-08-08 13:05:25 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Rizwan Haider65baf552016-09-28 16:47:28 -040017from services.metronetwork.models import *
18from synchronizers.metronetwork.invokers.networkmultipointtomultipointinvoker import NetworkMultipointToMultipointInvoker
19from synchronizers.metronetwork.invokers.networkedgetoedgepointinvoker import NetworkEdgeToEdgePointInvoker
20from synchronizers.metronetwork.invokers.networkedgetomultipointinvoker import NetworkEdgeToMultipointInvoker
Rizwan Haidere6ffdc02016-11-08 13:43:48 -050021from synchronizers.metronetwork.invokers.servicespokeinvoker import ServiceSpokeInvoker
22from synchronizers.metronetwork.invokers.vnodglobalserviceinvoker import VnodGlobalServiceInvoker
23from synchronizers.metronetwork.invokers.remoteportinvoker import RemotePortInvoker
Rizwan Haider65baf552016-09-28 16:47:28 -040024
25
26class InvokerFactory(object):
27 @staticmethod
28 def getinvoker(obj):
29 #
30 # Here is where we build various invokers
31 #
32 if isinstance(obj, NetworkMultipointToMultipointConnection):
33 return NetworkMultipointToMultipointInvoker()
34 elif isinstance(obj, NetworkEdgeToEdgePointConnection):
35 return NetworkEdgeToEdgePointInvoker()
36 elif isinstance(obj, NetworkEdgeToMultipointConnection):
37 return NetworkEdgeToMultipointInvoker()
Rizwan Haidere6ffdc02016-11-08 13:43:48 -050038 elif isinstance(obj, ServiceSpoke):
39 return ServiceSpokeInvoker()
40 elif isinstance(obj, VnodGlobalService):
41 return VnodGlobalServiceInvoker()
42 elif isinstance(obj, RemotePort):
43 return RemotePortInvoker()
Rizwan Haider65baf552016-09-28 16:47:28 -040044 else:
45 return None