Class DeviceContextImpl
java.lang.Object
org.opendaylight.openflowplugin.impl.device.DeviceContextImpl
- All Implemented Interfaces:
- AutoCloseable,- org.opendaylight.mdsal.singleton.api.ClusterSingletonService,- DeviceContext,- DeviceRegistry,- DeviceReplyProcessor,- RequestContextStack,- TxFacade,- ContextChainStateListener,- DeviceInitializationContext,- OFPContext,- ExtensionConverterProviderKeeper,- org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier>
public class DeviceContextImpl
extends Object
implements DeviceContext, ExtensionConverterProviderKeeper
- 
Method SummaryModifier and TypeMethodDescriptionvoidMethod to acquire a write transaction lock to perform atomic transactions to MD-SAL.<T extends org.opendaylight.yangtools.yang.binding.DataObject>
 voidaddDeleteToTxChain(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path) Method creates delete operation for provided path in underlying transaction chain.booleanChecks if device and controller supports single layer serialization.voidclose()com.google.common.util.concurrent.ListenableFuture<?><T> RequestContext<T>Method returns new request context for current request.Method exposes flow registry used for storing flow ids identified by calculated flow hash.Method exposes device group registry used for storing group ids.Get device info.Method exposes device meter registry used for storing meter ids.Method provides state of device represented by this device context.Returns the extension converters registry access point for by inner infrastructure.org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifierGets message spy.<T extends OfHeader>
 MultiMsgCollector<T>getMultiMsgCollector(RequestContext<List<T>> requestContext) Gets multi msg collector.Getter.org.opendaylight.mdsal.binding.api.ReadTransactionMethod exposes transaction created for device represented by this context.voidInitializes device information after master role acquistion.booleanMethod for initial submit transaction after successful initial gathering.voidbooleanChecks if the statistics polling property is enabled.booleanMethod returns true if transaction chain manager is enabled.voidIndicates that device context is fully published (e.g.: packetIn messages should be passed).voidonStateAcquired(ContextChainState state) Event triggered on context chain state change.oook()Getter.booleanprocessAlienMessage(OfHeader message) Method processes alien message from device.voidprocessExperimenterMessage(ExperimenterMessage notification) Processing of experimenter symmetric message from device.voidprocessFlowRemovedMessage(FlowRemoved flowRemoved) Method process async flow removed from device.voidprocessPacketInMessage(PacketInMessage packetInMessage) Method process async packet in from device.voidprocessPortStatusMessage(PortStatusMessage portStatus) Method process async port status from device.voidprocessReply(Xid xid, List<? extends OfHeader> ofHeaderList) Method that set future to context in Map.voidprocessReply(OfHeader ofHeader) Method that set future to context in Map.voidregisterMastershipWatcher(@NonNull ContextChainMastershipWatcher newWatcher) Registers mastership change listener to context.voidMethod to release the acquired write transaction lock.voidsetExtensionConverterProvider(ExtensionConverterProvider extensionConverterProvider) Sets the ExtensionConverterProvider.voidsetNotificationPublishService(org.opendaylight.mdsal.binding.api.NotificationPublishService notificationPublishService) Sets notification publish service.booleanMethod submits Transaction to DataStore.booleanMethod submits Transaction to DataStore and wait till completes by doing get on tx future.voidupdatePacketInRateLimit(long upperBound) change packetIn rate limiter borders.<T extends org.opendaylight.yangtools.yang.binding.DataObject>
 voidwriteToTransaction(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data) Method creates put operation using provided data in underlying transaction chain.<T extends org.opendaylight.yangtools.yang.binding.DataObject>
 voidwriteToTransactionWithParentsSlow(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data) Method creates put operation using provided data in underlying transaction chain and flag to create missing parents.
- 
Method Details- 
initialSubmitTransactionpublic boolean initialSubmitTransaction()Description copied from interface:DeviceContextMethod for initial submit transaction after successful initial gathering.- Specified by:
- initialSubmitTransactionin interface- DeviceContext
 
- 
getDeviceStateDescription copied from interface:DeviceContextMethod provides state of device represented by this device context.- Specified by:
- getDeviceStatein interface- DeviceContext
- Returns:
- DeviceState
 
- 
getReadTransactionpublic org.opendaylight.mdsal.binding.api.ReadTransaction getReadTransaction()Description copied from interface:TxFacadeMethod exposes transaction created for device represented by this context. This read only transaction has a fresh dataStore snapshot. There is a possibility to get different data set from DataStore as write transaction in this context.- Specified by:
- getReadTransactionin interface- TxFacade
- Returns:
- readOnlyTransaction - Don't forget to close it after finish reading
 
- 
isTransactionsEnabledpublic boolean isTransactionsEnabled()Description copied from interface:TxFacadeMethod returns true if transaction chain manager is enabled.- Specified by:
- isTransactionsEnabledin interface- TxFacade
- Returns:
- is transaction chain manager enabled
 
