本文整理匯總了Java中org.onosproject.pcepio.protocol.PcInitiatedLspRequest類的典型用法代碼示例。如果您正苦於以下問題:Java PcInitiatedLspRequest類的具體用法?Java PcInitiatedLspRequest怎麽用?Java PcInitiatedLspRequest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PcInitiatedLspRequest類屬於org.onosproject.pcepio.protocol包,在下文中一共展示了PcInitiatedLspRequest類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: PcepInitiateMsgVer1
import org.onosproject.pcepio.protocol.PcInitiatedLspRequest; //導入依賴的package包/類
/**
* Constructor to initialize PcInitiatedLspRequest.
*
* @param llPcInitiatedLspRequestList list of PcInitiatedLspRequest
*/
PcepInitiateMsgVer1(LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList) {
if (llPcInitiatedLspRequestList == null) {
throw new NullPointerException("PcInitiatedLspRequestList cannot be null.");
}
this.llPcInitiatedLspRequestList = llPcInitiatedLspRequestList;
}
示例2: build
import org.onosproject.pcepio.protocol.PcInitiatedLspRequest; //導入依賴的package包/類
@Override
public PcInitiatedLspRequest build() throws PcepParseException {
//PCEP SRP Object
PcepSrpObject srpObject = null;
//PCEP LSP Object
PcepLspObject lspObject = null;
//PCEP End Point Object
PcepEndPointsObject endPointsObject = null;
//PCEP ERO Object
PcepEroObject eroObject = null;
//PCEP Attribute list
PcepAttribute pcepAttribute = null;
boolean bRFlag = false;
if (!this.bIsSrpObjectSet) {
throw new PcepParseException("Srp object NOT Set while building PcInitiatedLspRequest");
} else {
srpObject = this.srpObject;
bRFlag = srpObject.getRFlag();
}
if (bRFlag) {
this.bIsbRFlagSet = true;
} else {
this.bIsbRFlagSet = false;
}
if (!this.bIsLspObjectSet) {
throw new PcepParseException("LSP Object NOT Set while building PcInitiatedLspRequest");
} else {
lspObject = this.lspObject;
}
if (!this.bIsbRFlagSet) {
if (!this.bIsEndPointsObjectSet) {
throw new PcepParseException("EndPoints Object NOT Set while building PcInitiatedLspRequest");
} else {
endPointsObject = this.endPointsObject;
}
if (!this.bIsEroObjectSet) {
throw new PcepParseException("ERO Object NOT Set while building PcInitiatedLspRequest");
} else {
eroObject = this.eroObject;
}
if (bIsPcepAttributeSet) {
pcepAttribute = this.pcepAttribute;
}
}
return new PcInitiatedLspRequestVer1(srpObject, lspObject, endPointsObject, eroObject, pcepAttribute);
}
示例3: parsePcInitiatedLspRequestList
import org.onosproject.pcepio.protocol.PcInitiatedLspRequest; //導入依賴的package包/類
/**
* To parse PcInitiatedLspRequestList from PcInitiate Message.
*
* @param cb of type channel buffer
* @return true if parsing PcInitiatedLspRequestList is success, false otherwise
* @throws PcepParseException while parsing from channel buffer
*/
public boolean parsePcInitiatedLspRequestList(ChannelBuffer cb) throws PcepParseException {
boolean isDelLspRequest = false;
if (cb == null) {
throw new PcepParseException("Channel buffer is empty");
}
while (0 < cb.readableBytes()) {
PcInitiatedLspRequest pceInitLspReq = new PcInitiatedLspRequestVer1();
//store SRP object
PcepSrpObject srpObj;
srpObj = PcepSrpObjectVer1.read(cb);
pceInitLspReq.setSrpObject(srpObj);
isDelLspRequest = srpObj.getRFlag();
//store LSP object
PcepLspObject lspObj;
lspObj = PcepLspObjectVer1.read(cb);
pceInitLspReq.setLspObject(lspObj);
/* if R bit will be set then pcInitiate msg will contain only LSp and SRP objects
* so if R bit is not set then we should read for Ero and EndPoint objects also.
*/
if (!isDelLspRequest) {
//store EndPoint object
PcepEndPointsObject endPointObj;
endPointObj = PcepEndPointsObjectVer1.read(cb);
pceInitLspReq.setEndPointsObject(endPointObj);
//store ERO object
PcepEroObject eroObj;
eroObj = PcepEroObjectVer1.read(cb);
pceInitLspReq.setEroObject(eroObj);
if (cb.readableBytes() > MINIMUM_COMMON_HEADER_LENGTH) {
pceInitLspReq.setPcepAttribute(PcepAttributeVer1.read(cb));
}
}
llPcInitiatedLspRequestList.add(pceInitLspReq);
}
return true;
}
示例4: getPcInitiatedLspRequestList
import org.onosproject.pcepio.protocol.PcInitiatedLspRequest; //導入依賴的package包/類
@Override
public LinkedList<PcInitiatedLspRequest> getPcInitiatedLspRequestList() {
return this.llPcInitiatedLspRequestList;
}
示例5: setPcInitiatedLspRequestList
import org.onosproject.pcepio.protocol.PcInitiatedLspRequest; //導入依賴的package包/類
@Override
public Builder setPcInitiatedLspRequestList(LinkedList<PcInitiatedLspRequest> ll) {
this.llPcInitiatedLspRequestList = ll;
return this;
}
示例6: write
import org.onosproject.pcepio.protocol.PcInitiatedLspRequest; //導入依賴的package包/類
@Override
public void write(ChannelBuffer cb, PcepInitiateMsgVer1 message) throws PcepParseException {
boolean isDelLspRequest = false;
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);
ListIterator<PcInitiatedLspRequest> listIterator = message.llPcInitiatedLspRequestList.listIterator();
while (listIterator.hasNext()) {
PcInitiatedLspRequest listReq = listIterator.next();
//Srp Object is mandatory
PcepSrpObject srpObj = listReq.getSrpObject();
if (srpObj != null) {
isDelLspRequest = srpObj.getRFlag();
srpObj.write(cb);
} else {
throw new PcepParseException("SRP Object is mandatory for PcInitiate message.");
}
//LSP Object is mandatory
PcepLspObject lspObj = listReq.getLspObject();
if (lspObj != null) {
lspObj.write(cb);
} else {
throw new PcepParseException("LSP Object is mandatory for PcInitiate message.");
}
/* if R bit will be set then pcInitiate msg will contain only LSp and SRP objects
* so if R bit is not set then we should read for Ero and EndPoint objects also.
*/
if (!isDelLspRequest) {
//EndPoints object is mandatory
PcepEndPointsObject endPointObj = listReq.getEndPointsObject();
if (endPointObj != null) {
endPointObj.write(cb);
} else {
throw new PcepParseException("End points Object is mandatory for PcInitiate message.");
}
//Ero object is mandatory
PcepEroObject eroObj = listReq.getEroObject();
if (eroObj != null) {
eroObj.write(cb);
} else {
throw new PcepParseException("ERO Object is mandatory for PcInitiate message.");
}
//PcepAttribute is optional
PcepAttribute pcepAttribute = listReq.getPcepAttribute();
if (pcepAttribute != null) {
pcepAttribute.write(cb);
}
}
}
// PCInitiate message length field
int length = cb.writerIndex() - startIndex;
cb.setShort(msgLenIndex, (short) length);
}
示例7: buildPcInitiatedLspRequest
import org.onosproject.pcepio.protocol.PcInitiatedLspRequest; //導入依賴的package包/類
@Override
public PcInitiatedLspRequest.Builder buildPcInitiatedLspRequest() {
return new PcInitiatedLspRequestVer1.Builder();
}