本文整理汇总了Java中es.tid.pce.pcep.messages.PCEPRequest类的典型用法代码示例。如果您正苦于以下问题:Java PCEPRequest类的具体用法?Java PCEPRequest怎么用?Java PCEPRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PCEPRequest类属于es.tid.pce.pcep.messages包,在下文中一共展示了PCEPRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRequestMessage
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
/**
* Create a PC Request message including Monitoring, PCC-Id-Req and Request
* @param i index of the request
* @return
*/
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(source.get(i),destination.get(i));
ObjectiveFunction of=new ObjectiveFunction();
of.setOFcode(algorithmRuleList.get(0).ar.of);
req.setObjectiveFunction(of);
p_r.setMonitoring(monitoring);
p_r.setPccReqId(pccReqId);
p_r.addRequest(req);
return p_r;
}
示例2: AutomaticExponentialTesterMLNetworkTask
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
public AutomaticExponentialTesterMLNetworkTask(Exponential expSendRequest,Exponential connectionTime, Timer timer,Timer planificationTimer,PCEPRequest request,ClientRequestManager crm,EmulatedPCCPCEPSession psVNTM,AutomaticTesterStatistics stats,PrintWriter pw, PrintWriter apw ){
this.request = request;
log=LoggerFactory.getLogger("PCCClient");
this.crm=crm;
this.psVNTM=psVNTM;
this.expSendRequest=expSendRequest;
this.connectionTime = connectionTime;
this.timer=timer;
this.stats=stats;
this.planificationTimer=planificationTimer;
this.pw=pw;
this.apw=apw;
}
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:14,代码来源:AutomaticExponentialTesterMLNetworkTask.java
示例3: sendRequest
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
synchronized public void sendRequest(PCEPRequest req, Object domain) throws IOException{
try {
req.encode();
} catch (PCEPProtocolViolationException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
DataOutputStream out= domainIdOutputStream.get(domain);
if (out==null){
log.warn("There is no PCE for domain "+domain);
throw new IOException();
}
try {
log.info("Sending Request message to domain "+domain);
out.write(req.getBytes());
out.flush();
} catch (IOException e) {
log.warn("Error sending REQ: " + e.getMessage());
throw e;
}
}
示例4: newRequest
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
/**
* Send new request to the PCE and wait for its response.
* It blocks until a response is received.
* @param pcreq PCEP Request
* @return The PCEP Response
*/
public PCEPResponse newRequest( PCEPRequest pcreq){
log.info("New Request");
Object object_lock=new Object();
long idRequest=pcreq.getRequest(0).getRequestParameters().getRequestID();
log.info("Id request es "+idRequest);
locks.put(new Long(idRequest), object_lock);
sendingQueue.add(pcreq);
synchronized (object_lock) {
try {
log.debug("Request sent, waiting for response");
object_lock.wait(30000);
} catch (InterruptedException e){
// FIXME: Ver que hacer
}
}
log.debug("Request or timeout");
PCEPResponse resp=responses.get(new Long(idRequest));
if (resp==null){
log.warn("NO RESPONSE!!!!!");
}
return resp;
}
示例5: newRequest
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
public ComputingResponse newRequest( PCEPRequest pcreq, long maxTimeMs){
log.info("New Request. Request:"+pcreq.toString());
Object object_lock=new Object();
long idRequest=pcreq.getRequest(0).getRequestParameters().getRequestID();
Long idReqLong=new Long(idRequest);
long timeIni=System.nanoTime();
locks.put(idReqLong, object_lock);
sendRequest(pcreq);
synchronized (object_lock) {
try {
log.debug("Request sent, waiting for response");
log.info("ESPERAREMOS "+maxTimeMs);
object_lock.wait(maxTimeMs);
} catch (InterruptedException e){
// FIXME: Ver que hacer
}
}
long timeIni2=System.nanoTime();
//log.info("Response "+pr.toString());
double reqTime_ms=(timeIni2-timeIni)/1000000;
log.debug("Request or timeout");
ComputingResponse resp=responses.remove(new Long(idRequest));
if (resp==null){
log.warn("NO RESPONSE!!!!! me deshago del lock... con idReqLong "+idRequest);
locks.remove(idReqLong);
}
return resp;
}
示例6: getPCEPRequest
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
@Override
public PCEPRequest getPCEPRequest(LSPTE lspInfo) {
// Meter los campos en función de la petición RequestedLSPinformation
PCEPRequest p_r = new PCEPRequest();
Request req = new Request();
RequestParameters rp= new RequestParameters();
req.setRequestParameters(rp);
rp.setRequestID(EmulatedPCCPCEPSession.getNewReqIDCounter());
rp.setPrio(1);
rp.setBidirect(lspInfo.isBidirectional());
EndPointsIPv4 ep = new EndPointsIPv4();
ep.setSourceIP(lspInfo.getIdSource());
ep.setDestIP(lspInfo.getIdDestination());
req.setEndPoints(ep);
ObjectiveFunction objectiveFunction = new ObjectiveFunction();
objectiveFunction.setOFcode(lspInfo.getOFcode());
req.setObjectiveFunction(objectiveFunction);
BandwidthRequested bandwidth = new BandwidthRequested();
bandwidth.setBw(lspInfo.getBw());
req.setBandwidth(bandwidth);
//Pre Reserva
Reservation reservation = new Reservation();
reservation.setTimer(10000);
req.setReservation(reservation);
p_r.addRequest(req);
return p_r;
}
示例7: getPCEPRequest
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
public PCEPRequest getPCEPRequest(LSPTE lspInfo) {
//Meter los campos de la RequestedLSPinformation
PCEPRequest p_r = new PCEPRequest();
Request req = new Request();
RequestParameters rp= new RequestParameters();
req.setRequestParameters(rp);
rp.setRequestID(EmulatedPCCPCEPSession.getNewReqIDCounter());
rp.setPrio(1);
rp.setBidirect(lspInfo.isBidirectional());
EndPointsIPv4 ep = new EndPointsIPv4();
ep.setSourceIP(lspInfo.getIdSource());
ep.setDestIP(lspInfo.getIdDestination());
req.setEndPoints(ep);
ObjectiveFunction objectiveFunction = new ObjectiveFunction();
objectiveFunction.setOFcode(lspInfo.getOFcode());
//System.out.println("OF code : "+lspInfo.getOFcode());
req.setObjectiveFunction(objectiveFunction);
//Pre Reserva
Reservation reservation = new Reservation();
reservation.setTimer(10000);
req.setReservation(reservation);
p_r.addRequest(req);
return p_r;
}
示例8: run
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
@Override
public void run() {
log.info("Starting Automatic Client Interface");
PCEPResponse pr;
if (PCMonReqBool){
pr=crm.newRequest((PCEPMonReq)this.request);
}else {
pr=crm.newRequest((PCEPRequest)this.request);
requestID++;
}
}
示例9: createRequestMessage
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的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;
}
示例10: calculateRequest
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
public PCEPRequest calculateRequest(int idPath){
PCEPRequest request = null;
RestorationCaseTable restorationCaseTable = findOneRestorationCaseTable(idPath);
if (restorationCaseTable == null){
System.out.println("Error.");
System.exit(3);
}
request= createPCEPRequestMessage(restorationCaseTable.getInitialNodePath(),restorationCaseTable.getFinalNodePath());
return request;
}
示例11: calculatePath
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
public PCEPResponse calculatePath(String ipSourceString, String ipDestString) {
this.log.info("** PCE **");
this.log.info("Calculating cost between " + ipSourceString + " and " + ipDestString);
try
{
Inet4Address ipSource = (Inet4Address)Inet4Address.getByName(ipSourceString);
Inet4Address ipDest = (Inet4Address)Inet4Address.getByName(ipDestString);
PCEPRequest p_r = new PCEPRequest();
Request req = new Request();
p_r.addRequest(req);
RequestParameters rp = new RequestParameters();
rp.setPbit(true);
req.setRequestParameters(rp);
rp.setRequestID(PCCPCEPSession.getNewReqIDCounter());
EndPointsIPv4 ep = new EndPointsIPv4();
req.setEndPoints(ep);
ep.setSourceIP(ipSource);
ep.setDestIP(ipDest);
ObjectiveFunction of = new ObjectiveFunction();
of.setOFcode(this.ofCode);
req.setObjectiveFunction(of);
/*float bw = 100.0F;
Bandwidth bandwidth = new Bandwidth();
bandwidth.setBw(bw);
req.setBandwidth(bandwidth);
*/
PCEPResponse pr = this.crm.newRequest(p_r);
this.log.info("Response from PCE " + pr.toString());
return pr;
}
catch (Exception e) {
this.log.info("Exception");
this.log.info(UtilsFunctions.exceptionToString(e));
}return null;
}
示例12: sendReqMessage
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
public PCEPResponse sendReqMessage(PCEPRequest p_r, LinkedList<PCEPMessage> messageList){
ClientRequestManager crm;
crm=PCEsession.crm;
PCEPResponse pr=crm.newRequest(p_r);
messageList.add(pr);
return pr;
}
示例13: newRequest
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
public PCEPResponse newRequest( PCEPRequest pcreq, long maxTimeMs)
{
log.info("jm dentro de newRequest");
log.info("New Request. Request:"+pcreq.toString());
log.info("pcreq.getRequest(0).getXro(): "+pcreq.getRequest(0).getXro());
Object object_lock=new Object();
long idRequest=pcreq.getRequest(0).getRequestParameters().getRequestID();
Long idReqLong=new Long(idRequest);
long timeIni=System.nanoTime();
locks.put(idReqLong, object_lock);
sendRequest(pcreq);
synchronized (object_lock)
{
try
{
log.info("ESPERAREMOS "+maxTimeMs);
object_lock.wait(maxTimeMs);
}
catch (InterruptedException e)
{
UtilsFunctions.exceptionToString(e);
}
}
long timeIni2=System.nanoTime();
//log.info("Response "+pr.toString());
double reqTime_ms=(timeIni2-timeIni)/1000000;
log.debug("Request or timeout");
PCEPResponse resp=responses.remove(new Long(idRequest));
if (resp==null){
log.warn("NO RESPONSE!!!!! me deshago del lock... con idReqLong "+idRequest);
locks.remove(idReqLong);
}
return resp;
}
示例14: dispathRequests
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
public void dispathRequests(PCEPRequest reqMessage){
if (reqMessage.getSvecList().size()!=0){
for (int i=0;i<reqMessage.getSvecList().size();++i){
}
}
}
示例15: sendRequest
import es.tid.pce.pcep.messages.PCEPRequest; //导入依赖的package包/类
public void sendRequest(PCEPRequest req){
log.debug("Sending Request");
log.info("Sending PCEP Request");
sendPCEPMessage(req);
}