Reduce ObjectRegistration use
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMActionProviderService.java
index c8ef23c1114590997a2ad48ba61f3625844c0f14..254d0a8534c137faae91508601da663492029e17 100644 (file)
@@ -7,39 +7,62 @@
  */
 package org.opendaylight.mdsal.dom.api;
 
-import com.google.common.annotations.Beta;
 import com.google.common.collect.ImmutableSet;
 import java.util.Set;
 import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 
 /**
  * A {@link DOMService} which allows registration of action implementations with a conceptual router. The client
  * counterpart of this service is {@link DOMActionService}.
  */
-@Beta
 @NonNullByDefault
 public interface DOMActionProviderService
-        extends DOMExtensibleService<DOMActionProviderService, DOMActionProviderServiceExtension> {
+        extends DOMService<DOMActionProviderService, DOMActionProviderService.Extension> {
     /**
-     * Register an {@link DOMActionImplementation} object with this service.
+     * Marker interface for extensions of {@link DOMActionProviderService}.
+     */
+    interface Extension extends DOMService.Extension<DOMActionProviderService, Extension> {
+        // Marker interface
+    }
+
+    /**
+     * Register an {@link DOMActionImplementation} object with this service, servicing specified action instances.
      *
      * @param implementation action implementation, must not be null
      * @param instances Set of supported operation identifiers. Must not be null, empty, or contain a null element.
-     * @return A {@link ObjectRegistration} object, guaranteed to be non-null.
-     * @throws NullPointerException if implementation or types is null
+     * @return A {@link Registration} object, guaranteed to be non-null.
+     * @throws NullPointerException if {@code implementation} or {@code instances} is null, or if {@code instances}
+     *                              contains a null element.
      * @throws IllegalArgumentException if {@code instances} is empty
      */
-    <T extends DOMActionImplementation> ObjectRegistration<T> registerActionImplementation(T implementation,
-            Set<DOMActionInstance> instances);
+    Registration registerActionImplementation(DOMActionImplementation implementation, Set<DOMActionInstance> instances);
 
-    default <T extends DOMActionImplementation> ObjectRegistration<T> registerActionImplementation(
-            final T implementation, final DOMActionInstance instance) {
+    /**
+     * Register an {@link DOMActionImplementation} object with this service, servicing specified action instance.
+     *
+     * @param implementation action implementation, must not be null
+     * @param instance supported operation identifier. Must not be null.
+     * @return A {@link Registration} object, guaranteed to be non-null.
+     * @throws NullPointerException if any argument is null
+     */
+    default Registration registerActionImplementation(final DOMActionImplementation implementation,
+            final DOMActionInstance instance) {
         return registerActionImplementation(implementation, ImmutableSet.of(instance));
     }
 
-    default <T extends DOMActionImplementation> ObjectRegistration<T> registerActionImplementation(
-            final T implementation, final DOMActionInstance... instances) {
+    /**
+     * Register an {@link DOMActionImplementation} object with this service, servicing specified action instances.
+     *
+     * @param implementation action implementation, must not be null
+     * @param instances Set of supported operation identifiers. Must not be null, empty, or contain a null element.
+     * @return A {@link Registration} object, guaranteed to be non-null.
+     * @throws NullPointerException if {@code implementation} or {@code instances} is null, or if {@code instances}
+     *                              contains a null element.
+     * @throws IllegalArgumentException if {@code instances} is empty
+     */
+    default Registration registerActionImplementation(final DOMActionImplementation implementation,
+            final DOMActionInstance... instances) {
         return registerActionImplementation(implementation, ImmutableSet.copyOf(instances));
     }
 }