2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.sal.binding.impl.forward;
10 import com.google.common.base.Preconditions;
12 public class DomForwardingUtils {
14 public static boolean isDomForwardedBroker(Object obj) {
15 return obj instanceof DomForwardedBroker;
18 public static void reuseForwardingFrom(Object target,Object source) {
19 Preconditions.checkArgument(isDomForwardedBroker(source));
20 Preconditions.checkArgument(isDomForwardedBroker(target));
21 DomForwardedBroker forwardedSource = (DomForwardedBroker) source;
22 DomForwardedBroker forwardedTarget = (DomForwardedBroker) target;
23 reuseForwardingFrom(forwardedTarget, forwardedSource);
27 private static void reuseForwardingFrom(DomForwardedBroker target, DomForwardedBroker source) {
28 target.setConnector(source.getConnector());
29 target.setDomProviderContext(source.getDomProviderContext());