2 * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
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
9 package org.opendaylight.controller.config.yang.config.groupbasedpolicy;
11 import java.util.concurrent.Future;
13 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
14 import org.opendaylight.groupbasedpolicy.api.DomainSpecificRegistry;
15 import org.opendaylight.groupbasedpolicy.api.EndpointAugmentorRegistry;
16 import org.opendaylight.groupbasedpolicy.api.NetworkDomainAugmentorRegistry;
17 import org.opendaylight.groupbasedpolicy.base_endpoint.BaseEndpointServiceImpl;
18 import org.opendaylight.groupbasedpolicy.base_endpoint.EndpointAugmentorRegistryImpl;
19 import org.opendaylight.groupbasedpolicy.forwarding.NetworkDomainAugmentorRegistryImpl;
20 import org.opendaylight.groupbasedpolicy.renderer.RendererManager;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.BaseEndpointService;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.RegisterEndpointInput;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.UnregisterEndpointInput;
24 import org.opendaylight.yangtools.yang.common.RpcResult;
26 public class DomainSpecificRegistryInstance implements DomainSpecificRegistry, BaseEndpointService, AutoCloseable {
28 private final EndpointAugmentorRegistryImpl endpointAugmentorRegistryImpl;
29 private final NetworkDomainAugmentorRegistryImpl netDomainAugmentorRegistryImpl;
30 private final BaseEndpointServiceImpl baseEndpointServiceImpl;
31 private final RendererManager rendererManager;
33 public DomainSpecificRegistryInstance(DataBroker dataProvider) {
34 endpointAugmentorRegistryImpl = new EndpointAugmentorRegistryImpl();
35 netDomainAugmentorRegistryImpl = new NetworkDomainAugmentorRegistryImpl();
36 baseEndpointServiceImpl = new BaseEndpointServiceImpl(dataProvider, endpointAugmentorRegistryImpl);
37 rendererManager = new RendererManager(dataProvider, netDomainAugmentorRegistryImpl, endpointAugmentorRegistryImpl);
41 public void close() throws Exception {
42 baseEndpointServiceImpl.close();
43 rendererManager.close();
47 public EndpointAugmentorRegistry getEndpointAugmentorRegistry() {
48 return endpointAugmentorRegistryImpl;
52 public NetworkDomainAugmentorRegistry getNetworkDomainAugmentorRegistry() {
53 return netDomainAugmentorRegistryImpl;
57 public Future<RpcResult<Void>> unregisterEndpoint(UnregisterEndpointInput input) {
58 return baseEndpointServiceImpl.unregisterEndpoint(input);
62 public Future<RpcResult<Void>> registerEndpoint(RegisterEndpointInput input) {
63 return baseEndpointServiceImpl.registerEndpoint(input);