Interface DeviceContext
- All Superinterfaces:
AutoCloseable
,org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService
,ContextChainStateListener
,DeviceInitializationContext
,DeviceRegistry
,DeviceReplyProcessor
,org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier>
,OFPContext
,RequestContextStack
,TxFacade
- All Known Implementing Classes:
DeviceContextImpl
public interface DeviceContext
extends OFPContext, DeviceReplyProcessor, TxFacade, DeviceRegistry, RequestContextStack, ContextChainStateListener, DeviceInitializationContext
The central entity of OFP is the Device Context, which encapsulate the logical state of a switch
as seen by the controller. Each OpenFlow session is tracked by a Connection Context.
These attach to a particular Device Context in such a way, that there is at most one primary
session associated with a Device Context. Whenever the controller needs to interact with a
particular switch, it will do so in the context of the calling thread, obtaining a lock on
the corresponding Device Context – thus the Device Context becomes the fine-grained point
of synchronization. The only two entities allowed to send requests towards the switch are
Statistics Manager and RPC Manager. Each of them allocates a Request Context for interacting
with a particular Device Context. The Request Contexts are the basic units of fairness,
which is enforced by keeping a cap on the number of outstanding requests a particular Request
Context can have at any point in time. Should this quota be exceeded, any further attempt to make
a request to the switch will fail immediately, with proper error indication.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if device and controller supports single layer serialization.Method provides state of device represented by this device context.@Nullable FlowGroupInfoHistory
Gets message spy.<T extends OfHeader>
MultiMsgCollector<T>getMultiMsgCollector
(RequestContext<List<T>> requestContext) Gets multi msg collector.Getter.boolean
Method for initial submit transaction after successful initial gathering.boolean
Checks if the statistics polling property is enabled.void
Indicates that device context is fully published (e.g.: packetIn messages should be passed).oook()
Getter.void
setNotificationPublishService
(org.opendaylight.mdsal.binding.api.NotificationPublishService notificationPublishService) Sets notification publish service.void
updatePacketInRateLimit
(long upperBound) change packetIn rate limiter borders.Methods inherited from interface org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService
closeServiceInstance, instantiateServiceInstance
Methods inherited from interface org.opendaylight.openflowplugin.api.openflow.lifecycle.ContextChainStateListener
onStateAcquired
Methods inherited from interface org.opendaylight.openflowplugin.api.openflow.lifecycle.DeviceInitializationContext
initializeDevice
Methods inherited from interface org.opendaylight.openflowplugin.api.openflow.device.DeviceRegistry
getDeviceFlowRegistry, getDeviceGroupRegistry, getDeviceMeterRegistry
Methods inherited from interface org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceReplyProcessor
processAlienMessage, processExperimenterMessage, processFlowRemovedMessage, processPacketInMessage, processPortStatusMessage, processReply, processReply
Methods inherited from interface org.opendaylight.yangtools.concepts.Identifiable
getIdentifier
Methods inherited from interface org.opendaylight.openflowplugin.api.openflow.OFPContext
close, getDeviceInfo, registerMastershipWatcher
Methods inherited from interface org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack
createRequestContext
Methods inherited from interface org.opendaylight.openflowplugin.api.openflow.device.TxFacade
acquireWriteTransactionLock, addDeleteToTxChain, getReadTransaction, isTransactionsEnabled, releaseWriteTransactionLock, submitTransaction, syncSubmitTransaction, writeToTransaction, writeToTransactionWithParentsSlow
-
Method Details
-
getDeviceState
DeviceState getDeviceState()Method provides state of device represented by this device context.- Returns:
DeviceState
-
getPrimaryConnectionContext
ConnectionContext getPrimaryConnectionContext()Getter.- Returns:
- current devices connection context
-
oook
TranslatorLibrary oook()Getter.- Returns:
- translator library
-
setNotificationPublishService
void setNotificationPublishService(org.opendaylight.mdsal.binding.api.NotificationPublishService notificationPublishService) Sets notification publish service.- Parameters:
notificationPublishService
- the notification publish service
-
getMessageSpy
MessageSpy getMessageSpy()Gets message spy.- Returns:
- the message spy
-
getMultiMsgCollector
<T extends OfHeader> MultiMsgCollector<T> getMultiMsgCollector(RequestContext<List<T>> requestContext) Gets multi msg collector.- Type Parameters:
T
- the type parameter- Parameters:
requestContext
- the request context- Returns:
- the multi msg collector
-
onPublished
void onPublished()Indicates that device context is fully published (e.g.: packetIn messages should be passed). -
updatePacketInRateLimit
void updatePacketInRateLimit(long upperBound) change packetIn rate limiter borders.- Parameters:
upperBound
- max amount of outstanding packetIns
-
canUseSingleLayerSerialization
boolean canUseSingleLayerSerialization()Checks if device and controller supports single layer serialization.- Returns:
- true if single layer serialization is supported
-
initialSubmitTransaction
boolean initialSubmitTransaction()Method for initial submit transaction after successful initial gathering. -
isStatisticsPollingOn
boolean isStatisticsPollingOn()Checks if the statistics polling property is enabled.- Returns:
- true if statistics polling is enabled.
-
getFlowGroupInfoHistory
-