Remove DOMDataTreeShard and all related interfaces
[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.MountPointService;
15 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
16 import org.opendaylight.mdsal.binding.api.NotificationService;
17 import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
18 import org.opendaylight.mdsal.binding.api.RpcProviderService;
19 import org.opendaylight.mdsal.binding.dom.adapter.spi.AdapterFactory;
20 import org.opendaylight.mdsal.dom.api.DOMActionProviderService;
21 import org.opendaylight.mdsal.dom.api.DOMActionService;
22 import org.opendaylight.mdsal.dom.api.DOMDataBroker;
23 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
24 import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
25 import org.opendaylight.mdsal.dom.api.DOMNotificationService;
26 import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
27 import org.opendaylight.mdsal.dom.api.DOMRpcService;
28
29 abstract class AbstractAdapterFactory implements AdapterFactory {
30     @Override
31     public final DataBroker createDataBroker(final DOMDataBroker domService) {
32         return new BindingDOMDataBrokerAdapter(context(), domService);
33     }
34
35     @Override
36     public final MountPointService createMountPointService(final DOMMountPointService domService) {
37         return new BindingDOMMountPointServiceAdapter(context(), domService);
38     }
39
40     @Override
41     public final NotificationService createNotificationService(final DOMNotificationService domService) {
42         return new BindingDOMNotificationServiceAdapter(context(), domService);
43     }
44
45     @Override
46     public final NotificationPublishService createNotificationPublishService(
47             final DOMNotificationPublishService domService) {
48         return new BindingDOMNotificationPublishServiceAdapter(context(), domService);
49     }
50
51     @Override
52     public final RpcConsumerRegistry createRpcConsumerRegistry(final DOMRpcService domService) {
53         return new BindingDOMRpcServiceAdapter(context(), domService);
54     }
55
56     @Override
57     public final RpcProviderService createRpcProviderService(final DOMRpcProviderService domService) {
58         return new BindingDOMRpcProviderServiceAdapter(context(), domService);
59     }
60
61     @Override
62     public final ActionService createActionService(final DOMActionService domService) {
63         return new ActionServiceAdapter(context(), domService);
64     }
65
66     @Override
67     public final ActionProviderService createActionProviderService(final DOMActionProviderService domService) {
68         return new ActionProviderServiceAdapter(context(), domService);
69     }
70
71     abstract @NonNull AdapterContext context();
72 }