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 d261f376e672d43e976c36913e2a83ddd464156f..6c29b330b6a15a4f498e21c6b8542bac7c991ec0 100644 (file)
@@ -26,15 +26,15 @@ 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.ClusterSingletonServiceProvider;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
-import org.opendaylight.mdsal.singleton.common.api.CommonClusterSingletonServiceProvider;
 import org.opendaylight.yangtools.concepts.Path;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * Abstract class {@link AbstractClusterSingletonServiceProviderImpl} represents implementations of
- * {@link CommonClusterSingletonServiceProvider} and it implements {@link GenericEntityOwnershipListener}
+ * {@link ClusterSingletonServiceProvider} and it implements {@link GenericEntityOwnershipListener}
  * for providing OwnershipChange for all registered {@link ClusterSingletonServiceGroup} entity
  * candidate.
  *
@@ -46,11 +46,11 @@ 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>>
-        implements CommonClusterSingletonServiceProvider, GenericEntityOwnershipListener<P, C> {
+        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
             .getLogger(AbstractClusterSingletonServiceProviderImpl.class.getName());
@@ -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();