2 * Copyright (c) 2016 Red Hat, Inc. and others. 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
8 package org.opendaylight.netvirt.aclservice;
10 import javax.inject.Inject;
11 import javax.inject.Singleton;
12 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
13 import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
14 import org.opendaylight.infrautils.inject.AbstractLifecycle;
15 import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
16 import org.opendaylight.netvirt.aclservice.api.AclInterfaceCache;
17 import org.opendaylight.netvirt.aclservice.utils.AclDataUtil;
18 import org.opendaylight.netvirt.aclservice.utils.AclServiceUtils;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.config.rev160806.AclserviceConfig;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
24 public class AclServiceImplFactory extends AbstractLifecycle {
26 private static final Logger LOG = LoggerFactory.getLogger(AclServiceImplFactory.class);
27 //private static final String SECURITY_GROUP_MODE = "security-group-mode";
29 private final DataBroker dataBroker;
30 private final IMdsalApiManager mdsalManager;
31 private final AclDataUtil aclDataUtil;
32 private final AclServiceUtils aclServiceUtils;
33 private final JobCoordinator jobCoordinator;
34 private final AclInterfaceCache aclInterfaceCache;
37 public AclServiceImplFactory(DataBroker dataBroker, IMdsalApiManager mdsalManager, AclserviceConfig config,
38 AclDataUtil aclDataUtil, AclServiceUtils aclServiceUtils, JobCoordinator jobCoordinator,
39 AclInterfaceCache aclInterfaceCache) {
40 this.dataBroker = dataBroker;
41 this.mdsalManager = mdsalManager;
42 this.aclDataUtil = aclDataUtil;
43 this.aclServiceUtils = aclServiceUtils;
44 this.jobCoordinator = jobCoordinator;
45 this.aclInterfaceCache = aclInterfaceCache;
47 LOG.info("AclserviceConfig: {}", config);
51 protected void start() {
52 LOG.info("{} start", getClass().getSimpleName());
56 protected void stop() {
57 LOG.info("{} close", getClass().getSimpleName());
60 public IngressAclServiceImpl createIngressAclServiceImpl() {
61 LOG.info("creating ingress acl service");
62 return new IngressAclServiceImpl(dataBroker, mdsalManager, aclDataUtil, aclServiceUtils, jobCoordinator,
66 public EgressAclServiceImpl createEgressAclServiceImpl() {
67 LOG.info("creating egress acl service");
68 return new EgressAclServiceImpl(dataBroker, mdsalManager, aclDataUtil, aclServiceUtils, jobCoordinator,