2 * Copyright (c) 2015 Cisco 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.openflowplugin.api.openflow;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
12 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
13 import org.opendaylight.openflowplugin.api.openflow.device.handlers.ClusterInitializationPhaseHandler;
14 import org.opendaylight.openflowplugin.api.openflow.device.handlers.ClusterLifecycleSupervisor;
17 * General API for all OFP Context.
19 public interface OFPContext extends AutoCloseable, ClusterLifecycleSupervisor, ClusterInitializationPhaseHandler {
26 /* Initialization phase, context not yet fully initialized */
28 /* Standard working phase everything is fine */
30 /* Termination phase context is being shutting down */
35 * Get actual context state.
36 * @return actual context state
38 ContextState getState();
41 * About to stop services in cluster not master anymore or going down.
42 * @return Future most of services need time to be closed.
44 ListenableFuture<Void> stopClusterServices();
47 * Get cluster singleton service identifier.
48 * @return cluster singleton service identifier.
50 ServiceGroupIdentifier getServiceIdentifier();
56 DeviceInfo getDeviceInfo();