X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fapi%2Fopenflow%2Fdevice%2FDeviceManager.java;h=8463b1f3cc90bb4630b20982b3cfc21ae3829653;hb=d19bc648ae039b47fab3bebe1d501aa9a0522258;hp=30babc3f7d5a3bc85250b2ae83d85896f2b7d181;hpb=efafaff93f41e9e223c1bb937ffeb8df000060f3;p=openflowplugin.git diff --git a/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/device/DeviceManager.java b/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/device/DeviceManager.java index 30babc3f7d..8463b1f3cc 100644 --- a/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/device/DeviceManager.java +++ b/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/device/DeviceManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2015, 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, @@ -8,71 +8,41 @@ package org.opendaylight.openflowplugin.api.openflow.device; +import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.ListenableFuture; +import javax.annotation.Nonnull; +import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.openflowplugin.api.openflow.OFPManager; -import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler; -import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler; -import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceInitializationPhaseHandler; -import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceLifecycleSupervisor; -import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceTerminationPhaseHandler; +import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext; import org.opendaylight.openflowplugin.api.openflow.translator.TranslatorLibrarian; -import org.opendaylight.yang.gen.v1.urn.opendaylight.role.service.rev150727.OfpRole; - -import javax.annotation.CheckForNull; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey; +import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier; /** * This interface is responsible for instantiating DeviceContext and * registering transaction chain for each DeviceContext. Each device * has its own device context managed by this manager. */ -public interface DeviceManager extends DeviceConnectedHandler, DeviceDisconnectedHandler, DeviceLifecycleSupervisor, - DeviceInitializationPhaseHandler, DeviceTerminationPhaseHandler, TranslatorLibrarian, AutoCloseable, OFPManager { - +public interface DeviceManager extends + OFPManager, + TranslatorLibrarian { /** - * invoked after all services injected + * invoked after all services injected. */ void initialize(); - /** - * Method has to activate (MASTER) or deactivate (SLAVE) TransactionChainManager. - * TransactionChainManager represents possibility to write or delete Node subtree data - * for actual Controller Cluster Node. We are able to have an active TxManager only if - * newRole is {@link OfpRole#BECOMESLAVE}. - * Parameters are used as marker to be sure it is change to SLAVE from MASTER or from - * MASTER to SLAVE and the last parameter "cleanDataStore" is used for validation only. - * - * @param deviceInfo which device - * @param role - NewRole expect to be {@link OfpRole#BECOMESLAVE} or {@link OfpRole#BECOMEMASTER} - * @return RoleChangeTxChainManager future for activation/deactivation - */ - ListenableFuture onClusterRoleChange(final DeviceInfo deviceInfo, final OfpRole role); + ListenableFuture removeDeviceFromOperationalDS( + @Nonnull KeyedInstanceIdentifier ii); - /** - * Register device synchronize listeners - * @param deviceSynchronizeListener are notified if device is synchronized or not - */ - void registerDeviceSynchronizeListeners(final DeviceSynchronizeListener deviceSynchronizeListener); + DeviceContext createContext(@Nonnull ConnectionContext connectionContext); - /** - * Notify all registered listeners about synchronized status - * @param deviceInfo which device - * @param deviceSynchronized true if device is synchronized - */ - void notifyDeviceSynchronizeListeners(final DeviceInfo deviceInfo, final boolean deviceSynchronized); - - /** - * Register device valid listeners - * @param deviceValidListener are notified if device is valid or not - */ - void registerDeviceValidListeners(final DeviceValidListener deviceValidListener); - /** - * Notify all registered listeners about valid status - * @param deviceInfo which device - * @param deviceValid true if device is valid - */ - void notifyDeviceValidListeners(final DeviceInfo deviceInfo, final boolean deviceValid); + void sendNodeAddedNotification( + @Nonnull KeyedInstanceIdentifier instanceIdentifier); + void sendNodeRemovedNotification( + @Nonnull KeyedInstanceIdentifier instanceIdentifier); }