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


Java Response类代码示例

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


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

示例1: decode

import es.tid.pce.pcep.constructs.Response; //导入依赖的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

示例2: keepConections

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
/**
 * RESTORATION CASE
 * Funcion que guarda todos los links que estan activos. Todas las respuestas de caminos que nos 
 * ha devuelto el PCE 
 * @param eroSubObjList
 */
private void keepConections(LinkedList<EROSubobject> eroSubObjList, Response response){				
	for (int i=0; i<eroSubObjList.size()-1;i++){
		Inet4Address src = null;
		Inet4Address dst = null;
		if (eroSubObjList.get(i).getType()==SubObjectValues.ERO_SUBOBJECT_IPV4PREFIX){
			src=((IPv4prefixEROSubobject)eroSubObjList.get(i)).getIpv4address();				
		}else if (eroSubObjList.get(i).getType()==SubObjectValues.ERO_SUBOBJECT_UNNUMBERED_IF_ID){
			src=((UnnumberIfIDEROSubobject)eroSubObjList.get(i)).getRouterID();				
		}
		if (eroSubObjList.get(i+1).getType()==SubObjectValues.ERO_SUBOBJECT_IPV4PREFIX){
			dst=((IPv4prefixEROSubobject)eroSubObjList.get(i+1)).getIpv4address();	
		}else if (eroSubObjList.get(i+1).getType()==SubObjectValues.ERO_SUBOBJECT_UNNUMBERED_IF_ID){
			dst=((UnnumberIfIDEROSubobject)eroSubObjList.get(i+1)).getRouterID();				
		}else if (eroSubObjList.get(i+1).getType()==SubObjectValues.ERO_SUBOBJECT_LABEL){
			if (eroSubObjList.get(i+2).getType()==SubObjectValues.ERO_SUBOBJECT_IPV4PREFIX){				
				dst=((IPv4prefixEROSubobject)eroSubObjList.get(i+2)).getIpv4address();
		}else if (eroSubObjList.get(i+2).getType()==SubObjectValues.ERO_SUBOBJECT_UNNUMBERED_IF_ID){					
				dst=((UnnumberIfIDEROSubobject)eroSubObjList.get(i+2)).getRouterID();					
			}
		}
		if ((src !=null)&&(dst!=null)){
			RestorationCaseTable restorationCase = new RestorationCaseTable();
			restorationCase.setSource(src);
			restorationCase.setDestination(dst);		
		//	restorationCase.setResponse(response);
			restorationCaseTable.add(restorationCase);
		}
	}

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

示例3: PCEPResponse

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
public PCEPResponse(byte [] bytes)  throws PCEPProtocolViolationException
{
	super(bytes);
	ResponseList = new LinkedList<Response>();
	decode();

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

示例4: ComputingResponse

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
/**
 * Construct new PCEP Request from scratch
 */
public ComputingResponse()
{
	super();
	ResponseList=new LinkedList<Response>();
	ReportList = new LinkedList<StateReport>();
}
 
开发者ID:telefonicaid,项目名称:netphony-pce,代码行数:10,代码来源:ComputingResponse.java

示例5: sendNoPath

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
private ComputingResponse sendNoPath(Response response, ComputingResponse m_resp)
{
	log.warn("Big Warning: Source or destination are NOT in the TED, sending NO PATH");
	NoPath noPath= new NoPath();
	noPath.setNatureOfIssue(ObjectParameters.NOPATH_NOPATH_SAT_CONSTRAINTS);
	NoPathTLV noPathTLV=new NoPathTLV();
	
	noPathTLV.setUnknownSource(true);	
	noPathTLV.setUnknownDestination(true);	

	noPath.setNoPathTLV(noPathTLV);				
	response.setNoPath(noPath);
	return m_resp;
}
 
开发者ID:telefonicaid,项目名称:netphony-pce,代码行数:15,代码来源:VLAN_Multicast_algorithm.java

示例6: getPcepResponse

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
public Response getPcepResponse() {
	return pcepResponse;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:4,代码来源:LSPTE.java

示例7: setPcepResponse

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
public void setPcepResponse(Response pcepResponse) {
	this.pcepResponse = pcepResponse;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:4,代码来源:LSPTE.java

示例8: calculateTimeToSendRequest

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
public Long calculateTimeToSendRequest(Response response){
	Long time = (long) 0;
	Inet4Address src=null;
	Inet4Address dst=null;
	boolean addDelay=true;
	
	
	//Mirar el retardo desde el enlace donde esta el fallo hasta el origen.  
	LinkedList<EROSubobject>  eroSubObjList = response.getPath(0).geteRO().getEROSubobjectList();
	for (int i=0; i<eroSubObjList.size()-1;i++){			
		if (eroSubObjList.get(i).getType()==SubObjectValues.ERO_SUBOBJECT_IPV4PREFIX){
			src= ((IPv4prefixEROSubobject)eroSubObjList.get(i)).getIpv4address();
			if (sourceDisconnected.equals(((IPv4prefixEROSubobject)eroSubObjList.get(i)).getIpv4address())){					
				addDelay=false;
			}						
		}else if (eroSubObjList.get(i).getType()==SubObjectValues.ERO_SUBOBJECT_UNNUMBERED_IF_ID){
			src = ((UnnumberIfIDEROSubobject)eroSubObjList.get(i)).getRouterID();
			if (sourceDisconnected.equals(((UnnumberIfIDEROSubobject)eroSubObjList.get(i)).getRouterID())){
				addDelay=false;
			}				
			
		}
		if (eroSubObjList.get(i+1).getType()==SubObjectValues.ERO_SUBOBJECT_IPV4PREFIX){
			dst = ((IPv4prefixEROSubobject)eroSubObjList.get(i+1)).getIpv4address();				
		}else if (eroSubObjList.get(i+1).getType()==SubObjectValues.ERO_SUBOBJECT_UNNUMBERED_IF_ID){
			dst= ((UnnumberIfIDEROSubobject)eroSubObjList.get(i+1)).getRouterID();				
		}else if (eroSubObjList.get(i+1).getType()==SubObjectValues.ERO_SUBOBJECT_LABEL){

			if (eroSubObjList.get(i+2).getType()==SubObjectValues.ERO_SUBOBJECT_IPV4PREFIX){
				dst = ((IPv4prefixEROSubobject)eroSubObjList.get(i+2)).getIpv4address();					
			}else if (eroSubObjList.get(i+2).getType()==SubObjectValues.ERO_SUBOBJECT_UNNUMBERED_IF_ID){
				dst = ((UnnumberIfIDEROSubobject)eroSubObjList.get(i+2)).getRouterID();				
			}
		}
		if (addDelay){
			IntraDomainEdge edge=((SimpleTEDB)networkLSPManager.getDomainTEDB()).getNetworkGraph().getEdge(src, dst);				
			if ( edge.getDelay_ms() !=0){
				time = (long) (time+ edge.getDelay_ms());
			}
			else {
				time = (long) (time+ 1);
				}
			}
	}
		
	return time;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:48,代码来源:DisconnectingLinkTask.java

示例9: calculateRequest

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
public PCEPRequest calculateRequest(Response response){	
	Inet4Address initialSrc=null;
	Inet4Address finalDst=null;
	PCEPRequest request = null;
	
	//Mirar el retardo desde el enlace donde esta el fallo hasta el origen.  
	LinkedList<EROSubobject>  eroSubObjList = response.getPath(0).geteRO().getEROSubobjectList();
	for (int i=0; i<eroSubObjList.size()-1;i++){			
		if (eroSubObjList.get(i).getType()==SubObjectValues.ERO_SUBOBJECT_IPV4PREFIX){				
			if (i==0){
				initialSrc=((IPv4prefixEROSubobject)eroSubObjList.get(i)).getIpv4address();
			}
		}else if (eroSubObjList.get(i).getType()==SubObjectValues.ERO_SUBOBJECT_UNNUMBERED_IF_ID){						
			if (i==0){
				initialSrc=((UnnumberIfIDEROSubobject)eroSubObjList.get(i)).getRouterID();
			}
		}
		if (eroSubObjList.get(i+1).getType()==SubObjectValues.ERO_SUBOBJECT_IPV4PREFIX){
			if (i==(eroSubObjList.size()-2)){
				finalDst=((IPv4prefixEROSubobject)eroSubObjList.get(i+1)).getIpv4address();
			}

		}else if (eroSubObjList.get(i+1).getType()==SubObjectValues.ERO_SUBOBJECT_UNNUMBERED_IF_ID){
			if (i==(eroSubObjList.size()-2)){
				finalDst=((UnnumberIfIDEROSubobject)eroSubObjList.get(i+1)).getRouterID();
			}
		}else if (eroSubObjList.get(i+1).getType()==SubObjectValues.ERO_SUBOBJECT_LABEL){

			if (eroSubObjList.get(i+2).getType()==SubObjectValues.ERO_SUBOBJECT_IPV4PREFIX){
				if (i==(eroSubObjList.size()-3)){
					finalDst=((IPv4prefixEROSubobject)eroSubObjList.get(i+2)).getIpv4address();
				}
			}else if (eroSubObjList.get(i+2).getType()==SubObjectValues.ERO_SUBOBJECT_UNNUMBERED_IF_ID){
				
				if (i==(eroSubObjList.size()-3)){
					finalDst=((UnnumberIfIDEROSubobject)eroSubObjList.get(i+2)).getRouterID();
				}
			}
		}			
	}
		request= createPCEPRequestMessage(initialSrc,finalDst);

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

示例10: getResponse

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
public Response getResponse() {
	return response;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:4,代码来源:RestorationCaseTable.java

示例11: setResponse

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
public void setResponse(Response response) {
	this.response = response;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:4,代码来源:RestorationCaseTable.java

示例12: addResponse

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
public void addResponse(Response response){		
	this.ResponseList.add(response);
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:4,代码来源:PCEPResponse.java

示例13: getResponse

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
public Response getResponse(int index){
	return this.ResponseList.get(index);
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:4,代码来源:PCEPResponse.java

示例14: getResponseList

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
public LinkedList<Response> getResponseList() {
	return ResponseList;
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:4,代码来源:PCEPResponse.java

示例15: setResponsetList

import es.tid.pce.pcep.constructs.Response; //导入依赖的package包/类
public void setResponsetList(LinkedList<Response> responseList) {
	ResponseList = responseList;
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:4,代码来源:PCEPResponse.java


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