2 * Copyright (c) 2013 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.protocol.bgp.parser.spi;
10 import org.opendaylight.protocol.util.ReferenceCache;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.open.BgpParameters;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.AddressFamily;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.SubsequentAddressFamily;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
15 import org.opendaylight.yangtools.yang.binding.Notification;
18 * Context for registering providers of the various types of extension points BGP provides. These are then consumed by
19 * extension consumers. It also provides access to the context-wide object cache, which extension providers can use to
20 * increase the in-memory efficiency when the same objects are created over and over again.
22 public interface BGPExtensionProviderContext extends BGPExtensionConsumerContext {
23 AutoCloseable registerAddressFamily(Class<? extends AddressFamily> clazz, int number);
25 AutoCloseable registerSubsequentAddressFamily(Class<? extends SubsequentAddressFamily> clazz, int number);
27 AutoCloseable registerAttributeParser(int attributeType, AttributeParser parser);
29 AutoCloseable registerAttributeSerializer(Class<? extends DataObject> attributeClass, AttributeSerializer serializer);
31 AutoCloseable registerCapabilityParser(int capabilityType, CapabilityParser parser);
33 AutoCloseable registerCapabilitySerializer(Class<? extends DataObject> capabilityClass, CapabilitySerializer serializer);
35 AutoCloseable registerMessageParser(int messageType, MessageParser parser);
37 AutoCloseable registerMessageSerializer(Class<? extends Notification> messageClass, MessageSerializer serializer);
39 AutoCloseable registerNlriParser(Class<? extends AddressFamily> afi, Class<? extends SubsequentAddressFamily> safi, NlriParser parser);
41 AutoCloseable registerNlriSerializer(Class<? extends DataObject> nlriClass, NlriSerializer serializer);
43 AutoCloseable registerParameterParser(int parameterType, ParameterParser parser);
45 AutoCloseable registerParameterSerializer(Class<? extends BgpParameters> paramClass, ParameterSerializer serializer);
48 * Get the context-wide cache for a particular object type.
50 * @return An object cache instance.
52 ReferenceCache getReferenceCache();