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


Java ErrorObjListWithOpen类代码示例

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


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

示例1: write

import org.onosproject.pcepio.types.ErrorObjListWithOpen; //导入依赖的package包/类
@Override
public void write(ChannelBuffer cb, PcepErrorMsgVer1 message) throws PcepParseException {
    int startIndex = cb.writerIndex();
    // first 3 bits set to version
    cb.writeByte((byte) (PACKET_VERSION << PcepMessageVer1.SHIFT_FLAG));
    // message type 0xC
    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(0);
    ErrorObjListWithOpen errObjListWithOpen = message.getErrorObjListWithOpen();
    PcepErrorInfo errInfo = message.getPcepErrorInfo();

    // write ( <error-obj-list> [<Open>] ) if exists.
    // otherwise write <error> [<error-list>]

    if ((errObjListWithOpen != null)
            && (errObjListWithOpen.isErrorObjListWithOpenPresent())) {
        errObjListWithOpen.write(cb);
    } else if ((errInfo != null) && (errInfo.isErrorInfoPresent())) {
        errInfo.write(cb);
    } else {
        throw new PcepParseException("Empty PCEP-ERROR message.");
    }
    // PcepErrorMessage message length field
    int length = cb.writerIndex() - startIndex;
    cb.setShort(msgLenIndex, (short) length);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:31,代码来源:PcepErrorMsgVer1.java

示例2: parsePCErrMsg

import org.onosproject.pcepio.types.ErrorObjListWithOpen; //导入依赖的package包/类
/**
 * Parsing PCErr Message.
 *
 * @param cb channel buffer.
 * @throws PcepParseException if mandatory fields are missing
 * output: this.errObjListWithOpen, this.errInfo
 */
public void parsePCErrMsg(ChannelBuffer cb) throws PcepParseException {
    //If PCEP-ERROR list is followed by OPEN Object then store into ErrorObjListWithOpen.
    //     ( <error-obj-list> [<Open>]
    //If PCEP-ERROR list is followed by RP or LS Object then store into errInfo. <error> [<error-list>]
    //If only PCEP-ERROR list is present then store into ErrorObjListWithOpen.
    PcepObjectHeader tempObjHeader;
    List<PcepErrorObject> llErrObjList;

    if (0 >= cb.readableBytes()) {
        throw new PcepParseException("PCEP-ERROR message came with empty objects.");
    }

    //parse PCEP-ERROR list
    llErrObjList = new LinkedList<>();
    tempObjHeader = parseErrorObjectList(llErrObjList, cb);

    //check whether OPEN-OBJECT is present.
    if ((tempObjHeader != null)
            && (tempObjHeader.getObjClass() == PcepOpenObjectVer1.OPEN_OBJ_CLASS)) {

        if (llErrObjList.isEmpty()) {
            throw new PcepParseException("<error-obj-list> should be present if OPEN-OBJECT exists");
        }

        PcepOpenObject pcepOpenObj = PcepOpenObjectVer1.read(cb);
        this.errObjListWithOpen = new ErrorObjListWithOpen(llErrObjList, pcepOpenObj);

    } else if ((tempObjHeader != null) //check whether RP or LS Object is present.
            && ((tempObjHeader.getObjClass() == PcepRPObjectVer1.RP_OBJ_CLASS)
                    || (tempObjHeader.getObjClass() == PcepLSObjectVer1.LS_OBJ_CLASS))) {

        this.errInfo = new PcepErrorInfoVer1(null, null, llErrObjList);
        this.errInfo.read(cb);

    } else if (!llErrObjList.isEmpty()) {
        //If only PCEP-ERROR list is present then store it in errObjListWithOpen.
        this.errObjListWithOpen = new ErrorObjListWithOpen(llErrObjList);
    } else {
        throw new PcepParseException("Empty PCEP-ERROR message.");
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:49,代码来源:PcepErrorMsgVer1.java

示例3: getErrorObjListWithOpen

import org.onosproject.pcepio.types.ErrorObjListWithOpen; //导入依赖的package包/类
@Override
public ErrorObjListWithOpen getErrorObjListWithOpen() {
    return this.errObjListWithOpen;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:PcepErrorMsgVer1.java

示例4: setErrorObjListWithOpen

import org.onosproject.pcepio.types.ErrorObjListWithOpen; //导入依赖的package包/类
@Override
public Builder setErrorObjListWithOpen(ErrorObjListWithOpen errObjListWithOpen) {
    this.errObjListWithOpen = errObjListWithOpen;
    return this;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:6,代码来源:PcepErrorMsgVer1.java

示例5: PcepErrorMsgVer1

import org.onosproject.pcepio.types.ErrorObjListWithOpen; //导入依赖的package包/类
/**
 * Constructor to initialize variables.
 *
 * @param errObjListWithOpen error-object-list with open object
 * @param errInfo error information
 */
public PcepErrorMsgVer1(ErrorObjListWithOpen errObjListWithOpen, PcepErrorInfo errInfo) {
    this.errObjListWithOpen = errObjListWithOpen;
    this.errInfo = errInfo;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:PcepErrorMsgVer1.java

示例6: getErrorObjListWithOpen

import org.onosproject.pcepio.types.ErrorObjListWithOpen; //导入依赖的package包/类
/**
 * Returns Object of ErrorObjListWithOpen.
 *
 * @return Object of ErrorObjListWithOpen
 */
ErrorObjListWithOpen getErrorObjListWithOpen();
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:PcepErrorMsg.java

示例7: setErrorObjListWithOpen

import org.onosproject.pcepio.types.ErrorObjListWithOpen; //导入依赖的package包/类
/**
 * Sets errObjListWithOpen object.
 *
 * @param errObjListWithOpen error object List with open object
 */
void setErrorObjListWithOpen(ErrorObjListWithOpen errObjListWithOpen);
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:PcepErrorMsg.java


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