Fix Checkstyle problems (red in Eclipse, missed in build)
[mdsal.git] / singleton-service / mdsal-singleton-dom-impl / src / main / java / org / opendaylight / mdsal / singleton / dom / impl / AbstractClusterSingletonServiceProviderImpl.java
index a1a56d8a2f4404002e4b6ea681dfe6202f2b4aca..6c29b330b6a15a4f498e21c6b8542bac7c991ec0 100644 (file)
@@ -26,8 +26,8 @@ import org.opendaylight.mdsal.eos.common.api.GenericEntityOwnershipListener;
 import org.opendaylight.mdsal.eos.common.api.GenericEntityOwnershipListenerRegistration;
 import org.opendaylight.mdsal.eos.common.api.GenericEntityOwnershipService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
-import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
+import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
 import org.opendaylight.yangtools.concepts.Path;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -46,10 +46,10 @@ import org.slf4j.LoggerFactory;
  * @param <R> the GenericEntityOwnershipListenerRegistration type
  */
 public abstract class AbstractClusterSingletonServiceProviderImpl<P extends Path<P>, E extends GenericEntity<P>,
-                                                                  C extends GenericEntityOwnershipChange<P, E>,
-                                                                  G extends GenericEntityOwnershipListener<P, C>,
-                                                                  S extends GenericEntityOwnershipService<P, E, G>,
-                                                                  R extends GenericEntityOwnershipListenerRegistration<P, G>>
+        C extends GenericEntityOwnershipChange<P, E>,
+        G extends GenericEntityOwnershipListener<P, C>,
+        S extends GenericEntityOwnershipService<P, E, G>,
+        R extends GenericEntityOwnershipListenerRegistration<P, G>>
         implements ClusterSingletonServiceProvider, GenericEntityOwnershipListener<P, C> {
 
     private static final Logger LOG = LoggerFactory
@@ -59,14 +59,15 @@ public abstract class AbstractClusterSingletonServiceProviderImpl<P extends Path
     private static final String CLOSE_SERVICE_ENTITY_TYPE = "org.opendaylight.mdsal.AsyncServiceCloseEntityType";
 
     private final S entityOwnershipService;
-    private final ConcurrentMap<String, ClusterSingletonServiceGroup<P, E, C>> serviceGroupMap = new ConcurrentHashMap<>();
+    private final ConcurrentMap<String, ClusterSingletonServiceGroup<P, E, C>> serviceGroupMap =
+            new ConcurrentHashMap<>();
 
     /* EOS Entity Listeners Registration */
     private R serviceEntityListenerReg;
     private R asyncCloseEntityListenerReg;
 
     /**
-     * Class constructor
+     * Class constructor.
      *
      * @param entityOwnershipService relevant EOS
      */
@@ -130,8 +131,8 @@ public abstract class AbstractClusterSingletonServiceProviderImpl<P extends Path
             }
 
             @Override
-            public void onFailure(final Throwable t) {
-                cleaningProvider(t);
+            public void onFailure(final Throwable throwable) {
+                cleaningProvider(throwable);
             }
         });
     }
@@ -156,7 +157,7 @@ public abstract class AbstractClusterSingletonServiceProviderImpl<P extends Path
      * @param entityOwnershipServiceInst - EOS type
      * @return instance of EntityOwnershipListenerRegistration
      */
-    protected abstract R registerListener(final String entityType, final S entityOwnershipServiceInst);
+    protected abstract R registerListener(String entityType, S entityOwnershipServiceInst);
 
     /**
      * Creates an extended {@link GenericEntity} instance.
@@ -165,25 +166,26 @@ public abstract class AbstractClusterSingletonServiceProviderImpl<P extends Path
      * @param entityIdentifier the identifier of the entity
      * @return instance of Entity extended GenericEntity type
      */
-    protected abstract E createEntity(final String entityType, final String entityIdentifier);
+    protected abstract E createEntity(String entityType, String entityIdentifier);
 
     /**
      * Method is responsible for parsing ServiceGroupIdentifier from E entity.
      *
-     * @param entity
+     * @param entity instance of GenericEntity type
      * @return ServiceGroupIdentifier parsed from entity key value.
      */
-    protected abstract String getServiceIdentifierFromEntity(final E entity);
+    protected abstract String getServiceIdentifierFromEntity(E entity);
 
     /**
      * Method is called async. from close method in end of Provider lifecycle.
      *
-     * @param t Throwable (needs for log)
+     * @param throwable Throwable (needs for log)
      */
-    protected final void cleaningProvider(@Nullable final Throwable t) {
+    protected final void cleaningProvider(@Nullable final Throwable throwable) {
         LOG.debug("Final cleaning ClusterSingletonServiceProvider {}", this.getClass().getName());
-        if (t != null) {
-            LOG.warn("Unexpected problem by closing ClusterSingletonServiceProvider {}", this.getClass().getName(), t);
+        if (throwable != null) {
+            LOG.warn("Unexpected problem by closing ClusterSingletonServiceProvider {}",
+                    this.getClass().getName(), throwable);
         }
         if (asyncCloseEntityListenerReg != null) {
             asyncCloseEntityListenerReg.close();