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


Java PcepStateReport.PcepMsgPath方法代码示例

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


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

示例1: build

import org.onosproject.pcepio.protocol.PcepStateReport; //导入方法依赖的package包/类
@Override
public PcepStateReport build() throws PcepParseException {

    //PCEP SRP Object
    PcepSrpObject srpObject = null;
    //PCEP LSP Object
    PcepLspObject lspObject = null;
    //PCEP Attribute list
    PcepStateReport.PcepMsgPath msgPath = null;

    if (this.bIsSrpObjectSet) {
        srpObject = this.srpObject;
    }

    if (!this.bIsLspObjectSet) {
        throw new PcepParseException(" LSP Object NOT Set while building PcepStateReport.");
    } else {
        lspObject = this.lspObject;
    }
    if (!this.bIsPcepMsgPathSet) {
        throw new PcepParseException(" Message Path NOT Set while building PcepStateReport.");
    } else {
        msgPath = this.msgPath;
    }

    return new PcepStateReportVer1(srpObject, lspObject, msgPath);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:28,代码来源:PcepStateReportVer1.java

示例2: PcepStateReportVer1

import org.onosproject.pcepio.protocol.PcepStateReport; //导入方法依赖的package包/类
public PcepStateReportVer1(PcepSrpObject srpObject, PcepLspObject lspObject, PcepStateReport.PcepMsgPath msgPath) {
    this.srpObject = srpObject;
    this.lspObject = lspObject;
    this.msgPath = msgPath;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:6,代码来源:PcepStateReportVer1.java

示例3: getMsgPath

import org.onosproject.pcepio.protocol.PcepStateReport; //导入方法依赖的package包/类
@Override
public PcepStateReport.PcepMsgPath getMsgPath() {
    return msgPath;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:PcepStateReportVer1.java

示例4: setMsgPath

import org.onosproject.pcepio.protocol.PcepStateReport; //导入方法依赖的package包/类
@Override
public void setMsgPath(PcepStateReport.PcepMsgPath msgPath) {
    this.msgPath = msgPath;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:PcepStateReportVer1.java

示例5: 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

示例6: write

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

    int startIndex = cb.writerIndex();

    // first 3 bits set to version
    cb.writeByte((byte) (PACKET_VERSION << PcepMessageVer1.SHIFT_FLAG));

    // message type
    cb.writeByte(MSG_TYPE.getType());

    // length is length of variable message, will be updated at the end
    // Store the position of message
    // length in buffer
    int msgLenIndex = cb.writerIndex();

    cb.writeShort((short) 0);
    ListIterator<PcepStateReport> listIterator = message.llStateReportList.listIterator();

    while (listIterator.hasNext()) {

        PcepStateReport stateRpt = listIterator.next();
        PcepSrpObject srpObj = stateRpt.getSrpObject();

        //SRP object is optional
        if (srpObj != null) {
            srpObj.write(cb);
        }

        //LSP object is mandatory
        PcepLspObject lspObj = stateRpt.getLspObject();
        if (lspObj == null) {
            throw new PcepParseException("LSP Object is mandatory object for PcRpt message.");
        } else {
            lspObj.write(cb);
        }

        //path is mandatory
        PcepStateReport.PcepMsgPath msgPath = stateRpt.getMsgPath();
        if (msgPath == null) {
            throw new PcepParseException("Message path is mandatory object for PcRpt message.");
        } else {
            msgPath.write(cb);
        }
    }

    // update message length field
    int length = cb.writerIndex() - startIndex;
    cb.setShort(msgLenIndex, (short) length);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:51,代码来源:PcepReportMsgVer1.java

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