X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fcodegen%2Fimpl%2FRpcRoutingTableImpl.java;h=ce159b8f3ed0974b9e47300e1b0aa8a935596e3a;hp=808358fb3503c1ea38bca66951137c1353c7b64d;hb=7e0482f5a2f6abed7a3af2f4313f557692a15d1d;hpb=b97e2841f2c297b5e1691cf970d26a0e8d40953d diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRoutingTableImpl.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRoutingTableImpl.java index 808358fb35..ce159b8f3e 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRoutingTableImpl.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRoutingTableImpl.java @@ -1,23 +1,27 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ package org.opendaylight.controller.sal.binding.codegen.impl; -import org.opendaylight.controller.sal.binding.spi.RpcRoutingTable; -import org.opendaylight.yangtools.yang.binding.BaseIdentity; -import org.opendaylight.yangtools.yang.binding.RpcService; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; - import java.util.Collections; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import org.opendaylight.yangtools.yang.binding.DataObject; -import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher; import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener; +import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher; import org.opendaylight.controller.md.sal.common.impl.routing.RoutingUtils; +import org.opendaylight.controller.sal.binding.api.rpc.RpcRoutingTable; import org.opendaylight.yangtools.concepts.AbstractObjectRegistration; -import org.opendaylight.yangtools.concepts.Identifiable; import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.concepts.Mutable; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.RpcService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,7 +41,7 @@ implements // private RouteChangeListener, InstanceIdentifier> listener; private S defaultRoute; - + public RpcRoutingTableImpl(String routerName,Class contextType, Class serviceType) { super(); this.routerName = routerName; @@ -60,9 +64,9 @@ implements // @Override public , InstanceIdentifier>> ListenerRegistration registerRouteChangeListener( L listener) { - return (ListenerRegistration) new SingletonListenerRegistration(listener); + return new SingletonListenerRegistration(listener); } - + @Override public Class getIdentifier() { return contextType; @@ -72,7 +76,7 @@ implements // @SuppressWarnings("unchecked") public void updateRoute(InstanceIdentifier path, S service) { S previous = this.routes.put(path, service); - + LOGGER.debug("Route {} updated to {} in routing table {}",path,service,this); @SuppressWarnings("rawtypes") RouteChangeListener listenerCapture = listener; @@ -81,7 +85,7 @@ implements // } } - + @Override @SuppressWarnings("unchecked") public void removeRoute(InstanceIdentifier path) { @@ -93,7 +97,7 @@ implements // listenerCapture.onRouteChange(RoutingUtils.removalChange(contextType, path)); } } - + public void removeRoute(InstanceIdentifier path, S service) { @SuppressWarnings("rawtypes") RouteChangeListener listenerCapture = listener; @@ -116,12 +120,12 @@ implements // public Map, S> getRoutes() { return unmodifiableRoutes; } - + protected void removeAllReferences(S service) { - + } - - + + @Override public String toString() { @@ -145,4 +149,4 @@ implements // listener = null; } } -} \ No newline at end of file +}