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:

    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 Detail

      • getDeviceState

        DeviceState getDeviceState()
        Method provides state of device represented by this device context.
      • getPrimaryConnectionContext

        ConnectionContext getPrimaryConnectionContext()
        current devices connection context
      • setNotificationPublishService

        void setNotificationPublishService​(org.opendaylight.mdsal.binding.api.NotificationPublishService notificationPublishService)
        Sets notification publish service.
        notificationPublishService - the notification publish service
      • getMessageSpy

        MessageSpy getMessageSpy()
        Gets message spy.
        the message spy
      • getMultiMsgCollector

        <T extends OfHeaderMultiMsgCollector<T> getMultiMsgCollector​(RequestContext<List<T>> requestContext)
        Gets multi msg collector.
        Type Parameters:
        T - the type parameter
        requestContext - the request context
        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.
        upperBound - max amount of outstanding packetIns
      • canUseSingleLayerSerialization

        boolean canUseSingleLayerSerialization()
        Checks if device and controller supports single layer serialization.
        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.
        true if statistics polling is enabled.