X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=applications%2Fforwardingrules-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fapplications%2Ffrm%2FForwardingRulesManager.java;h=8f748cf72cc554eab87010c3df01e4790e3ca208;hb=777c94332871b8c34f56f7f2010de1536cb759ba;hp=d76dc97be9e04a4ebfde5c7449101d9aa310d903;hpb=d249ab7f81708d53c90c02dfca29e0083ac18b0c;p=openflowplugin.git diff --git a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/ForwardingRulesManager.java b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/ForwardingRulesManager.java index d76dc97be9..8f748cf72c 100644 --- a/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/ForwardingRulesManager.java +++ b/applications/forwardingrules-manager/src/main/java/org/opendaylight/openflowplugin/applications/frm/ForwardingRulesManager.java @@ -1,17 +1,17 @@ -/** - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. +/* + * Copyright (c) 2014, 2017 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.applications.frm; -import org.opendaylight.openflowplugin.applications.frm.impl.ForwardingRulesManagerConfig; -import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures; - -import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction; +import org.opendaylight.mdsal.binding.api.ReadTransaction; +import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationListener; +import org.opendaylight.openflowplugin.applications.frm.impl.DevicesGroupRegistry; +import org.opendaylight.openflowplugin.applications.frm.impl.FlowNodeConnectorInventoryTranslatorImpl; +import org.opendaylight.serviceutils.srm.RecoverableListener; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow; @@ -19,147 +19,198 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalF import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService; import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group; import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService; +import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.SalBundleService; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.app.arbitrator.reconcile.service.rev180227.ArbitratorReconcileService; import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService; +import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; /** - * forwardingrules-manager - * org.opendaylight.openflowplugin.applications.frm - * - * ForwardingRulesManager - * It represent a central point for whole modul. Implementation - * Flow Provider registers the link FlowChangeListener} and it holds all needed - * services for link FlowChangeListener}. + * It represent a central point for whole module. Implementation Flow Provider + * registers the link FlowChangeListener} and it holds all needed services for + * link FlowChangeListener}. * * @author Vaclav Demcak - * - * Created: Aug 25, 2014 */ -public interface ForwardingRulesManager extends AutoCloseable { +public interface ForwardingRulesManager extends ConfigurationListener, AutoCloseable { - public void start(); + void start(); /** - * Method returns information : - * "is Node with send InstanceIdentifier connected"? + * Method returns information : "is Node with send InstanceIdentifier + * connected"?. * - * @param ident - the key of the node + * @param ident + * - the key of the node * @return boolean - true if device is connected */ - public boolean isNodeActive(InstanceIdentifier ident); + boolean isNodeActive(InstanceIdentifier ident); /** - * Method returns information : - * "is Node with send InstanceIdentifier present in operational data store"? + * Method returns information : "is Node with send InstanceIdentifier present in + * operational data store"?. * - * @param ident - the key of the node + * @param ident + * - the key of the node * @return boolean - true if device is present in operational data store */ - public boolean checkNodeInOperationalDataStore(InstanceIdentifier ident); + boolean checkNodeInOperationalDataStore(InstanceIdentifier ident); /** - * Method add new {@link FlowCapableNode} to active Node Holder. - * ActiveNodeHolder prevent unnecessary Operational/DS read for identify - * pre-configure and serious Configure/DS transactions. + * Method returns generated transaction ID, which is unique for every + * transaction. ID is composite from prefix ("DOM") and unique number. * - * @param ident - the key of the node + * @return String transactionID for RPC transaction identification */ - public void registrateNewNode(InstanceIdentifier ident); + String getNewTransactionId(); /** - * Method remove disconnected {@link FlowCapableNode} from active Node - * Holder. And all next flows or groups or meters will stay in Config/DS - * only. + * Method returns Read Transaction. It is need for Node reconciliation only. * - * @param ident - the key of the node + * @return ReadOnlyTransaction */ - public void unregistrateNode(InstanceIdentifier ident); + ReadTransaction getReadTransaction(); /** - * Method returns generated transaction ID, which is unique for - * every transaction. ID is composite from prefix ("DOM") and unique number. + * Flow RPC service. * - * @return String transactionID for RPC transaction identification */ - public String getNewTransactionId(); + SalFlowService getSalFlowService(); /** - * Method returns Read Transacion. It is need for Node reconciliation only. + * Group RPC service. * - * @return ReadOnlyTransaction */ - public ReadOnlyTransaction getReadTranaction(); + SalGroupService getSalGroupService(); /** - * Flow RPC service + * Meter RPC service. * - * @return */ - public SalFlowService getSalFlowService(); + SalMeterService getSalMeterService(); /** - * Group RPC service + * Table RPC service. * - * @return */ - public SalGroupService getSalGroupService(); + SalTableService getSalTableService(); /** - * Meter RPC service + * Return Devices Group Registry which can be used to track the groups present in a device. * - * @return + * @return devicesGroupRegistry */ - public SalMeterService getSalMeterService(); + DevicesGroupRegistry getDevicesGroupRegistry(); /** - * Table RPC service + * Bundle RPC service. * - * @return + * @return salBundleService */ - public SalTableService getSalTableService(); + SalBundleService getSalBundleService(); /** - * Content definition method and prevent code duplicity in Reconcil - * @return ForwardingRulesCommiter<Flow> + * Content definition method and prevent code duplicity in Reconcil. + * + * @return ForwardingRulesCommiter<Flow>. */ - public ForwardingRulesCommiter getFlowCommiter(); + ForwardingRulesCommiter getFlowCommiter(); /** - * Content definition method and prevent code duplicity in Reconcil + * Content definition method and prevent code duplicity in Reconcil. + * * @return ForwardingRulesCommiter<Group> */ - public ForwardingRulesCommiter getGroupCommiter(); + ForwardingRulesCommiter getGroupCommiter(); /** - * Content definition method and prevent code duplicity + * Content definition method and prevent code duplicity. + * * @return ForwardingRulesCommiter<Meter> */ - public ForwardingRulesCommiter getMeterCommiter(); + ForwardingRulesCommiter getMeterCommiter(); /** - * Content definition method and prevent code duplicity + * Content definition method and prevent code duplicity. + * * @return ForwardingRulesCommiter<Table> */ - public ForwardingRulesCommiter getTableFeaturesCommiter(); + ForwardingRulesCommiter getTableFeaturesCommiter(); + + /** + * Return BundleFlowListener instance. + * + * @return BundleFlowListener + */ + BundleMessagesCommiter getBundleFlowListener(); /** - * Content definition method - * @return FlowNodeReconciliation + * Return BundleGroupListener instance. + * + * @return BundleGroupListener + */ + BundleMessagesCommiter getBundleGroupListener(); + + /** + * Check if reconciliation is disabled by user. + * + * @return true if reconciliation is disabled, else false */ - public FlowNodeReconciliation getFlowNodeReconciliation(); + boolean isReconciliationDisabled(); /** - * Returns the config-subsystem/fallback configuration of FRM - * @return ForwardingRulesManagerConfig + * Check if stale marking is enabled for switch reconciliation. + * + * @return true if stale marking is enabled, else false */ - public ForwardingRulesManagerConfig getConfiguration(); + boolean isStaleMarkingEnabled(); /** - * Method checks if *this* instance of openflowplugin is owner of - * the given openflow node. + * Return number of reconciliation retry are allowed. + * + * @return number of retries. + */ + int getReconciliationRetryCount(); + + /** + * Method checks if *this* instance of openflowplugin is owner of the given + * openflow node. + * * @return True if owner, else false */ - public boolean isNodeOwner(InstanceIdentifier ident); + boolean isNodeOwner(InstanceIdentifier ident); -} + /** + * Content definition method and prevent code duplicity. + * + * @return FlowNodeConnectorInventoryTranslatorImpl + */ + FlowNodeConnectorInventoryTranslatorImpl getFlowNodeConnectorInventoryTranslatorImpl(); + + /** + * holds the value read from the configuration file openflowplugin.cfg file. + * + * @return True if user enables bundle-based-reconciliation-enabled field in + * config file or False + */ + boolean isBundleBasedReconciliationEnabled(); + + /** + * Return the NodeConfigurator which could be used to serialize jobs. + * + * @return modeConfigurator. + */ + NodeConfigurator getNodeConfigurator(); + + /** + * Method for register RecoverableListener. + * + */ + void addRecoverableListener(RecoverableListener recoverableListener); + /** + * Method exposes the ArbitratorReconciliationManager service used for performing Arbitrator Based Reconciliation. + * @return ArbitratorReconciliationManager + */ + ArbitratorReconcileService getArbitratorReconciliationManager(); +}