2 * Copyright (c) 2018 AT&T Intellectual Property. 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.rib.spi.entry;
10 import java.util.Optional;
11 import javax.annotation.Nonnull;
12 import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
15 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
16 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
19 * Provides support for BA/BI Route Attributes conversion.
21 public interface AttributeBindingCodecSerializer {
23 * Convert BI Attributes to BA Attributes
25 * @param ribSupport ribSupport
26 * @param routeIdentifier route key
31 Optional<Attributes> getAttributes(
32 @Nonnull RIBSupport ribSupport,
33 @Nonnull NodeIdentifierWithPredicates routeIdentifier,
34 @Nonnull NormalizedNode<?, ?> route);
37 * Convert BA Attributes to BI Attributes
39 * @param ribSupport ribSupport
40 * @param routeIdentifier route key
41 * @param attributes containing route attributes
42 * @return ContainerNode
45 Optional<ContainerNode> toNormalizedNodeAttribute(
46 @Nonnull RIBSupport ribSupport,
47 @Nonnull NodeIdentifierWithPredicates routeIdentifier,
48 @Nonnull Optional<Attributes> attributes);