Merge "BUG-692 Replace strings with ModifyAction enum"
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / sal / dom / broker / impl / RoutedRpcRegImpl.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.sal.dom.broker.impl;
9
10 import org.opendaylight.controller.sal.core.api.Broker.RoutedRpcRegistration;
11 import org.opendaylight.controller.sal.core.api.RpcImplementation;
12 import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
15
16 class RoutedRpcRegImpl extends AbstractObjectRegistration<RpcImplementation> implements
17         RoutedRpcRegistration {
18
19     private final QName type;
20     private final RoutedRpcSelector router;
21
22     public RoutedRpcRegImpl(final QName rpcType, final RpcImplementation implementation, final RoutedRpcSelector routedRpcSelector) {
23         super(implementation);
24         this.type = rpcType;
25         router = routedRpcSelector;
26     }
27
28     @Override
29     public void registerPath(final QName context, final InstanceIdentifier path) {
30         router.addPath(context, path, this);
31     }
32
33     @Override
34     public void unregisterPath(final QName context, final InstanceIdentifier path) {
35         router.removePath(context, path, this);
36     }
37
38     @Override
39     protected void removeRegistration() {
40
41     }
42
43     @Override
44     public QName getType() {
45         return type;
46     }
47
48 }