X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnector%2Fremoterpc%2FRemoteRpcProvider.java;h=76df25682e1b79df3f7762ac1fb8094dac5eda18;hp=edcef83574983718711d644f7c5a89c91d9d5035;hb=b80124e3f7b11cf2f5e5bd4a6b033d855ff4d0d4;hpb=7f0272398ce3dab7ceddd998c7bb510df3b28838 diff --git a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java index edcef83574..76df25682e 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java @@ -8,7 +8,7 @@ package org.opendaylight.controller.sal.connector.remoterpc; -import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; import java.util.Collection; import java.util.Collections; @@ -58,7 +58,7 @@ public class RemoteRpcProvider implements private ProviderSession brokerSession; private RpcProvisionRegistry rpcProvisionRegistry; private BundleContext context; - private ServiceTracker clusterTracker; + private ServiceTracker clusterTracker; public RemoteRpcProvider(ServerImpl server, ClientImpl client) { this.server = server; @@ -170,11 +170,11 @@ public class RemoteRpcProvider implements } - private RoutingTable getRoutingTable(){ - Optional> routingTable = + private RoutingTable, String> getRoutingTable(){ + Optional, String>> routingTable = routingTableProvider.getRoutingTable(); - checkNotNull(routingTable.isPresent(), "Routing table is null"); + checkState(routingTable.isPresent(), "Routing table is null"); return routingTable.get(); } @@ -191,7 +191,7 @@ public class RemoteRpcProvider implements RouteIdentifierImpl routeId = new RouteIdentifierImpl(); routeId.setType(rpc); - RoutingTable routingTable = getRoutingTable(); + RoutingTable, String> routingTable = getRoutingTable(); try { routingTable.addGlobalRoute(routeId, server.getServerAddress()); @@ -212,7 +212,7 @@ public class RemoteRpcProvider implements RouteIdentifierImpl routeId = new RouteIdentifierImpl(); routeId.setType(rpc); - RoutingTable routingTable = getRoutingTable(); + RoutingTable, String> routingTable = getRoutingTable(); try { routingTable.removeGlobalRoute(routeId); @@ -245,9 +245,9 @@ public class RemoteRpcProvider implements * * @param announcements */ - private void announce(Set announcements) { + private void announce(Set> announcements) { _logger.debug("Announcing [{}]", announcements); - RoutingTable routingTable = getRoutingTable(); + RoutingTable, String> routingTable = getRoutingTable(); try { routingTable.addRoutes(announcements, server.getServerAddress()); } catch (RoutingTableException | SystemException e) { @@ -259,9 +259,9 @@ public class RemoteRpcProvider implements * * @param removals */ - private void remove(Set removals){ + private void remove(Set> removals){ _logger.debug("Removing [{}]", removals); - RoutingTable routingTable = getRoutingTable(); + RoutingTable, String> routingTable = getRoutingTable(); try { routingTable.removeRoutes(removals, server.getServerAddress()); } catch (RoutingTableException | SystemException e) { @@ -274,9 +274,9 @@ public class RemoteRpcProvider implements * @param changes * @return */ - private Set getRouteIdentifiers(Map> changes) { + private Set> getRouteIdentifiers(Map> changes) { RouteIdentifierImpl routeId = null; - Set routeIdSet = new HashSet(); + Set> routeIdSet = new HashSet<>(); for (RpcRoutingContext context : changes.keySet()){ routeId = new RouteIdentifierImpl();