当前位置: 首页>>代码示例>>Java>>正文


Java PcepStateReport.setMsgPath方法代码示例

本文整理汇总了Java中org.onosproject.pcepio.protocol.PcepStateReport.setMsgPath方法的典型用法代码示例。如果您正苦于以下问题:Java PcepStateReport.setMsgPath方法的具体用法?Java PcepStateReport.setMsgPath怎么用?Java PcepStateReport.setMsgPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.onosproject.pcepio.protocol.PcepStateReport的用法示例。


在下文中一共展示了PcepStateReport.setMsgPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseStateReportList

import org.onosproject.pcepio.protocol.PcepStateReport; //导入方法依赖的package包/类
public void parseStateReportList(ChannelBuffer cb) throws PcepParseException {

            /*
                                <state-report-list>
            Where:
                    <state-report-list>     ::= <state-report>[<state-report-list>]
                    <state-report>          ::=  [<SRP>]
                                                  <LSP>
                                                  <path>
            Where:
                    <path>                  ::= <ERO><attribute-list>[<RRO>]
            Where:
                    <attribute-list> is defined in [RFC5440] and extended by PCEP extensions.

             */

            while (0 < cb.readableBytes()) {

                PcepStateReport pcestateReq = new PcepStateReportVer1();

                /*
                 * SRP is optional
                 * Check whether SRP Object is available, if yes store it.
                 * First read common object header and check the Object Class whether it is SRP or LSP
                 * If it is LSP then store only LSP. So, SRP is optional. then read path and store.
                 * If it is SRP then store SRP and then read LSP, path and store them.
                 */

                //mark the reader index to reset
                cb.markReaderIndex();
                PcepObjectHeader tempObjHeader = PcepObjectHeader.read(cb);

                byte yObjectClass = tempObjHeader.getObjClass();
                byte yObjectType = tempObjHeader.getObjType();

                //reset reader index
                cb.resetReaderIndex();
                //If SRP present then store it.
                if ((PcepSrpObjectVer1.SRP_OBJ_CLASS == yObjectClass)
                        && (PcepSrpObjectVer1.SRP_OBJ_TYPE == yObjectType)) {
                    PcepSrpObject srpObj;
                    srpObj = PcepSrpObjectVer1.read(cb);
                    pcestateReq.setSrpObject(srpObj);
                }

                //store LSP object
                PcepLspObject lspObj;
                lspObj = PcepLspObjectVer1.read(cb);
                pcestateReq.setLspObject(lspObj);

                //store path
                PcepStateReport.PcepMsgPath msgPath = new PcepStateReportVer1().new PcepMsgPath().read(cb);
                pcestateReq.setMsgPath(msgPath);

                llStateReportList.add(pcestateReq);
            }
        }
 
开发者ID:shlee89,项目名称:athena,代码行数:58,代码来源:PcepReportMsgVer1.java

示例2: parseStateReportList

import org.onosproject.pcepio.protocol.PcepStateReport; //导入方法依赖的package包/类
public void parseStateReportList(ChannelBuffer cb) throws PcepParseException {

            /*
                                <state-report-list>
            Where:
                    <state-report-list>     ::= <state-report>[<state-report-list>]
                    <state-report>          ::=  [<SRP>]
                                                  <LSP>
                                                  <path>
            Where:
                    <path>                  ::= <ERO><attribute-list>[<RRO>]
            Where:
                    <attribute-list> is defined in [RFC5440] and extended by PCEP extensions.

             */

            while (0 < cb.readableBytes()) {

                PcepStateReport pcestateReq = new PcepStateReportVer1();

                /*
                 * SRP is optional
                 * Check whether SRP Object is available, if yes store it.
                 * First read common object header and check the Object Class whether it is SRP or LSP
                 * If it is LSP then store only LSP. So, SRP is optional. then read path and store.
                 * If it is SRP then store SRP and then read LSP, path and store them.
                 */

                //mark the reader index to reset
                cb.markReaderIndex();
                PcepObjectHeader tempObjHeader = PcepObjectHeader.read(cb);

                byte yObjectClass = tempObjHeader.getObjClass();
                byte yObjectType = tempObjHeader.getObjType();

                //reset reader index
                cb.resetReaderIndex();
                //If SRP present then store it.
                if ((PcepSrpObjectVer1.SRP_OBJ_CLASS == yObjectClass)
                        && (PcepSrpObjectVer1.SRP_OBJ_TYPE == yObjectType)) {
                    PcepSrpObject srpObj;
                    srpObj = PcepSrpObjectVer1.read(cb);
                    pcestateReq.setSrpObject(srpObj);
                }

                //store LSP object
                PcepLspObject lspObj;
                lspObj = PcepLspObjectVer1.read(cb);
                pcestateReq.setLspObject(lspObj);

                if (cb.readableBytes() > 0) {

                    //mark the reader index to reset
                    cb.markReaderIndex();
                    tempObjHeader = PcepObjectHeader.read(cb);

                    yObjectClass = tempObjHeader.getObjClass();
                    yObjectType = tempObjHeader.getObjType();

                    //reset reader index
                    cb.resetReaderIndex();

                    if ((PcepEroObjectVer1.ERO_OBJ_CLASS == yObjectClass)
                            && (PcepEroObjectVer1.ERO_OBJ_TYPE == yObjectType)) {
                        // store path
                        PcepStateReport.PcepMsgPath msgPath = new PcepStateReportVer1().new PcepMsgPath().read(cb);
                        pcestateReq.setMsgPath(msgPath);
                    }
                }

                llStateReportList.add(pcestateReq);
            }
        }
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:74,代码来源:PcepReportMsgVer1.java


注:本文中的org.onosproject.pcepio.protocol.PcepStateReport.setMsgPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。