2 * Copyright (c) 2016 Brocade Communications Systems, 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.openflowjava.protocol.impl.core;
10 import static java.util.Objects.requireNonNull;
12 import javax.inject.Inject;
13 import javax.inject.Singleton;
14 import org.opendaylight.infrautils.diagstatus.DiagStatusService;
15 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
16 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProviderFactory;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow._switch.connection.config.rev160506.SwitchConnectionConfig;
18 import org.osgi.service.component.annotations.Activate;
19 import org.osgi.service.component.annotations.Component;
20 import org.osgi.service.component.annotations.Reference;
23 * Implementation of the SwitchConnectionProviderFactory interface.
27 public class SwitchConnectionProviderFactoryImpl implements SwitchConnectionProviderFactory {
28 private final DiagStatusService diagStatus;
32 public SwitchConnectionProviderFactoryImpl(@Reference final DiagStatusService diagStatus) {
33 this.diagStatus = requireNonNull(diagStatus);
37 public SwitchConnectionProvider newInstance(final SwitchConnectionConfig config) {
38 return new SwitchConnectionProviderImpl(diagStatus, new ConnectionConfigurationImpl(config));