2865d33480e9511b950fe0049472076041e2d1f9
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / main / java / org / opendaylight / mdsal / binding / dom / adapter / AbstractAdapterFactory.java
1 /*
2  * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.binding.dom.adapter;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.mdsal.binding.api.ActionProviderService;
12 import org.opendaylight.mdsal.binding.api.ActionService;
13 import org.opendaylight.mdsal.binding.api.DataBroker;
14 import org.opendaylight.mdsal.binding.api.DataTreeService;
15 import org.opendaylight.mdsal.binding.api.MountPointService;
16 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
17 import org.opendaylight.mdsal.binding.api.NotificationService;
18 import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
19 import org.opendaylight.mdsal.binding.api.RpcProviderService;
20 import org.opendaylight.mdsal.binding.dom.adapter.spi.AdapterFactory;
21 import org.opendaylight.mdsal.dom.api.DOMActionProviderService;
22 import org.opendaylight.mdsal.dom.api.DOMActionService;
23 import org.opendaylight.mdsal.dom.api.DOMDataBroker;
24 import org.opendaylight.mdsal.dom.api.DOMDataTreeService;
25 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
26 import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
27 import org.opendaylight.mdsal.dom.api.DOMNotificationService;
28 import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
29 import org.opendaylight.mdsal.dom.api.DOMRpcService;
30
31 abstract class AbstractAdapterFactory implements AdapterFactory {
32     @Override
33     public final DataBroker createDataBroker(final DOMDataBroker domService) {
34         return new BindingDOMDataBrokerAdapter(context(), domService);
35     }
36
37     @Override
38     public final DataTreeService createDataTreeService(final DOMDataTreeService domService) {
39         return new BindingDOMDataTreeServiceAdapter(context(), domService);
40     }
41
42     @Override
43     public final MountPointService createMountPointService(final DOMMountPointService domService) {
44         return new BindingDOMMountPointServiceAdapter(context(), domService);
45     }
46
47     @Override
48     public final NotificationService createNotificationService(final DOMNotificationService domService) {
49         return new BindingDOMNotificationServiceAdapter(context(), domService);
50     }
51
52     @Override
53     public final NotificationPublishService createNotificationPublishService(
54             final DOMNotificationPublishService domService) {
55         return new BindingDOMNotificationPublishServiceAdapter(context(), domService);
56     }
57
58     @Override
59     public final RpcConsumerRegistry createRpcConsumerRegistry(final DOMRpcService domService) {
60         return new BindingDOMRpcServiceAdapter(context(), domService);
61     }
62
63     @Override
64     public final RpcProviderService createRpcProviderService(final DOMRpcProviderService domService) {
65         return new BindingDOMRpcProviderServiceAdapter(context(), domService);
66     }
67
68     @Override
69     public final ActionService createActionService(final DOMActionService domService) {
70         return new ActionServiceAdapter(context(), domService);
71     }
72
73     @Override
74     public final ActionProviderService createActionProviderService(final DOMActionProviderService domService) {
75         return new ActionProviderServiceAdapter(context(), domService);
76     }
77
78     abstract @NonNull AdapterContext context();
79 }