*/
package org.opendaylight.openflowplugin.test;
-import com.google.common.collect.ImmutableClassToInstanceMap;
+import java.util.List;
import java.util.Set;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-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;
@Inject
@Activate
public OpenflowpluginTestRpcProvider(@Reference final RpcProviderService rpcRegistry) {
- flowRegistration = rpcRegistry.registerRpcImplementations(ImmutableClassToInstanceMap.<Rpc<?, ?>>builder()
- .put(AddFlow.class, input -> {
+ flowRegistration = rpcRegistry.registerRpcImplementations(List.of(
+ (AddFlow) input -> {
LOG.info("addFlow - {}", input);
return null;
- })
- .put(RemoveFlow.class, input -> {
+ },
+ (RemoveFlow) input -> {
LOG.info("removeFlow - {}", input);
return null;
- })
- .put(UpdateFlow.class, input -> {
+ },
+ (UpdateFlow) input -> {
LOG.info("updateFlow - {}", input);
return null;
- })
- .build(),
- Set.of(InstanceIdentifier.create(Nodes.class)
+ }), Set.of(InstanceIdentifier.create(Nodes.class)
.child(Node.class, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID)))));
}