本文整理汇总了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);
}
示例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());
}
}
示例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());
}
}