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