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


Java ObjectParameters类代码示例

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


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

示例1: decode

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
public void decode(byte[] bytes, int offset) throws MalformedPCEPObjectException
{
	int len=0;
	endPoint = new EndPoint(bytes, offset);
	offset = offset + endPoint.getLength();
	len += endPoint.getLength();
	
	
	while ((offset < bytes.length) && (PCEPTLV.getType(bytes, offset)==ObjectParameters.PCEP_TLV_TYPE_LABEL_REQUEST))
	{
		EndpointRestriction EndpointRestriction = new EndpointRestriction(bytes, offset);
		EndpointRestrictionList.add(EndpointRestriction);
		offset = offset + EndpointRestriction.getLength();
		len += EndpointRestriction.getLength();
	}
	
	this.setLength(len);
	
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:20,代码来源:EndPointAndRestrictions.java

示例2: decode

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
public void decode() throws MalformedPCEPObjectException{
	log.debug("Decoding PathReservation TLV");
	int offset=4;
	//Time
	for (int k = 0; k < 4; k++) {
		time = (time << 8) | (this.tlv_bytes[k+offset] & 0xff);
	}
	offset=offset+4;
	//Bidirectional
	bidirectional=(this.tlv_bytes[offset]&0x01)==0x01;
	offset=offset+4;
	//ERO
	int oc=PCEPObject.getObjectClass(this.tlv_bytes, offset);
	if (oc==ObjectParameters.PCEP_OBJECT_CLASS_ERO){
		log.debug("ERO Object found");
		try {
			eRO=new ExplicitRouteObject(this.tlv_bytes,offset);
		} catch (MalformedPCEPObjectException e) {
			throw new MalformedPCEPObjectException();
		}
		offset=offset+eRO.getLength();
	}

}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:25,代码来源:PathReservationTLV.java

示例3: decode

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
/**
 * Decode a PCEP Message from a byte array. 
 * The byte array is copied in messageBytes
 * @throws PCEPProtocolViolationException Exception when the message is malformed 
 */
private void decode()  throws PCEPProtocolViolationException {
	//Decoding PCEP Close Message"
	int offset=4;//We start after the object header
	// TODO Auto-generated method stub
	if (PCEPObject.getObjectClass(this.messageBytes, offset)==ObjectParameters.PCEP_OBJECT_CLASS_CLOSE){
		try {
			close=new Close(this.messageBytes,offset);
		} catch (MalformedPCEPObjectException e) {
			log.warn("Malformed PCEP Close object");
			throw new PCEPProtocolViolationException();
		}			
	}
	else {
		throw new PCEPProtocolViolationException();
	}
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:22,代码来源:PCEPClose.java

示例4: decode

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
/**
 * Decode the PCEP Notification Message
 * @throws PCEPProtocolViolationException Exception when the message is malformed 
 */
public void decode() throws PCEPProtocolViolationException {
	//Decoding PCEP Notification Message
	int offset=4;//We start after the object header
	if (offset>=this.getLength()){
		log.warn("Empty notification message");
		throw new PCEPProtocolViolationException();
	}
	int oc=PCEPObject.getObjectClass(this.messageBytes, offset);
	while (((oc==ObjectParameters.PCEP_OBJECT_CLASS_RP)||(oc==ObjectParameters.PCEP_OBJECT_CLASS_NOTIFICATION))) {
		Notify notf=new Notify(this.messageBytes, offset);
		notifyList.add(notf);
		offset=offset+notf.getLength();
		if (offset>=this.getLength()){
			return;
		}
		oc=PCEPObject.getObjectClass(this.messageBytes, offset);				
	}
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:23,代码来源:PCEPNotification.java

示例5: decode

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
/**
 * Decode the PCEP Response message
 * @throws PCEPProtocolViolationException Exception when the message is malformed 
 */
public void decode() throws PCEPProtocolViolationException {
	//Decoding PCEP Response Message
	byte[] bytes=this.getBytes();
	int offset=4;//We start after the object header
	while (PCEPObject.getObjectClass(bytes, offset)==ObjectParameters.PCEP_OBJECT_CLASS_RP){
		Response res=new Response();
		res.decode(bytes, offset);
		ResponseList.add(res);
		offset=offset+res.getLength();
		if (offset>=bytes.length){
			return;
		}
	}

	if (ResponseList.size()==0){
		log.warn("No Responses in the PCEP Response message");
		throw new PCEPProtocolViolationException();
	}
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:24,代码来源:PCEPResponse.java

示例6: completeMetric

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
public static void completeMetric(Path path, Request req,List<IntraDomainEdge> edge_list){
	for (int i=0;i<req.getMetricList().size();++i){
		if (req.getMetricList().get(i).isComputedMetricBit()){
			int metric_type=req.getMetricList().get(i).getMetricType();
			switch (metric_type){
			case ObjectParameters.PCEP_METRIC_TYPE_HOP_COUNT:
				Metric metric=new Metric();
				metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_HOP_COUNT);
				float metricValue=(float)edge_list.size();
				metric.setMetricValue(metricValue);
				path.getMetricList().add(metric);
				break;
			case ObjectParameters.PCEP_METRIC_TYPE_LATENCY_METRIC:
				Metric metricLat=new Metric();
				metricLat.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_LATENCY_METRIC);
				float metricValueLat=0;
				for (int j=0;j<edge_list.size();++j){
					metricValueLat+=edge_list.get(j).getDelay_ms();
				}
				metricLat.setMetricValue(metricValueLat);
				path.getMetricList().add(metricLat);
				break;
			}
		}
	}
}
 
开发者ID:telefonicaid,项目名称:netphony-pce,代码行数:27,代码来源:PCEPUtils.java

示例7: createRequest

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
/**
 * Create a request object
 * @param src_ip
 * @param dst_ip
 * @return
 */
private Request createRequest(int i){
	Request req = new Request();
	//RequestParameters
	RequestParameters rp= new RequestParameters();
	rp.setPbit(true);				
	rp.setRequestID(EmulatedPCCPCEPSession.getNewReqIDCounter());		
	rp.setPrio(testerParams.getRequestToSendList().get(i).getRequestParameters().getPriority());		
	rp.setReopt(testerParams.getRequestToSendList().get(i).getRequestParameters().isReoptimization());	
	rp.setBidirect(testerParams.getRequestToSendList().get(i).getRequestParameters().isBidirectional());
	rp.setLoose(testerParams.getRequestToSendList().get(i).getRequestParameters().isLoose());
	req.setRequestParameters(rp);
	//EndPoints
	EndPointsIPv4 ep=new EndPointsIPv4();				
	req.setEndPoints(ep);
	ep.setSourceIP(testerParams.getRequestToSendList().get(i).getSource());	
	ep.setDestIP(testerParams.getRequestToSendList().get(i).getDestiny());
	//Metric
	if (testerParams.getRequestToSendList().get(i).getRequestParameters().isDelayMetric()){
	     Metric metric = new Metric();
	     metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_LATENCY_METRIC);
	     metric.setComputedMetricBit(true);
	     req.getMetricList().add(metric);
	   
	  }
	//Offset Algorithmn
	  if (testerParams.getRequestToSendList().get(i).getRequestParameters().isOf()){
	   ObjectiveFunction of = new ObjectiveFunction();
	   req.setObjectiveFunction(of);
	   of.setOFcode(testerParams.getRequestToSendList().get(i).getRequestParameters().getOfCode()); 
	  }
	  //reservation
	  if (testerParams.getRequestToSendList().get(i).getRequestParameters().isReservation()){
	   Reservation res= new Reservation();
	   req.setReservation(res);
	   res.setTimer(testerParams.getRequestToSendList().get(i).getRequestParameters().getTimeReserved());
	  }
	return req;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:45,代码来源:AutomaticClientTask.java

示例8: createRequestMessage

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
/**
 * Create a PC Request message including Monitoring, PCC-Id-Req and Request
 * @param i index of the request  
 * @return
 */
static PCEPRequest createRequestMessage(int i){
	PCEPRequest p_r = new PCEPRequest();
	//Creamos el objecto monitoring
	//Monitoring monitoring=createMonitoring();
	//Creamos el objeto PCCIdReq
	//PccReqId pccReqId = createPccReqId();
	//Creamos el object Request 
	Request req = createRequest(i);
	if (testerParams.getRequestToSendList().get(i).getRequestParameters().isDelayMetric()){
	     Metric metric = new Metric();
	     metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_LATENCY_METRIC);
	     metric.setComputedMetricBit(true);
	     req.getMetricList().add(metric);
	   
	  }
	  if (testerParams.getRequestToSendList().get(i).getRequestParameters().isOf()){
	   ObjectiveFunction of = new ObjectiveFunction();
	   req.setObjectiveFunction(of);
	   of.setOFcode(testerParams.getRequestToSendList().get(i).getRequestParameters().getOfCode()); 
	  }

	  if (testerParams.getRequestToSendList().get(i).getRequestParameters().isReservation()){
	   Reservation res= new Reservation();
	   req.setReservation(res);
	   res.setTimer(testerParams.getRequestToSendList().get(i).getRequestParameters().getTimeReserved());
	  }
	  if (testerParams.getRequestToSendList().get(i).getRequestParameters().Is_bandwidth()){
		   BandwidthRequested bw= new BandwidthRequested();
		   bw.setBw(testerParams.getRequestToSendList().get(i).getRequestParameters().getBW());
		   req.setBandwidth(bw);
		  }
	//p_r.setMonitoring(monitoring);
	//p_r.setPccReqId(pccReqId);
	p_r.addRequest(req);
	return p_r;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:42,代码来源:singleClient.java

示例9: getSourceIfID

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
public long getSourceIfID(EndPoints  EP) {
	long if_id=-1;
	if (EP.getOT()==ObjectParameters.PCEP_OBJECT_TYPE_GENERALIZED_ENDPOINTS){
		GeneralizedEndPoints  gep=(GeneralizedEndPoints) EP;
		if(gep.getGeneralizedEndPointsType()==ObjectParameters.PCEP_GENERALIZED_END_POINTS_TYPE_P2P){
			if (gep.getP2PEndpoints().getSourceEndPoint().getUnnumberedEndpoint()!=null){
				if_id =gep.getP2PEndpoints().getSourceEndPoint().getUnnumberedEndpoint().getIfID() ;
			}			
		}

	}
	return if_id;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:14,代码来源:VNTMSession.java

示例10: getDestIfID

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
public long getDestIfID(EndPoints  EP) {
	long if_id=-1;
	if (EP.getOT()==ObjectParameters.PCEP_OBJECT_TYPE_GENERALIZED_ENDPOINTS){
		GeneralizedEndPoints  gep=(GeneralizedEndPoints) EP;
		if(gep.getGeneralizedEndPointsType()==ObjectParameters.PCEP_GENERALIZED_END_POINTS_TYPE_P2P){
			if (gep.getP2PEndpoints().getDestinationEndPoint().getUnnumberedEndpoint()!=null){
				if_id =gep.getP2PEndpoints().getDestinationEndPoint().getUnnumberedEndpoint().getIfID() ;
			}			
		}

	}
	return if_id;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:14,代码来源:VNTMSession.java

示例11: getDestRouter

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
public Inet4Address getDestRouter(EndPoints  EP) {
	Inet4Address dest_router_id_addr=null;
	if (EP.getOT()==ObjectParameters.PCEP_OBJECT_TYPE_ENDPOINTS_IPV4){
		EndPointsIPv4  ep=(EndPointsIPv4) EP;
		dest_router_id_addr=ep.getDestIP();
	}else if (EP.getOT()==ObjectParameters.PCEP_OBJECT_TYPE_ENDPOINTS_IPV6){

	}

	if (EP.getOT()==ObjectParameters.PCEP_OBJECT_TYPE_GENERALIZED_ENDPOINTS){
		GeneralizedEndPoints  gep=(GeneralizedEndPoints) EP;
		if(gep.getGeneralizedEndPointsType()==ObjectParameters.PCEP_GENERALIZED_END_POINTS_TYPE_P2P){
			P2PEndpoints p2pep= gep.getP2PEndpoints();
			EndPoint sourceep=p2pep.getSourceEndPoint();
			EndPoint destep=p2pep.getDestinationEndPoint();

			if (destep.getEndPointIPv4TLV()!=null){
				dest_router_id_addr=destep.getEndPointIPv4TLV().getIPv4address();
			}else if (destep.getUnnumberedEndpoint()!=null){
				dest_router_id_addr=destep.getUnnumberedEndpoint().getIPv4address();
			}

		}

	}

	return dest_router_id_addr;

}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:30,代码来源:VNTMSession.java

示例12: decode

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
public void decode(byte[] bytes, int offset) throws MalformedPCEPObjectException {		
	int tlvtype=PCEPTLV.getType(bytes, offset);
	int tlvlength=PCEPTLV.getTotalTLVLength(bytes, offset);
	this.setLength(tlvlength);

	if (tlvtype==ObjectParameters.PCEP_TLV_TYPE_IPV4_ADDRESS){
		endPointIPv4=new EndPointIPv4TLV(bytes, offset);
	}
	else if (tlvtype==ObjectParameters.PCEP_TLV_TYPE_UNNUMBERED_ENDPOINT){
		unnumberedEndpoint=new UnnumberedEndpointTLV(bytes, offset);
	}

	else if (tlvtype==ObjectParameters.PCEP_TLV_TYPE_ENDPOINTS_STORAGE){
		endPointStorage=new EndPointStorageTLV(bytes, offset);
	}

	else if (tlvtype==ObjectParameters.PCEP_TLV_TYPE_ENDPOINTS_SERVER){
		endPointServer=new EndPointServerTLV(bytes, offset);
	}

	else if (tlvtype==ObjectParameters.PCEP_TLV_TYPE_ENDPOINTS_APPLICATION){
		endPointApplication=new EndPointApplicationTLV(bytes, offset);
	}

	else if (tlvtype==ObjectParameters.PCEP_TLV_TYPE_XIFI){
		xifiEndPointTLV = new XifiEndPointTLV(bytes, offset);
	}

	else if (tlvtype==ObjectParameters.PCEP_TLV_TYPE_DATAPATHID){
		endPointDataPathID = new EndPointDataPathTLV(bytes, offset);
	}
	else if (tlvtype==ObjectParameters.PCEP_TLV_TYPE_UNNUMBERED_ENDPOINT_DATAPATHID){
		endPointUnnumberedDataPathID = new EndPointUnnumberedDataPathTLV(bytes, offset);
	}

}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:37,代码来源:EndPoint.java

示例13: decode

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
private void decode(byte[] bytes, int offset)
throws PCEPProtocolViolationException, MalformedPCEPObjectException {
	int max_offset=bytes.length;
	if (offset>=max_offset){
		log.warn("Empty FullAnycastEndpoints construct!!!");
		throw new PCEPProtocolViolationException();
	}
	
	sourceEndpoint = new EndPoint(bytes, offset);
	offset = offset + sourceEndpoint.getLength();
	
	while (PCEPTLV.getType(bytes, offset)==ObjectParameters.PCEP_TLV_TYPE_LABEL_REQUEST){
		EndpointRestriction sourceEndpointRestriction = new EndpointRestriction(bytes, offset);
		sourceEndpointRestrictionList.add(sourceEndpointRestriction);
		offset = offset + sourceEndpointRestriction.getLength();
	}
	
	destinationEndpoint = new EndPoint(bytes, offset);
	offset = offset + destinationEndpoint.getLength();
	
	while (PCEPTLV.getType(bytes, offset)==ObjectParameters.PCEP_TLV_TYPE_LABEL_REQUEST){
		EndpointRestriction destinationEndpointRestriction = new EndpointRestriction(bytes, offset);
		destinationEndpointRestrictionList.add(destinationEndpointRestriction);
		offset = offset + destinationEndpointRestriction.getLength();
	}
	
	
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:29,代码来源:FullAnycastEndpoints.java

示例14: SREROSubobject

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
public SREROSubobject(){
	//TODO: this will be variable in future updates
	erosolength = 8;
	fflag = true;
	sflag = false;
	cflag = false;
	mflag = false;
	loosehop = false;
	ST = 0;
	type = ObjectParameters.PCEP_SUBOBJECT_TYPE_SR_ERO;

}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:13,代码来源:SREROSubobject.java

示例15: DomainIDTLV

import es.tid.pce.pcep.objects.ObjectParameters; //导入依赖的package包/类
public DomainIDTLV(){
	this.TLVType=ObjectParameters.PCEP_TLV_DOMAIN_ID_TLV;
	try {
		domainType=1;//Default value
		domainId=(Inet4Address) Inet4Address.getByName("0.0.0.1");
	} catch (UnknownHostException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:11,代码来源:DomainIDTLV.java


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