Uploaded image for project: 'ONOS'
  1. ONOS
  2. ONOS-5004

[YANG UTILS] No APIs offered to add/get AugmentedInfo()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: None
    • Labels:
      None
    • Story Points:
      1

      Description

      From: Yixiao Chen
      Sent: Friday, July 22, 2016 7:54 PM
      To: Gaurav agrawal; Vidyashree Rama; Bharat Saraswal; VinodS Kumar; Janani B; Suchitra h n
      Cc: Henry Yu; Aihuaguo (Aihua Guo, CRC); Hesam Rahimi; Patrick Liu
      Subject: RE: YangUtils function

      HI team,

      One more observations today:

      Both outer interface and inner interface don't have APIs for add/get AugmentedInfo, the inner Builder class doesn't have APIs either. Only the outer class has. This introduces some unnecessary/weird steps to add AugmentedInfo to a YO or get AugmentedInfo from a YO. Not sure if this is design intention, can it be fixed?

      When a YO is built to include AugmentedInfo, the YO has to be built/cast first to add AugmentedInfo:
      TerminationPoint.TerminationPointBuilder builder =
      new DefaultTerminationPoint.TerminationPointBuilder().tpId(tpId);
      DefaultTerminationPoint defaultTp = (DefaultTerminationPoint) builder.build();
      if (teSubsystem.te() != null)

      { AugmentedNtTerminationPoint.AugmentedNtTerminationPointBuilder tpAugment = new DefaultAugmentedNtTerminationPoint.AugmentedNtTerminationPointBuilder(); // Set more Attributes here defaultTp.addAugmentedInfo(tpAugment.build(), AugmentedNtTerminationPoint.class); }

      To get AugmentedInfo from a YO, the outer object has to be casted first:
      DefaultTerminationPoint defaultTp = (DefaultTerminationPoint)yangTp;
      if (defaultTp.getAugmentedInfo(AugmentedNtTerminationPoint.class) != null)

      { AugmentedNtTerminationPoint tpAugment = (AugmentedNtTerminationPoint)defaultTp.getAugmentedInfo(AugmentedNtTerminationPoint.class); }

      Yixiao

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            bsaraswal bharat saraswal
            Reporter:
            hyu2010 Henry Yu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: