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


Java PcepStateReport类代码示例

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


PcepStateReport类属于org.onosproject.pcepio.protocol包,在下文中一共展示了PcepStateReport类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: initializeSyncMsgList

import org.onosproject.pcepio.protocol.PcepStateReport; //导入依赖的package包/类
@Override
public void initializeSyncMsgList(PccId pccId) {
    List<PcepStateReport> rptMsgList = new LinkedList<>();
    syncRptCache.put(pccId, rptMsgList);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:6,代码来源:PcepClientImpl.java

示例3: getSyncMsgList

import org.onosproject.pcepio.protocol.PcepStateReport; //导入依赖的package包/类
@Override
public List<PcepStateReport> getSyncMsgList(PccId pccId) {
    return syncRptCache.get(pccId);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:PcepClientImpl.java

示例4: addSyncMsgToList

import org.onosproject.pcepio.protocol.PcepStateReport; //导入依赖的package包/类
@Override
public void addSyncMsgToList(PccId pccId, PcepStateReport rptMsg) {
    List<PcepStateReport> rptMsgList = syncRptCache.get(pccId);
    rptMsgList.add(rptMsg);
    syncRptCache.put(pccId, rptMsgList);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:PcepClientImpl.java

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

示例6: getMsgPath

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

示例7: setMsgPath

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

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

示例9: getStateReportList

import org.onosproject.pcepio.protocol.PcepStateReport; //导入依赖的package包/类
@Override
public LinkedList<PcepStateReport> getStateReportList() {
    return this.llStateReportList;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:PcepReportMsgVer1.java

示例10: setStateReportList

import org.onosproject.pcepio.protocol.PcepStateReport; //导入依赖的package包/类
@Override
public Builder setStateReportList(LinkedList<PcepStateReport> ll) {
    this.llStateReportList = ll;
    return this;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:6,代码来源:PcepReportMsgVer1.java

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

示例12: buildPcepStateReport

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

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

示例14: initializeSyncMsgList

import org.onosproject.pcepio.protocol.PcepStateReport; //导入依赖的package包/类
@Override
public void initializeSyncMsgList(PccId pccId) {
    List<PcepStateReport> rptMsgList = new LinkedList<>();
    sycRptCache.put(pccId, rptMsgList);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:6,代码来源:PcepClientAdapter.java

示例15: getSyncMsgList

import org.onosproject.pcepio.protocol.PcepStateReport; //导入依赖的package包/类
@Override
public List<PcepStateReport> getSyncMsgList(PccId pccId) {
    return sycRptCache.get(pccId);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:PcepClientAdapter.java


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