本文整理汇总了Java中es.tid.pce.pcep.objects.tlvs.subtlvs.StorageSizeSubTLV类的典型用法代码示例。如果您正苦于以下问题:Java StorageSizeSubTLV类的具体用法?Java StorageSizeSubTLV怎么用?Java StorageSizeSubTLV使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StorageSizeSubTLV类属于es.tid.pce.pcep.objects.tlvs.subtlvs包,在下文中一共展示了StorageSizeSubTLV类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decode
import es.tid.pce.pcep.objects.tlvs.subtlvs.StorageSizeSubTLV; //导入依赖的package包/类
public void decode() throws MalformedPCEPObjectException {
boolean fin=false;
int offset=4;//Position of the next subobject
if (this.getSubTLVValueLength()==0){
throw new MalformedPCEPObjectException();
}
while (!fin) {
int subTLVType=PCEPSubTLV.getType(this.getSubTLV_bytes(), offset);
int subTLVLength=PCEPSubTLV.getTotalSubTLVLength(this.getSubTLV_bytes(), offset);
log.debug("subTLVType: "+subTLVType+" subTLVLength: "+subTLVLength);
switch (subTLVType){
case PCEPSubTLVTypes.PCEP_SUBTLV_TYPE_STORAGE_SIZE:
log.debug("StorageSize SubTLV found");
this.storageSize=new StorageSizeSubTLV(this.getSubTLV_bytes(), offset);
break;
case PCEPSubTLVTypes.PCEP_SUBTLV_TYPE_STORAGE_INFO:
log.debug("StorageInfo SubTLV found");
this.storageInfo=new StorageInfoSubTLV(this.getSubTLV_bytes(), offset);
break;
case PCEPSubTLVTypes.PCEP_SUBTLV_TYPE_VOLUME:
VolumeSubTLV volume = new VolumeSubTLV(this.getSubTLV_bytes(), offset);
log.debug("Volume SubTLV found");
if (volumeList==null){
log.debug("Creating VolumeSubTLVList");
volumeList=new LinkedList<VolumeSubTLV>();
}
this.volumeList.add(volume);
}
offset=offset+subTLVLength;
if (offset>=(this.getSubTLVValueLength()+4)){
log.debug("No more SubTLVs in ServerStorage Sub-TLV");
fin=true;
}
}
}
示例2: getStorageCharacteristics
import es.tid.pce.pcep.objects.tlvs.subtlvs.StorageSizeSubTLV; //导入依赖的package包/类
public static Hashtable<StorageTLV,Object> getStorageCharacteristics(String fileName){
Hashtable <StorageTLV,Object> storage_site_ed=new Hashtable <StorageTLV,Object>();
// StorageTLV storagetlv = new StorageTLV();
// ResourceIDSubTLV resourceidsubtlv = new ResourceIDSubTLV();
// CostSubTLV costsubtlv = new CostSubTLV();
// LinkedList<CostSubTLV> costlist = new LinkedList<CostSubTLV> ();
// StorageSizeSubTLV storagesizesubtlv = new StorageSizeSubTLV();
File file2 = new File(fileName);
try {
DocumentBuilder builder2 = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc2 = builder2.parse(file2);
NodeList nodes_domains = doc2.getElementsByTagName("domain");
for (int j = 0; j < nodes_domains.getLength(); j++) {
Element element_domain = (Element) nodes_domains.item(j);
NodeList nodes_domain_id = element_domain.getElementsByTagName("domain_id");
Element domain_id_e = (Element) nodes_domain_id.item(0);
String domain_id_str=getCharacterDataFromElement(domain_id_e);
Inet4Address domain_id= (Inet4Address) Inet4Address.getByName(domain_id_str);
NodeList storages = element_domain.getElementsByTagName("storage");
for (int i = 0; i < storages.getLength(); i++) {
StorageTLV storagetlv = new StorageTLV();
ResourceIDSubTLV resourceidsubtlv = new ResourceIDSubTLV();
CostSubTLV costsubtlv = new CostSubTLV();
LinkedList<CostSubTLV> costlist = new LinkedList<CostSubTLV> ();
StorageSizeSubTLV storagesizesubtlv = new StorageSizeSubTLV();
Element element = (Element) storages.item(i);
NodeList resource_id_node = element.getElementsByTagName("resource_id");
Element resource_id_e = (Element) resource_id_node.item(0);
String resource_id=getCharacterDataFromElement(resource_id_e);
Inet4Address resource_id_addr= (Inet4Address) Inet4Address.getByName(resource_id);
resourceidsubtlv.setResourceID(resource_id_addr);
Inet4Address virtual_TI_site= (Inet4Address) Inet4Address.getByName((element.getAttributeNode("it_site").getValue()).toString());
costsubtlv.setUsageUnit((element.getAttributeNode("UsageUnit").getValue()).getBytes());
costsubtlv.setUnitaryPrice((element.getAttributeNode("UnitaryPrice").getValue()).getBytes());
costlist.add(costsubtlv);
storagesizesubtlv.setTotalSize(Integer.parseInt(element.getAttributeNode("TotalSize").getValue()));
storagesizesubtlv.setAvailableSize(Integer.parseInt(element.getAttributeNode("AvailableSize").getValue()));
storagetlv.setResourceIDSubTLV(resourceidsubtlv);
storagetlv.setCostList(costlist);
storagetlv.setStorageSizeSubTLV(storagesizesubtlv);
storage_site_ed.put(storagetlv, virtual_TI_site);
}
}
}
catch (Exception e) {
e.printStackTrace();
}
return storage_site_ed;
}
示例3: setStorageSize
import es.tid.pce.pcep.objects.tlvs.subtlvs.StorageSizeSubTLV; //导入依赖的package包/类
public void setStorageSize(StorageSizeSubTLV StorageSize) {
this.storageSize = StorageSize;
}
示例4: getStorageSize
import es.tid.pce.pcep.objects.tlvs.subtlvs.StorageSizeSubTLV; //导入依赖的package包/类
public StorageSizeSubTLV getStorageSize() {
return storageSize;
}
示例5: decode
import es.tid.pce.pcep.objects.tlvs.subtlvs.StorageSizeSubTLV; //导入依赖的package包/类
public void decode() throws MalformedPCEPObjectException{
log.debug("Decoding Storage EndPoint TLV");
boolean fin=false;
int offset=4;//Position of the next subobject
if (this.getTLVValueLength()==0){
throw new MalformedPCEPObjectException();
}
while (!fin) {
int subTLVType=PCEPSubTLV.getType(this.getTlv_bytes(), offset);
int subTLVLength=PCEPSubTLV.getTotalSubTLVLength(this.getTlv_bytes(), offset);
log.debug("subTLVType: "+subTLVType+" subTLVLength: "+subTLVLength);
switch (subTLVType){
case PCEPSubTLVTypes.PCEP_SUBTLV_TYPE_RESOURCE_ID:
log.debug("Storage Resource ID");
this.resourceID=new ResourceIDSubTLV(this.getTlv_bytes(), offset);
break;
case PCEPSubTLVTypes.PCEP_SUBTLV_TYPE_LOCATION:
log.debug("Location SubTLV");
this.location=new LocationSubTLV(this.getTlv_bytes(), offset);
break;
case PCEPSubTLVTypes.PCEP_SUBTLV_TYPE_COST:
CostSubTLV cost = new CostSubTLV(this.getTlv_bytes(), offset);
log.debug("Cost SubTLV");
if (costList==null){
log.debug("Creating CostSubTLVList");
costList=new LinkedList<CostSubTLV>();
}
this.costList.add(cost);
break;
case PCEPSubTLVTypes.PCEP_SUBTLV_TYPE_NETWORK_SPEC:
log.debug("NetworkSpec SubTLV");
this.networkSpec=new NetworkSpecSubTLV(this.getTlv_bytes(), offset);
break;
case PCEPSubTLVTypes.PCEP_SUBTLV_TYPE_POWER:
log.debug("Power SubTLV");
this.power=new PowerSubTLV(this.getTlv_bytes(), offset);
break;
case PCEPSubTLVTypes.PCEP_SUBTLV_TYPE_STORAGE_SIZE:
log.debug("StorageSize SubTLV");
this.storageSize=new StorageSizeSubTLV(this.getTlv_bytes(), offset);
break;
case PCEPSubTLVTypes.PCEP_SUBTLV_TYPE_STORAGE_INFO:
log.debug("StorageINFO SubTLV");
this.storageInfo=new StorageInfoSubTLV(this.getTlv_bytes(), offset);
break;
case PCEPSubTLVTypes.PCEP_SUBTLV_TYPE_VOLUME:
VolumeSubTLV volume = new VolumeSubTLV(this.getTlv_bytes(), offset);
log.debug("Volume SubTLV");
if (volumeList==null){
log.debug("Creating VolumeSubTLVList");
volumeList=new LinkedList<VolumeSubTLV>();
}
this.volumeList.add(volume);
break;
}
offset=offset+subTLVLength;
if (offset>=(this.getTLVValueLength()+4)){
log.debug("No more SubTLVs in Storage TLV");
fin=true;
}
}
}
示例6: getStorageSizeSubTLV
import es.tid.pce.pcep.objects.tlvs.subtlvs.StorageSizeSubTLV; //导入依赖的package包/类
public StorageSizeSubTLV getStorageSizeSubTLV() {
return storageSize;
}
示例7: setStorageSizeSubTLV
import es.tid.pce.pcep.objects.tlvs.subtlvs.StorageSizeSubTLV; //导入依赖的package包/类
public void setStorageSizeSubTLV(StorageSizeSubTLV StorageSizeSubTLV) {
this.storageSize = StorageSizeSubTLV;
}
示例8: setStorageSize
import es.tid.pce.pcep.objects.tlvs.subtlvs.StorageSizeSubTLV; //导入依赖的package包/类
public void setStorageSize(StorageSizeSubTLV storageSize) {
this.storageSize = storageSize;
}