2 * Copyright (c) 2016 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
9 package org.opendaylight.openflowplugin.api.openflow.lifecycle;
11 import io.netty.util.Timeout;
12 import io.netty.util.TimerTask;
13 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
14 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
15 import org.opendaylight.openflowplugin.api.openflow.device.DeviceManager;
16 import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsManager;
17 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
20 import javax.annotation.Nonnull;
21 import java.util.concurrent.TimeUnit;
24 * This class is a binder between all managers
25 * Should be defined in OpenFlowPluginProviderImpl
27 public interface LifecycleConductor {
30 * Returns device context from device manager device contexts maps
32 * @param deviceInfo@return null if context doesn't exists
34 DeviceContext getDeviceContext(DeviceInfo deviceInfo);
37 * Registers ont time listener for notify when services rpc, statistics are done stop or start
38 * @param manager service change listener
39 * @param deviceInfo node identification
41 void addOneTimeListenerWhenServicesChangesDone(final ServiceChangeListener manager, final DeviceInfo deviceInfo);
44 * Returns device of version
45 * @param deviceInfo node identification
46 * @return null if device context doesn't exists
48 Short gainVersionSafely(final DeviceInfo deviceInfo);
51 * Set new timeout for {@link io.netty.util.HashedWheelTimer}
52 * @param task timer task
54 * @param unit time unit
57 Timeout newTimeout(@Nonnull TimerTask task, long delay, @Nonnull TimeUnit unit);
60 * Returns message intelligence agency
61 * @return MessageIntelligenceAgency set by constructor
63 MessageIntelligenceAgency getMessageIntelligenceAgency();
66 * Interrupt connection for the node
67 * @param deviceInfo node identification
69 void closeConnection(final DeviceInfo deviceInfo);
72 * Setter for device manager once set it cant be unset or overwritten
73 * @param deviceManager should be set in OpenFlowPluginProviderImpl
75 void setSafelyDeviceManager(final DeviceManager deviceManager);
78 * Setter for statistics manager once set it cant be unset or overwritten
79 * @param statisticsManager should be set in OpenFlowPluginProviderImpl
81 void setSafelyStatisticsManager(final StatisticsManager statisticsManager);
84 * Xid from outboundqueue
88 Long reserveXidForDeviceMessage(final DeviceInfo deviceInfo);