- 
writeToTransactionpublic <T extends org.opendaylight.yangtools.yang.binding.DataObject> void writeToTransaction(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data) Description copied from interface:TxFacadeMethod creates put operation using provided data in underlying transaction chain.- Specified by:
- writeToTransactionin interface- TxFacade
 
- 
writeToTransactionWithParentsSlowpublic <T extends org.opendaylight.yangtools.yang.binding.DataObject> void writeToTransactionWithParentsSlow(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data) Description copied from interface:TxFacadeMethod creates put operation using provided data in underlying transaction chain and flag to create missing parents. WARNING: This method is slow because of additional reading cost. Use it only if you really need to create parents.- Specified by:
- writeToTransactionWithParentsSlowin interface- TxFacade
 
- 
addDeleteToTxChainpublic <T extends org.opendaylight.yangtools.yang.binding.DataObject> void addDeleteToTxChain(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path) Description copied from interface:TxFacadeMethod creates delete operation for provided path in underlying transaction chain.- Specified by:
- addDeleteToTxChainin interface- TxFacade
 
- 
submitTransactionpublic boolean submitTransaction()Description copied from interface:TxFacadeMethod submits Transaction to DataStore.- Specified by:
- submitTransactionin interface- TxFacade
- Returns:
- transaction is submitted successfully
 
- 
syncSubmitTransactionpublic boolean syncSubmitTransaction()Description copied from interface:TxFacadeMethod submits Transaction to DataStore and wait till completes by doing get on tx future.- Specified by:
- syncSubmitTransactionin interface- TxFacade
- Returns:
- transaction is submitted successfully
 
- 
getPrimaryConnectionContextDescription copied from interface:DeviceContextGetter.- Specified by:
- getPrimaryConnectionContextin interface- DeviceContext
- Returns:
- current devices connection context
 
- 
getDeviceFlowRegistryDescription copied from interface:DeviceRegistryMethod exposes flow registry used for storing flow ids identified by calculated flow hash.- Specified by:
- getDeviceFlowRegistryin interface- DeviceRegistry
- Returns:
- DeviceFlowRegistry
 
- 
getDeviceGroupRegistryDescription copied from interface:DeviceRegistryMethod exposes device group registry used for storing group ids.- Specified by:
- getDeviceGroupRegistryin interface- DeviceRegistry
- Returns:
- DeviceGroupRegistry
 
- 
isStatisticsPollingOnpublic boolean isStatisticsPollingOn()Description copied from interface:DeviceContextChecks if the statistics polling property is enabled.- Specified by:
- isStatisticsPollingOnin interface- DeviceContext
- Returns:
- true if statistics polling is enabled.
 
- 
getDeviceMeterRegistryDescription copied from interface:DeviceRegistryMethod exposes device meter registry used for storing meter ids.- Specified by:
- getDeviceMeterRegistryin interface- DeviceRegistry
- Returns:
- DeviceMaterRegistry
 
- 
processReplyDescription copied from interface:DeviceReplyProcessorMethod that set future to context in Map.- Specified by:
- processReplyin interface- DeviceReplyProcessor
- Parameters:
- ofHeader- openflow header
 
- 
processReplyDescription copied from interface:DeviceReplyProcessorMethod that set future to context in Map.- Specified by:
- processReplyin interface- DeviceReplyProcessor
- Parameters:
- xid- xid
- ofHeaderList- openflow header list
 
- 
processFlowRemovedMessageDescription copied from interface:DeviceReplyProcessorMethod process async flow removed from device.- Specified by:
- processFlowRemovedMessagein interface- DeviceReplyProcessor
- Parameters:
- flowRemoved- flow removed
 
- 
processPortStatusMessageDescription copied from interface:DeviceReplyProcessorMethod process async port status from device.- Specified by:
- processPortStatusMessagein interface- DeviceReplyProcessor
- Parameters:
- portStatus- port status
 
- 
processPacketInMessageDescription copied from interface:DeviceReplyProcessorMethod process async packet in from device.- Specified by:
- processPacketInMessagein interface- DeviceReplyProcessor
- Parameters:
- packetInMessage- packet in message
 
- 
processExperimenterMessageDescription copied from interface:DeviceReplyProcessorProcessing of experimenter symmetric message from device.- Specified by:
- processExperimenterMessagein interface- DeviceReplyProcessor
- Parameters:
- notification- notification
 
- 
processAlienMessageDescription copied from interface:DeviceReplyProcessorMethod processes alien message from device.- Specified by:
- processAlienMessagein interface- DeviceReplyProcessor
- Parameters:
- message- alien message
- Returns:
- true if alien message was successfully processed
 
