Refine the RPC implementation registration
[transportpce.git] / olm / src / main / java / org / opendaylight / transportpce / olm / OlmPowerServiceRpcImpl.java
index e3c07e20169a8e6048dd0647a4a0bef9dc22970f..5fd005995ee26de1cfff0360faa6945496f683c2 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.transportpce.olm;
 
-import com.google.common.collect.ImmutableClassToInstanceMap;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.transportpce.olm.rpc.impl.CalculateSpanlossBaseImpl;
 import org.opendaylight.transportpce.olm.rpc.impl.CalculateSpanlossCurrentImpl;
@@ -17,14 +16,7 @@ import org.opendaylight.transportpce.olm.rpc.impl.ServicePowerResetImpl;
 import org.opendaylight.transportpce.olm.rpc.impl.ServicePowerSetupImpl;
 import org.opendaylight.transportpce.olm.rpc.impl.ServicePowerTurndownImpl;
 import org.opendaylight.transportpce.olm.service.OlmPowerService;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.CalculateSpanlossBase;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.CalculateSpanlossCurrent;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.GetPm;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerReset;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerSetup;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerTurndown;
 import org.opendaylight.yangtools.concepts.Registration;
-import org.opendaylight.yangtools.yang.binding.Rpc;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Deactivate;
@@ -44,14 +36,12 @@ public class OlmPowerServiceRpcImpl {
     public OlmPowerServiceRpcImpl(@Reference OlmPowerService olmPowerService,
             @Reference RpcProviderService rpcProviderService) {
         this.rpcRegistration = rpcProviderService.registerRpcImplementations(
-                ImmutableClassToInstanceMap.<Rpc<?, ?>>builder()
-            .put(GetPm.class, new GetPmImpl(olmPowerService))
-            .put(ServicePowerSetup.class, new ServicePowerSetupImpl(olmPowerService))
-            .put(ServicePowerTurndown.class, new ServicePowerTurndownImpl(olmPowerService))
-            .put(CalculateSpanlossBase.class, new CalculateSpanlossBaseImpl(olmPowerService))
-            .put(CalculateSpanlossCurrent.class, new CalculateSpanlossCurrentImpl(olmPowerService))
-            .put(ServicePowerReset.class, new ServicePowerResetImpl(olmPowerService))
-            .build());
+            new GetPmImpl(olmPowerService),
+            new ServicePowerSetupImpl(olmPowerService),
+            new ServicePowerTurndownImpl(olmPowerService),
+            new CalculateSpanlossBaseImpl(olmPowerService),
+            new CalculateSpanlossCurrentImpl(olmPowerService),
+            new ServicePowerResetImpl(olmPowerService));
         LOG.info("OlmPowerServiceRpcImpl instantiated");
     }