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.DeviceManager;
15 import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsManager;
16 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
19 import javax.annotation.Nonnull;
20 import java.util.concurrent.TimeUnit;
23 * This class is a binder between all managers
24 * Should be defined in OpenFlowPluginProviderImpl
26 public interface LifecycleConductor {
29 * Returns device context from device manager device contexts maps
30 * @param nodeId node identification
31 * @return null if context doesn't exists
33 DeviceContext getDeviceContext(final NodeId nodeId);
36 * Registers ont time listener for notify when services rpc, statistics are done stop or start
37 * @param manager service change listener
38 * @param nodeId node identification
40 void addOneTimeListenerWhenServicesChangesDone(final ServiceChangeListener manager, final NodeId nodeId);
43 * Returns device of version
44 * @param nodeId node identification
45 * @return null if device context doesn't exists
47 Short gainVersionSafely(final NodeId nodeId);
50 * Set new timeout for {@link io.netty.util.HashedWheelTimer}
51 * @param task timer task
53 * @param unit time unit
56 Timeout newTimeout(@Nonnull TimerTask task, long delay, @Nonnull TimeUnit unit);
59 * Returns message intelligence agency
60 * @return MessageIntelligenceAgency set by constructor
62 MessageIntelligenceAgency getMessageIntelligenceAgency();
65 * Interrupt connection for the node
66 * @param nodeId node identification
68 void closeConnection(final NodeId nodeId);
71 * Setter for device manager once set it cant be unset or overwritten
72 * @param deviceManager should be set in OpenFlowPluginProviderImpl
74 void setSafelyDeviceManager(final DeviceManager deviceManager);
77 * Setter for statistics manager once set it cant be unset or overwritten
78 * @param statisticsManager should be set in OpenFlowPluginProviderImpl
80 void setSafelyStatisticsManager(final StatisticsManager statisticsManager);
83 * Xid from outboundqueue
87 Long reserveXidForDeviceMessage(final NodeId nodeId);