b96ad2646323436d426a537f63391dc03a435441
[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.BindingService;
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.dom.api.DOMDataBroker;
21 import org.opendaylight.mdsal.dom.api.DOMDataTreeService;
22 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
23 import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
24 import org.opendaylight.mdsal.dom.api.DOMNotificationService;
25 import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
26 import org.opendaylight.mdsal.dom.api.DOMRpcService;
27 import org.opendaylight.mdsal.dom.api.DOMService;
28
29 /**
30  * Factory to turn various {@link DOMService}s into {@link BindingService}s.
31  *
32  * @author Thomas Pantelis
33  */
34 @Beta
35 @NonNullByDefault
36 public interface AdapterFactory {
37     /**
38      * Create a {@link DataBroker} backed by a {@link DOMDataBroker}.
39      *
40      * @param domService Backing DOMDataBroker
41      * @return A DataBroker
42      * @throws NullPointerException if {@code domService} is null
43      */
44     DataBroker createDataBroker(DOMDataBroker domService);
45
46     /**
47      * Create a {@link DataTreeService} backed by a {@link DOMDataTreeService}.
48      *
49      * @param domService Backing DOMDataTreeService
50      * @return A DataTreeService
51      * @throws NullPointerException if {@code domService} is null
52      */
53     DataTreeService createDataTreeService(DOMDataTreeService domService);
54
55     /**
56      * Create a {@link MountPointService} backed by a {@link DOMMountPointService}.
57      *
58      * @param domService Backing DOMMountPointService
59      * @return A MountPointService
60      * @throws NullPointerException if {@code domService} is null
61      */
62     MountPointService createMountPointService(DOMMountPointService domService);
63
64     /**
65      * Create a {@link DataBroker} backed by a {@link DOMDataBroker}.
66      *
67      * @param domService Backing DOMDataBroker
68      * @return A DataBroker
69      * @throws NullPointerException if {@code domService} is null
70      */
71     NotificationService createNotificationService(DOMNotificationService domService);
72
73     /**
74      * Create a {@link NotificationPublishService} backed by a {@link DOMNotificationPublishService}.
75      *
76      * @param domService Backing DOMNotificationPublishService
77      * @return A NotificationPublishService
78      * @throws NullPointerException if {@code domService} is null
79      */
80     NotificationPublishService createNotificationPublishService(DOMNotificationPublishService domService);
81
82     /**
83      * Create a {@link RpcConsumerRegistry} backed by a {@link DOMRpcService}.
84      *
85      * @param domService Backing DOMRpcService
86      * @return A RpcConsumerRegistry
87      * @throws NullPointerException if {@code domService} is null
88      */
89     RpcConsumerRegistry createRpcConsumerRegistry(DOMRpcService domService);
90
91     /**
92      * Create a {@link RpcProviderService} backed by a {@link DOMRpcProviderService}.
93      *
94      * @param domService Backing DOMRpcProviderService
95      * @return A RpcProviderService
96      * @throws NullPointerException if {@code domService} is null
97      */
98     RpcProviderService createRpcProviderService(DOMRpcProviderService domService);
99 }