ddda3f5909e2531e9e13ef2d97178f0a21c017df
[groupbasedpolicy.git] / renderers / iovisor / src / main / java / org / opendaylight / groupbasedpolicy / renderer / iovisor / IovisorRenderer.java
1 /*
2  * Copyright (c) 2015 Cisco Systems. 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
9 package org.opendaylight.groupbasedpolicy.renderer.iovisor;
10
11 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
12 import org.opendaylight.groupbasedpolicy.renderer.iovisor.endpoint.EndpointManager;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
15
16 /**
17  * Renderer that converts GBP services to IOVisor Agents
18  */
19 public class IovisorRenderer implements AutoCloseable {
20
21     private static final Logger LOG = LoggerFactory.getLogger(IovisorRenderer.class);
22
23     private EndpointManager endPointManager;
24
25     public IovisorRenderer(final DataBroker dataBroker) {
26         LOG.info("IOVisor Renderer has Started");
27         this.endPointManager = new EndpointManager(dataBroker);
28     }
29
30     @Override
31     public void close() throws Exception {
32         if (endPointManager != null) {
33             endPointManager.close();
34         }
35     }
36
37 }