Merge "included the nodetype in the congruence check. also handled the condition...
[controller.git] / opendaylight / config / config-api / src / main / java / org / opendaylight / controller / config / api / DependencyResolver.java
index a2b171aec0e12f40e82cca30cf9877e5b661ae05..b020000d3d742b93ec71ea602c30e902e759fb27 100644 (file)
@@ -7,9 +7,11 @@
  */
 package org.opendaylight.controller.config.api;
 
-import javax.management.ObjectName;
-
 import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface;
+import org.opendaylight.yangtools.concepts.Identifiable;
+import org.opendaylight.yangtools.yang.binding.BaseIdentity;
+
+import javax.management.ObjectName;
 
 /**
  * Each new {@link org.opendaylight.controller.config.spi.Module} can receive
@@ -18,7 +20,7 @@ import org.opendaylight.controller.config.api.annotations.AbstractServiceInterfa
  *
  * @see org.opendaylight.controller.config.spi.Module
  */
-public interface DependencyResolver {
+public interface DependencyResolver extends Identifiable<ModuleIdentifier> {
 
     /**
      * To be used during validation phase to validate serice interface of
@@ -38,12 +40,6 @@ public interface DependencyResolver {
             Class<? extends AbstractServiceInterface> expectedServiceInterface,
             ObjectName objectName, JmxAttribute jmxAttribute);
 
-    @Deprecated
-    // TODO remove once all config code is generated
-    void validateDependency(
-            Class<? extends AbstractServiceInterface> expectedServiceInterface,
-            ObjectName objectName, String attributeNameForErrorReporting);
-
     /**
      * To be used during commit phase to wire actual dependencies.
      *
@@ -54,7 +50,15 @@ public interface DependencyResolver {
     <T> T resolveInstance(Class<T> expectedType, ObjectName objectName,
             JmxAttribute jmxAttribute);
 
-    @Deprecated
-    <T> T resolveInstance(Class<T> expectedType, ObjectName objectName);
+    // TODO finish javadoc
+
+    /**
+     * To be used during commit phase to resolve identity-ref config attributes.
+     *
+     * @return actual class object generated from identity
+     */
+    <T extends BaseIdentity> Class<? extends T> resolveIdentity(IdentityAttributeRef identityRef, Class<T> expectedBaseClass);
+
+    <T extends BaseIdentity> void validateIdentity(IdentityAttributeRef identityRef, Class<T> expectedBaseClass, JmxAttribute jmxAttribute);
 
 }