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


Java PcepStateReport.getLspObject方法代码示例

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


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

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

示例2: handleMessage

import org.onosproject.pcepio.protocol.PcepStateReport; //导入方法依赖的package包/类
@Override
public void handleMessage(PccId pccId, PcepMessage msg) {
    try {
        log.debug("tunnel provider handle message {}", msg.getType().toString());
        switch (msg.getType()) {
        case REPORT:
            int srpId = 0;
            LinkedList<PcepStateReport> llStateReportList = null;
            llStateReportList = ((PcepReportMsg) msg).getStateReportList();
            ListIterator<PcepStateReport> listIterator = llStateReportList.listIterator();
            PcepSrpObject srpObj = null;
            PcepLspObject lspObj = null;
            while (listIterator.hasNext()) {
                PcepStateReport stateRpt = listIterator.next();
                srpObj = stateRpt.getSrpObject();
                lspObj = stateRpt.getLspObject();

                if (srpObj instanceof PcepSrpObject) {
                    srpId = srpObj.getSrpID();
                }

                log.debug("Plsp ID in handle message " + lspObj.getPlspId());
                log.debug("SRP ID in handle message " + srpId);

                if (!(pcepTunnelApiMapper.checkFromTunnelRequestQueue(srpId))) {
                    // For PCRpt without matching SRP id.
                    handleRptWithoutSrpId(stateRpt, pccId);
                    continue;
                }

                handleReportMessage(srpId, lspObj, stateRpt);
            }
            break;

        default:
            log.debug("Received unsupported message type {}", msg.getType().toString());
        }
    } catch (Exception e) {
        log.error("Exception occured while processing report message {}", e.getMessage());
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:42,代码来源:PcepTunnelProvider.java

示例3: handleMessage

import org.onosproject.pcepio.protocol.PcepStateReport; //导入方法依赖的package包/类
@Override
public void handleMessage(PccId pccId, PcepMessage msg) {
    try {
        log.debug("tunnel provider handle message {}", msg.getType().toString());
        switch (msg.getType()) {
        case REPORT:
            int srpId = 0;
            LinkedList<PcepStateReport> llStateReportList = null;
            llStateReportList = ((PcepReportMsg) msg).getStateReportList();
            ListIterator<PcepStateReport> listIterator = llStateReportList.listIterator();
            PcepSrpObject srpObj = null;
            PcepLspObject lspObj = null;
            while (listIterator.hasNext()) {
                PcepStateReport stateRpt = listIterator.next();
                srpObj = stateRpt.getSrpObject();
                lspObj = stateRpt.getLspObject();

                if (srpObj != null) {
                    srpId = srpObj.getSrpID();
                }

                log.debug("Plsp ID in handle message " + lspObj.getPlspId());
                log.debug("SRP ID in handle message " + srpId);

                if (!(pcepTunnelApiMapper.checkFromTunnelRequestQueue(srpId))) {
                    // For PCRpt without matching SRP id.
                    handleRptWithoutSrpId(stateRpt, pccId);
                    continue;
                }

                handleReportMessage(srpId, lspObj, stateRpt);
            }
            break;

        default:
            log.debug("Received unsupported message type {}", msg.getType().toString());
        }
    } catch (Exception e) {
        log.error("Exception occurred while processing report message {}", e.getMessage());
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:42,代码来源:PcepTunnelProvider.java


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