Rib support refactoring II
[bgpcep.git] / bgp / flowspec / src / main / java / org / opendaylight / protocol / bgp / flowspec / FlowspecIpv4RIBSupport.java
1 /*
2  * Copyright (c) 2015 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.protocol.bgp.flowspec;
9
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.bgp.rib.rib.loc.rib.tables.routes.FlowspecRoutesCase;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.routes.FlowspecRoutes;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.routes.flowspec.routes.FlowspecRoute;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.flowspec._case.DestinationFlowspec;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv4AddressFamily;
15
16 final class FlowspecIpv4RIBSupport extends AbstractFlowspecRIBSupport {
17
18     private SimpleFlowspecIpv4NlriParser FS_PARSER;
19
20     public FlowspecIpv4RIBSupport(SimpleFlowspecExtensionProviderContext context) {
21         super(FlowspecRoutesCase.class, FlowspecRoutes.class, FlowspecRoute.class, Ipv4AddressFamily.class, DestinationFlowspec.QNAME);
22         FS_PARSER = new SimpleFlowspecIpv4NlriParser(context.getFlowspecIpv4TypeRegistry());
23     }
24
25     static FlowspecIpv4RIBSupport getInstance(SimpleFlowspecExtensionProviderContext context) {
26         return new FlowspecIpv4RIBSupport(context);
27     }
28
29     @Override
30     protected AbstractFlowspecNlriParser getParser() {
31         return FS_PARSER;
32     }
33 }