本文整理汇总了Java中org.onosproject.pcepio.protocol.PcepLspaObject类的典型用法代码示例。如果您正苦于以下问题:Java PcepLspaObject类的具体用法?Java PcepLspaObject怎么用?Java PcepLspaObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PcepLspaObject类属于org.onosproject.pcepio.protocol包,在下文中一共展示了PcepLspaObject类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PcepAttributeVer1
import org.onosproject.pcepio.protocol.PcepLspaObject; //导入依赖的package包/类
/**
* Constructor to initialize all parameters for PCEP attribute.
*
* @param lspaObject PCEP lspa Object.
* @param bandwidthObject PCEP bandwidth object.
* @param llMetricList list of PCEP metric objects.
* @param iroObject PCEP iro object.
*/
public PcepAttributeVer1(PcepLspaObject lspaObject, PcepBandwidthObject bandwidthObject,
LinkedList<PcepMetricObject> llMetricList, PcepIroObject iroObject) {
this.lspaObject = lspaObject;
this.bandwidthObject = bandwidthObject;
this.llMetricList = llMetricList;
this.iroObject = iroObject;
if (lspaObject == null) {
this.isLspaObjectSet = false;
} else {
this.isLspaObjectSet = true;
}
if (bandwidthObject == null) {
this.isBandwidthObjectSet = false;
} else {
this.isBandwidthObjectSet = true;
}
if (llMetricList == null) {
this.isMetricListSet = false;
} else {
this.isMetricListSet = true;
}
if (iroObject == null) {
this.isIroObjectSet = false;
} else {
this.isIroObjectSet = true;
}
}
示例2: build
import org.onosproject.pcepio.protocol.PcepLspaObject; //导入依赖的package包/类
@Override
public PcepAttribute build() {
//PCEP LSPA Object
PcepLspaObject lspaObject = null;
//PCEP BANDWIDTH Object
PcepBandwidthObject bandwidthObject = null;
//PCEP Metric list
LinkedList<PcepMetricObject> llMetricList = null;
//PCEP IRO object
PcepIroObject iroObject = null;
if (this.isLspaObjectSet) {
lspaObject = this.lspaObject;
}
if (this.isBandwidthObjectSet) {
bandwidthObject = this.bandwidthObject;
}
if (this.isMetricListSet) {
llMetricList = this.llMetricList;
}
if (this.isIroObjectSet) {
iroObject = this.iroObject;
}
return new PcepAttributeVer1(lspaObject, bandwidthObject, llMetricList, iroObject);
}
示例3: read
import org.onosproject.pcepio.protocol.PcepLspaObject; //导入依赖的package包/类
/**
* Reads channel buffer and returns object of PcepLspaObject.
*
* @param cb of type channel buffer.
* @return object of PcepLspaObject
* @throws PcepParseException while parsing lspa object from channel buffer
*/
public static PcepLspaObject read(ChannelBuffer cb) throws PcepParseException {
log.debug("LspaObject::read");
PcepObjectHeader lspaObjHeader;
int iExcludeAny;
int iIncludeAny;
int iIncludeAll;
byte cSetupPriority;
byte cHoldPriority;
boolean bLFlag;
byte flags;
// Optional TLV
LinkedList<PcepValueType> llOptionalTlv;
lspaObjHeader = PcepObjectHeader.read(cb);
//take only Lspa Object buffer.
ChannelBuffer tempCb = cb.readBytes(lspaObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
iExcludeAny = tempCb.readInt();
iIncludeAny = tempCb.readInt();
iIncludeAll = tempCb.readInt();
cSetupPriority = tempCb.readByte();
cHoldPriority = tempCb.readByte();
flags = tempCb.readByte();
tempCb.readByte();
bLFlag = (flags & (byte) LFLAG_SET) == LFLAG_SET;
llOptionalTlv = parseOptionalTlv(tempCb);
return new PcepLspaObjectVer1(lspaObjHeader, bLFlag, iExcludeAny, iIncludeAny, iIncludeAll, cSetupPriority,
cHoldPriority, llOptionalTlv);
}
示例4: build
import org.onosproject.pcepio.protocol.PcepLspaObject; //导入依赖的package包/类
@Override
public PcepLspaObject build() throws PcepParseException {
PcepObjectHeader lspaObjHeader = this.bIsHeaderSet ? this.lspaObjHeader : DEFAULT_LSPA_OBJECT_HEADER;
if (!this.bIsExcludeAnySet) {
throw new PcepParseException("ExcludeAny NOT Set while building PcepLspaObject.");
}
if (!this.bIsIncludeAnySet) {
throw new PcepParseException("IncludeAny NOT Set while building PcepLspaObject.");
}
if (!this.bIsIncludeAllSet) {
throw new PcepParseException("IncludeAll NOT Set while building PcepLspaObject.");
}
if (!this.bIsSetupPrioritySet) {
throw new PcepParseException("Setup Priority NOT Set while building PcepLspaObject.");
}
if (!this.bIsHoldPrioritySet) {
throw new PcepParseException("Hold Priority NOT Set while building PcepLspaObject.");
}
if (bIsPFlagSet) {
lspaObjHeader.setPFlag(bPFlag);
}
if (bIsIFlagSet) {
lspaObjHeader.setIFlag(bIFlag);
}
return new PcepLspaObjectVer1(lspaObjHeader, bLFlag, iExcludeAny, iIncludeAny, iIncludeAll, cSetupPriority,
cHoldPriority, llOptionalTlv);
}
示例5: read
import org.onosproject.pcepio.protocol.PcepLspaObject; //导入依赖的package包/类
/**
* Reads lspa , bandwidth , Metriclist and Iro objects and sets the objects.
*
* @param cb of type channel buffer
* @return instance of Pcep Attribute
* @throws PcepParseException while parsing Pcep Attributes from channel buffer
*/
public static PcepAttribute read(ChannelBuffer cb) throws PcepParseException {
if (cb.readableBytes() < OBJECT_HEADER_LENGTH) {
return null;
}
//check whether any pcep attribute is present
cb.markReaderIndex();
PcepObjectHeader tempObjHeader = PcepObjectHeader.read(cb);
cb.resetReaderIndex();
byte yObjClass = tempObjHeader.getObjClass();
if (PcepLspaObjectVer1.LSPA_OBJ_CLASS != yObjClass && PcepBandwidthObjectVer1.BANDWIDTH_OBJ_CLASS != yObjClass
&& PcepMetricObjectVer1.METRIC_OBJ_CLASS != yObjClass && PcepIroObjectVer1.IRO_OBJ_CLASS != yObjClass) {
//No PCEP attribute is present
return null;
}
PcepAttributeVer1 pcepAttribute = new PcepAttributeVer1();
//If LSPA present then store it.LSPA is optional
if (yObjClass == PcepLspaObjectVer1.LSPA_OBJ_CLASS) {
pcepAttribute.setLspaObject(PcepLspaObjectVer1.read(cb));
yObjClass = checkNextObject(cb);
}
//If BANDWIDTH present then store it.BANDWIDTH is optional
if (yObjClass == PcepBandwidthObjectVer1.BANDWIDTH_OBJ_CLASS) {
pcepAttribute.setBandwidthObject(PcepBandwidthObjectVer1.read(cb));
yObjClass = checkNextObject(cb);
}
//If Metric list present then store it.MetricList is optional
if (yObjClass == PcepMetricObjectVer1.METRIC_OBJ_CLASS) {
pcepAttribute.parseMetricList(cb);
yObjClass = checkNextObject(cb);
}
//If IRO present then store it.IRO is optional
if (yObjClass == PcepIroObjectVer1.IRO_OBJ_CLASS) {
pcepAttribute.setIroObject(PcepIroObjectVer1.read(cb));
}
PcepLspaObject lspaObject = pcepAttribute.getLspaObject();
PcepBandwidthObject bandwidthObject = pcepAttribute.getBandwidthObject();
LinkedList<PcepMetricObject> metriclist = pcepAttribute.llMetricList;
PcepIroObject iroObject = pcepAttribute.getIroObject();
return new PcepAttributeVer1(lspaObject, bandwidthObject, metriclist, iroObject);
}
示例6: getLspaObject
import org.onosproject.pcepio.protocol.PcepLspaObject; //导入依赖的package包/类
@Override
public PcepLspaObject getLspaObject() {
return lspaObject;
}
示例7: setLspaObject
import org.onosproject.pcepio.protocol.PcepLspaObject; //导入依赖的package包/类
@Override
public void setLspaObject(PcepLspaObject lspaObject) {
this.isLspaObjectSet = true;
this.lspaObject = lspaObject;
}
示例8: buildLspaObject
import org.onosproject.pcepio.protocol.PcepLspaObject; //导入依赖的package包/类
@Override
public PcepLspaObject.Builder buildLspaObject() {
return new PcepLspaObjectVer1.Builder();
}