X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=applications%2Fforwardingrules-sync%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fapplications%2Ffrsync%2Fimpl%2Fclustering%2FDeviceMastership.java;h=49c15ca0123884b6ce40aae322e12479fa5fb929;hb=777c94332871b8c34f56f7f2010de1536cb759ba;hp=2d76bf384333e8f1fd2b1356597ffb1850eb4b68;hpb=9688b3b10ee4113753705f0080b29cd30e61a85d;p=openflowplugin.git diff --git a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/clustering/DeviceMastership.java b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/clustering/DeviceMastership.java index 2d76bf3843..49c15ca012 100644 --- a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/clustering/DeviceMastership.java +++ b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/clustering/DeviceMastership.java @@ -1,11 +1,10 @@ -/** +/* * Copyright (c) 2016 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.frsync.impl.clustering; import com.google.common.util.concurrent.Futures; @@ -22,7 +21,7 @@ import org.slf4j.LoggerFactory; /** * {@link ClusterSingletonService} clusterSingletonServiceRegistration per connected device. */ -public class DeviceMastership implements ClusterSingletonService, AutoCloseable { +public final class DeviceMastership implements ClusterSingletonService, AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(DeviceMastership.class); private final NodeId nodeId; private final ServiceGroupIdentifier identifier; @@ -34,9 +33,9 @@ public class DeviceMastership implements ClusterSingletonService, AutoCloseable final ReconciliationRegistry reconciliationRegistry, final ClusterSingletonServiceProvider clusterSingletonService) { this.nodeId = nodeId; - this.identifier = ServiceGroupIdentifier.create(nodeId.getValue()); + identifier = ServiceGroupIdentifier.create(nodeId.getValue()); this.reconciliationRegistry = reconciliationRegistry; - this.deviceMastered = false; + deviceMastered = false; clusterSingletonServiceRegistration = clusterSingletonService.registerClusterSingletonService(this); } @@ -61,12 +60,13 @@ public class DeviceMastership implements ClusterSingletonService, AutoCloseable } @Override + @SuppressWarnings("checkstyle:IllegalCatch") public void close() { if (clusterSingletonServiceRegistration != null) { try { clusterSingletonServiceRegistration.close(); } catch (Exception e) { - LOG.error("FRS cluster service close fail: {} {}", nodeId.getValue(), e); + LOG.error("FRS cluster service close fail: {}", nodeId.getValue(), e); } } }