- 
oookDescription copied from interface:DeviceContextGetter.- Specified by:
- oookin interface- DeviceContext
- Returns:
- translator library
 
- 
setNotificationPublishServicepublic void setNotificationPublishService(org.opendaylight.mdsal.binding.api.NotificationPublishService notificationPublishService) Description copied from interface:DeviceContextSets notification publish service.- Specified by:
- setNotificationPublishServicein interface- DeviceContext
- Parameters:
- notificationPublishService- the notification publish service
 
- 
getMessageSpyDescription copied from interface:DeviceContextGets message spy.- Specified by:
- getMessageSpyin interface- DeviceContext
- Returns:
- the message spy
 
- 
onPublishedpublic void onPublished()Description copied from interface:DeviceContextIndicates that device context is fully published (e.g.: packetIn messages should be passed).- Specified by:
- onPublishedin interface- DeviceContext
 
- 
getMultiMsgCollectorpublic <T extends OfHeader> MultiMsgCollector<T> getMultiMsgCollector(RequestContext<List<T>> requestContext) Description copied from interface:DeviceContextGets multi msg collector.- Specified by:
- getMultiMsgCollectorin interface- DeviceContext
- Type Parameters:
- T- the type parameter
- Parameters:
- requestContext- the request context
- Returns:
- the multi msg collector
 
- 
updatePacketInRateLimitpublic void updatePacketInRateLimit(long upperBound) Description copied from interface:DeviceContextchange packetIn rate limiter borders.- Specified by:
- updatePacketInRateLimitin interface- DeviceContext
- Parameters:
- upperBound- max amount of outstanding packetIns
 
- 
setExtensionConverterProviderDescription copied from interface:ExtensionConverterProviderKeeperSets the ExtensionConverterProvider. Extension converters will be kept in order to be accessible by inner infrastructure.- Specified by:
- setExtensionConverterProviderin interface- ExtensionConverterProviderKeeper
- Parameters:
- extensionConverterProvider- the ExtensionConverterProvider
 
- 
getExtensionConverterProviderDescription copied from interface:ExtensionConverterProviderKeeperReturns the extension converters registry access point for by inner infrastructure.- Specified by:
- getExtensionConverterProviderin interface- ExtensionConverterProviderKeeper
- Returns:
- extensionConverterProvider
 
- 
closeServiceInstancepublic com.google.common.util.concurrent.ListenableFuture<?> closeServiceInstance()- Specified by:
- closeServiceInstancein interface- org.opendaylight.mdsal.singleton.api.ClusterSingletonService
 
- 
getDeviceInfoDescription copied from interface:OFPContextGet device info.- Specified by:
- getDeviceInfoin interface- OFPContext
- Returns:
- device info
 
- 
registerMastershipWatcherDescription copied from interface:OFPContextRegisters mastership change listener to context.- Specified by:
- registerMastershipWatcherin interface- OFPContext
- Parameters:
- newWatcher- mastership change listener
 
- 
getIdentifierpublic org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier getIdentifier()- Specified by:
- getIdentifierin interface- org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier>
 
- 
acquireWriteTransactionLockpublic void acquireWriteTransactionLock()Description copied from interface:TxFacadeMethod to acquire a write transaction lock to perform atomic transactions to MD-SAL.- Specified by:
- acquireWriteTransactionLockin interface- TxFacade
 
- 
releaseWriteTransactionLockpublic void releaseWriteTransactionLock()Description copied from interface:TxFacadeMethod to release the acquired write transaction lock.- Specified by:
- releaseWriteTransactionLockin interface- TxFacade
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- OFPContext
 
- 
canUseSingleLayerSerializationpublic boolean canUseSingleLayerSerialization()Description copied from interface:DeviceContextChecks if device and controller supports single layer serialization.- Specified by:
- canUseSingleLayerSerializationin interface- DeviceContext
- Returns:
- true if single layer serialization is supported
 
- 
instantiateServiceInstancepublic void instantiateServiceInstance()- Specified by:
- instantiateServiceInstancein interface- org.opendaylight.mdsal.singleton.api.ClusterSingletonService
 
- 
initializeDevicepublic void initializeDevice()Description copied from interface:DeviceInitializationContextInitializes device information after master role acquistion.- Specified by:
- initializeDevicein interface- DeviceInitializationContext
 
- 
createRequestContextDescription copied from interface:RequestContextStackMethod returns new request context for current request.- Specified by:
- createRequestContextin interface- RequestContextStack
- Returns:
- A request context, or null if one cannot be created.
 
- 
onStateAcquiredDescription copied from interface:ContextChainStateListenerEvent triggered on context chain state change.- Specified by:
- onStateAcquiredin interface- ContextChainStateListener
- Parameters:
- state- context chain state
 
- 
getFlowGroupInfoHistory- Specified by:
- getFlowGroupInfoHistoryin interface- DeviceContext
 
 
-