Class PathIdUtil


  • public final class PathIdUtil
    extends Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static PathId buildPathId​(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode routesCont, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier pathIdNii)
      Build Path Id.
      static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates createNidKey​(org.opendaylight.yangtools.yang.common.QName routeQName, org.opendaylight.yangtools.util.ImmutableOffsetMapTemplate<org.opendaylight.yangtools.yang.common.QName> routeKeyTemplate, Object routeKeyValue, Optional<org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild> maybePathIdLeaf)
      Build Route Key for supporting mp.
      static org.opendaylight.yangtools.yang.common.Uint32 extractPathId​(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode data, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier pathNii)
      Extract PathId from route change received.
      static PathId readPathId​(io.netty.buffer.ByteBuf buffer)
      Reads Path Identifier (4 bytes) from buffer.
      static void writePathId​(PathId pathId, io.netty.buffer.ByteBuf buffer)
      Writes path-id value into the buffer when the path-id is not null or does not equal to zero.
    • Field Detail

      • NON_PATH_ID_VALUE

        public static final org.opendaylight.yangtools.yang.common.Uint32 NON_PATH_ID_VALUE
      • NON_PATH_ID

        public static final PathId NON_PATH_ID
    • Method Detail

      • writePathId

        public static void writePathId​(PathId pathId,
                                       io.netty.buffer.ByteBuf buffer)
        Writes path-id value into the buffer when the path-id is not null or does not equal to zero.
        Parameters:
        pathId - The NLRI Path Identifier.
        buffer - The ByteBuf where path-id value can be written.
      • readPathId

        public static PathId readPathId​(io.netty.buffer.ByteBuf buffer)
        Reads Path Identifier (4 bytes) from buffer.
        Parameters:
        buffer - Input buffer.
        Returns:
        Decoded PathId.
      • extractPathId

        public static org.opendaylight.yangtools.yang.common.Uint32 extractPathId​(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode data,
                                                                                  org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier pathNii)
        Extract PathId from route change received.
        Parameters:
        data - Data containing the path Id
        pathNii - Path Id NodeIdentifier specific per each Rib support
        Returns:
        The path identifier from data change
      • buildPathId

        public static PathId buildPathId​(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode routesCont,
                                         org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier pathIdNii)
        Build Path Id.
        Parameters:
        routesCont - route container
        pathIdNii - path Id node Identifier
        Returns:
        PathId or null in case is not the container
      • createNidKey

        public static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates createNidKey​(org.opendaylight.yangtools.yang.common.QName routeQName,
                                                                                                                                org.opendaylight.yangtools.util.ImmutableOffsetMapTemplate<org.opendaylight.yangtools.yang.common.QName> routeKeyTemplate,
                                                                                                                                Object routeKeyValue,
                                                                                                                                Optional<org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild> maybePathIdLeaf)
        Build Route Key for supporting mp. Key is composed by 2 elements (route-key + path Id).
        Parameters:
        routeQName - route QName
        routeKeyTemplate - route key template
        routeKeyValue - route key value
        maybePathIdLeaf - path id container, it might me supported or not, in that case default 0 value will be assigned
        Returns:
        Route Key Nid