2 * Copyright (c) 2016 Pantheon Technologies s.r.o. 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.openflowplugin.impl.lifecycle;
10 import java.util.HashSet;
12 import java.util.concurrent.Future;
13 import org.opendaylight.openflowplugin.api.openflow.OFPContext;
14 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
15 import org.opendaylight.openflowplugin.api.openflow.lifecycle.ContextChain;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.ContextChainState;
18 public class ContextChainImpl implements ContextChain {
20 private Set<OFPContext> contexts = new HashSet<>();
21 private final ContextChainState contextChainState;
22 private ConnectionContext primaryConnectionContext;
24 public ContextChainImpl(final ContextChainState contextChainState) {
25 this.contextChainState = contextChainState;
29 public boolean isReady() {
34 public <T extends OFPContext> void addContext(final T context) {
39 public Future<Void> stopChain() {
44 public Future<Void> startChain() {
54 public void changePrimaryConnection(final ConnectionContext connectionContext) {
55 this.primaryConnectionContext = connectionContext;