Simplify DOMOperationService API
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / main / java / org / opendaylight / mdsal / binding / dom / adapter / spi / AdapterFactory.java
1 /*
2  * Copyright (c) 2018 Inocybe Technologies 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.spi;
9
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.opendaylight.mdsal.binding.api.ActionService;
13 import org.opendaylight.mdsal.binding.api.BindingService;
14 import org.opendaylight.mdsal.binding.api.DataBroker;
15 import org.opendaylight.mdsal.binding.api.DataTreeService;
16 import org.opendaylight.mdsal.binding.api.MountPointService;
17 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
18 import org.opendaylight.mdsal.binding.api.NotificationService;
19 import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
20 import org.opendaylight.mdsal.binding.api.RpcProviderService;
21 import org.opendaylight.mdsal.dom.api.DOMActionService;
22 import org.opendaylight.mdsal.dom.api.DOMDataBroker;
23 import org.opendaylight.mdsal.dom.api.DOMDataTreeService;
24 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
25 import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
26 import org.opendaylight.mdsal.dom.api.DOMNotificationService;
27 import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
28 import org.opendaylight.mdsal.dom.api.DOMRpcService;
29 import org.opendaylight.mdsal.dom.api.DOMService;
30
31 /**
32  * Factory to turn various {@link DOMService}s into {@link BindingService}s.
33  *
34  * @author Thomas Pantelis
35  */
36 @Beta
37 @NonNullByDefault
38 public interface AdapterFactory {
39     /**
40      * Create a {@link DataBroker} backed by a {@link DOMDataBroker}.
41      *
42      * @param domService Backing DOMDataBroker
43      * @return A DataBroker
44      * @throws NullPointerException if {@code domService} is null
45      */
46     DataBroker createDataBroker(DOMDataBroker domService);
47
48     /**
49      * Create a {@link DataTreeService} backed by a {@link DOMDataTreeService}.
50      *
51      * @param domService Backing DOMDataTreeService
52      * @return A DataTreeService
53      * @throws NullPointerException if {@code domService} is null
54      */
55     DataTreeService createDataTreeService(DOMDataTreeService domService);
56
57     /**
58      * Create a {@link MountPointService} backed by a {@link DOMMountPointService}.
59      *
60      * @param domService Backing DOMMountPointService
61      * @return A MountPointService
62      * @throws NullPointerException if {@code domService} is null
63      */
64     MountPointService createMountPointService(DOMMountPointService domService);
65
66     /**
67      * Create a {@link DataBroker} backed by a {@link DOMDataBroker}.
68      *
69      * @param domService Backing DOMDataBroker
70      * @return A DataBroker
71      * @throws NullPointerException if {@code domService} is null
72      */
73     NotificationService createNotificationService(DOMNotificationService domService);
74
75     /**
76      * Create a {@link NotificationPublishService} backed by a {@link DOMNotificationPublishService}.
77      *
78      * @param domService Backing DOMNotificationPublishService
79      * @return A NotificationPublishService
80      * @throws NullPointerException if {@code domService} is null
81      */
82     NotificationPublishService createNotificationPublishService(DOMNotificationPublishService domService);
83
84     /**
85      * Create a {@link RpcConsumerRegistry} backed by a {@link DOMRpcService}.
86      *
87      * @param domService Backing DOMRpcService
88      * @return A RpcConsumerRegistry
89      * @throws NullPointerException if {@code domService} is null
90      */
91     RpcConsumerRegistry createRpcConsumerRegistry(DOMRpcService domService);
92
93     /**
94      * Create a {@link RpcProviderService} backed by a {@link DOMRpcProviderService}.
95      *
96      * @param domService Backing DOMRpcProviderService
97      * @return A RpcProviderService
98      * @throws NullPointerException if {@code domService} is null
99      */
100     RpcProviderService createRpcProviderService(DOMRpcProviderService domService);
101
102     /**
103      * Create a {@link ActionService} backed by a {@link DOMActionService}.
104      *
105      * @param domService Backing DOMOperationService
106      * @return A ActionService
107      * @throws NullPointerException if {@code domService} is null
108      */
109     ActionService createActionService(DOMActionService domService);
110 }