本文整理汇总了Java中es.tid.pce.pcep.messages.PCEPRequest.addRequest方法的典型用法代码示例。如果您正苦于以下问题:Java PCEPRequest.addRequest方法的具体用法?Java PCEPRequest.addRequest怎么用?Java PCEPRequest.addRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类es.tid.pce.pcep.messages.PCEPRequest
的用法示例。
在下文中一共展示了PCEPRequest.addRequest方法的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: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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
*/
private 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 = null;
if (testerParams.getRequestToSendList().get(i).getRequestParameters().Is_bandwidth()){
BandwidthRequested bw= new BandwidthRequested();
if (testerParams.getBandwidthMin() != 0){/*Hay que generar el valor de bandwidth aleatorio*/
Random rnd = new Random();
float number = (float)rnd.nextInt((int)testerParams.getBandwidthMax());
while (number < (int)testerParams.getBandwidthMin()){
number = (float)rnd.nextInt((int)testerParams.getBandwidthMax());
}
//float number=BW[(int) stats.getNumRequests()];
if (number>10){ //creamos svec
//System.out.println("Tenemos que dividir en varias peticiones!");
SVECConstruct sveco = new SVECConstruct();
ObjectiveFunction Ofcode = new ObjectiveFunction();
Ofcode.setOFcode(testerParams.getRequestToSendList().get(i).getRequestParameters().getOfCode());
Svec svec = new Svec();
sveco.setObjectiveFunction(Ofcode);
sveco.setSvec(svec);
while (number > 10){
req = createRequest(i);
svec.addRequestID(req.getRequestParameters().getRequestID());
bw.setBw(10);
req.setBandwidth(bw);
p_r.addRequest(req);
number = number - 10;
}
if (number != 0){
req = createRequest(i);
svec.addRequestID(req.getRequestParameters().getRequestID());
bw.setBw(number);
req.setBandwidth(bw);
p_r.addRequest(req);
}
p_r.addSvec(sveco);
}
else{
req = createRequest(i);
bw.setBw(number);
req.setBandwidth(bw);
p_r.addRequest(req);
}
}
else {
req = createRequest(i);
bw.setBw(testerParams.getRequestToSendList().get(i).getRequestParameters().getBW());
req.setBandwidth(bw);
p_r.addRequest(req);
}
}
else {
req = createRequest(i);
p_r.addRequest(req);
}
return p_r;
}
示例7: createPCEPRequestMessage
import es.tid.pce.pcep.messages.PCEPRequest; //导入方法依赖的package包/类
public PCEPRequest createPCEPRequestMessage(Inet4Address source,Inet4Address destination ){
PCEPRequest requestMessage= new PCEPRequest();
requestMessage.addRequest(createRequest(source,destination));
return requestMessage;
}
示例8: 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(){
PCEPRequest p_r = new PCEPRequest();
//Creamos el objecto monitoring
//Monitoring monitoring=createMonitoring();
//Creamos el objeto PCCIdReq
//PccReqId pccReqId = createPccReqId();
//Creamos el object Request
String base="172.10.1.";
int num_nodes=15;
int num_origen=(int) (mt.nextDouble()*num_nodes)+1;
int num_destino=(int) (mt.nextDouble()*(num_nodes-1)+1);
if(num_destino>=num_origen){
num_destino=num_destino+1;
}
String source_s =new String();
source_s=base+ String.valueOf(num_origen)+"0";
String destiny_s = new String();
destiny_s=base+String.valueOf(num_destino)+"0";
System.out.println("source_s "+source_s);
System.out.println("destiny "+destiny_s);
Inet4Address src_ip=null;
Inet4Address dst_ip=null;
try {
src_ip = (Inet4Address) Inet4Address.getByName(source_s);
dst_ip=(Inet4Address) Inet4Address.getByName(destiny_s);
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Request req = createRequest(src_ip,dst_ip);
//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;
}
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:46,代码来源:AutomaticTesterMLNetworkRandomTask.java
示例9: createPCEPRequest
import es.tid.pce.pcep.messages.PCEPRequest; //导入方法依赖的package包/类
private PCEPRequest createPCEPRequest(PCEPInitiate pceInit)
{
PCEPRequest p_r = new PCEPRequest();
try
{
P2MPEndPointsDataPathID eD = (P2MPEndPointsDataPathID)pceInit.getPcepIntiatedLSPList().get(0).getEndPoint();
String source = eD.getSourceDatapathID();
Request req = new Request();
p_r.addRequest(req);
RequestParameters rp= new RequestParameters();
rp.setPbit(true);
rp.setNbit(true);
req.setRequestParameters(rp);
rp.setRequestID(EmulatedPCCPCEPSession.getNewReqIDCounter());
P2MPEndPointsDataPathID ep=new P2MPEndPointsDataPathID();
req.setEndPoints(ep);
ep.setLeafType(1);
ep.setSourceDatapathID(source);
for (int i=0; i < eD.getDestDatapathIDList().size(); i++)
{
ep.getDestDatapathIDList().add(eD.getDestDatapathIDList().get(i));
}
ObjectiveFunction of=new ObjectiveFunction();
of.setOFcode(1004);
req.setObjectiveFunction(of);
BandwidthRequested bandwidth = new BandwidthRequested();
bandwidth.setBw(100);
req.setBandwidth(bandwidth);
return p_r;
}
catch(Exception e)
{
log.info("Exception");
log.info(UtilsFunctions.exceptionToString(e));
return null;
}
}
示例10: main
import es.tid.pce.pcep.messages.PCEPRequest; //导入方法依赖的package包/类
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try{
String ipOpcticSourceString=args[0];
String ipOpticDestString=args[1];
String bandw=args[2];
Inet4Address ipOpcticSource=(Inet4Address) Inet4Address.getByName(ipOpcticSourceString);
Inet4Address ipOpticDest=(Inet4Address) Inet4Address.getByName(ipOpticDestString);
PCEPSessionsInformation pcepSessionManagerPCE=new PCEPSessionsInformation();
EmulatedPCCPCEPSession PCEsession = new EmulatedPCCPCEPSession("localhost", 4189 ,false,pcepSessionManagerPCE);
PCEsession.start();
Thread.currentThread().sleep(1000);
ClientRequestManager crm = PCEsession.crm;
if (PCEsession.getOut()==null)
System.out.println("La salida esta a null, algo raro pasa...");
crm.setDataOutputStream(PCEsession.getOut());
System.out.println("Enviamos de: "+ipOpcticSource+" a "+ipOpticDest);
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(EmulatedPCCPCEPSession.getNewReqIDCounter());
//EndPointsIPv4 ep=new EndPointsIPv4();
EndPointsIPv4 ep= new EndPointsIPv4();
req.setEndPoints(ep);
ep.setSourceIP(ipOpcticSource);
ep.setDestIP(ipOpticDest);
ObjectiveFunction of=new ObjectiveFunction();
of.setOFcode(1200);
req.setObjectiveFunction(of);
float bw = Float.parseFloat(bandw);
BandwidthRequested bandwidth=new BandwidthRequested();
bandwidth.setBw(bw);
req.setBandwidth(bandwidth);
PCEPResponse pr=crm.newRequest(p_r);
System.out.println("OJO!! Respuesta de PCE: "+pr.toString());
}catch (Exception e) {
e.printStackTrace();
}
}
示例11: calculatePathXRO
import es.tid.pce.pcep.messages.PCEPRequest; //导入方法依赖的package包/类
public PCEPResponse calculatePathXRO(String ipSourceString, String ipDestString, float bndwdth, Inet4Address ipXRO, long portXRO) {
log.info("** PCE **");
log.info("Calculating cost between " + ipSourceString + " and " + ipDestString + " whitout " + ipXRO + ":" + portXRO );
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);
/*Metric metric = new Metric();
if (mymetricType == "bandwidth")
metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_BW);
if (mymetricType == "te")
metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_TE_METRIC);
metric.setComputedMetricBit(true);
req.getMetricList().add(metric);*/
BandwidthRequested bandwidth = new BandwidthRequested();
bandwidth.setBw(bndwdth);
req.setBandwidth(bandwidth);
ExcludeRouteObject XRO= new ExcludeRouteObject();
LinkedList<XROSubobject> eROSubobjectList=new LinkedList<XROSubobject>();
UnnumberIfIDXROSubobject xRONode = new UnnumberIfIDXROSubobject();
xRONode.setRouterID(ipXRO);
xRONode.setInterfaceID(portXRO);
eROSubobjectList.add(xRONode);
XRO.setXROSubobjectList(eROSubobjectList);
req.setXro(XRO);
log.info("Path_Computation XRO:: "+req.getXro());
PCEPResponse pr=crm.newRequest(p_r);
log.info("Response from PCE "+pr.toString());
return pr;
}
catch(Exception e){
log.info("Exception");
log.info(UtilsFunctions.exceptionToString(e));
return null;
}
}
示例12: calculateDataPathXRO
import es.tid.pce.pcep.messages.PCEPRequest; //导入方法依赖的package包/类
public PCEPResponse calculateDataPathXRO(String SourceString, String DestString, String dpidXRO, long portXRO, float bndwdth ) {
log.info("** PCE **");
log.info("Calculating cost between " + SourceString + " and " + DestString + " whitout " + dpidXRO + ":" + portXRO );
try{
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());
GeneralizedEndPoints endP = new GeneralizedEndPoints();
EndPointDataPathTLV sourceDataPathTLV = new EndPointDataPathTLV();
EndPointDataPathTLV destDataPathTLV = new EndPointDataPathTLV();
sourceDataPathTLV.setSwitchID(SourceString);
destDataPathTLV.setSwitchID(DestString);
EndPoint sourceEP=new EndPoint();
EndPoint destEP=new EndPoint();
sourceEP.setEndPointDataPathTLV(sourceDataPathTLV);
destEP.setEndPointDataPathTLV(destDataPathTLV);
P2PEndpoints p2pep=new P2PEndpoints();
p2pep.setSourceEndpoint(sourceEP);
p2pep.setDestinationEndPoints(destEP);
endP.setP2PEndpoints(p2pep);
req.setEndPoints(endP);
log.info("req:: "+req.getEndPoints().toString());
ObjectiveFunction of=new ObjectiveFunction();
of.setOFcode(this.ofCode);
req.setObjectiveFunction(of);
BandwidthRequested bandwidth = new BandwidthRequested();
bandwidth.setBw(bndwdth);
req.setBandwidth(bandwidth);
ExcludeRouteObject XRO= new ExcludeRouteObject();
LinkedList<XROSubobject> eROSubobjectList=new LinkedList<XROSubobject>();
DataPathIDXROSubobject xRONode = new DataPathIDXROSubobject();
xRONode.dataPath.setDataPathID(dpidXRO);
eROSubobjectList.add(xRONode);
XRO.setXROSubobjectList(eROSubobjectList);
req.setXro(XRO);
log.info("Path_Computation XRO:: "+req.getXro());
log.info("req: "+req.toString());
PCEPResponse pr=crm.newRequest(p_r);
log.info("Response from PCE "+pr.toString());
return pr;
}
catch(Exception e){
log.info("Exception");
log.info(UtilsFunctions.exceptionToString(e));
return null;
}
}
示例13: testResponse
import es.tid.pce.pcep.messages.PCEPRequest; //导入方法依赖的package包/类
public PCEPResponse testResponse(String ipSourceString, String ipDestString) {
log.info("** PCE **");
log.info("Calculating cost between " + ipSourceString + " and " + ipDestString);
try{
Thread.sleep(1000);
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(EmulatedPCCPCEPSession.getNewReqIDCounter());
EndPointsIPv4 ep=new EndPointsIPv4();
req.setEndPoints(ep);
ep.setSourceIP(ipSource);
ep.setDestIP(ipDest);
ObjectiveFunction of=new ObjectiveFunction();
of.setOFcode(1100);
req.setObjectiveFunction(of);
/*Metric metric = new Metric();
if (mymetricType == "bandwidth")
metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_BW);
if (mymetricType == "te")
metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_TE_METRIC);
metric.setComputedMetricBit(true);
req.getMetricList().add(metric);*/
float bw = 100;
BandwidthRequested bandwidth=new BandwidthRequested();
bandwidth.setBw(bw);
req.setBandwidth(bandwidth);
PCEPResponse pr=crm.newRequest(p_r);
log.info("Response from PCE "+pr.toString());
return pr;
}
catch(Exception e){
return null;
}
}
示例14: test
import es.tid.pce.pcep.messages.PCEPRequest; //导入方法依赖的package包/类
@Test
public void test (){
/*DomainPCEServer pceserver = new DomainPCEServer();
pceserver.configure(this.fileConf);
executor.execute(pceserver);*/
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//Run PCC QuickClient
try{
if(msgSend.length < 4){
assertTrue("Invalid test arguments number (>4)", false);
}
CommandLine optReq = QuickClientObj.getLineOptions(this.msgSend);
Logger log =LoggerFactory.getLogger("PCCClient");
QuickClientObj qcObj = new QuickClientObj(log, msgSend[0], Integer.valueOf(msgSend[1]).intValue());
qcObj.start();
Request req = qcObj.createReqMessage(msgSend[2],msgSend[3], optReq);
PCEPRequest p_r = new PCEPRequest();
p_r.addRequest(req);
LinkedList<PCEPMessage> messageList=new LinkedList<PCEPMessage>();
PCEPResponse res = qcObj.sendReqMessage(p_r, messageList);
this.parseAndCheckRes(res);
}catch(ParseException ex){
assertTrue("Invalid test arguments", false);
}
/*System.out.println("Finalizando PCE Server");
pceserver.stopServer();
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("IntregationTest: Number of active threads: "+executor.getActiveCount());
*/
}
示例15: request4GCO
import es.tid.pce.pcep.messages.PCEPRequest; //导入方法依赖的package包/类
public PCEPResponse request4GCO(String ipSourceString, String ipDestString, int OFCode) {
log.info("** PCE **");
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(OFCode);
req.setObjectiveFunction(of);
/*Metric metric = new Metric();
if (mymetricType == "bandwidth")
metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_BW);
if (mymetricType == "te")
metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_TE_METRIC);
metric.setComputedMetricBit(true);
req.getMetricList().add(metric);*/
float bw = 100;
BandwidthRequested bandwidth=new BandwidthRequested();
bandwidth.setBw(bw);
req.setBandwidth(bandwidth);
PCEPResponse pr=crm.newRequest(p_r);
log.info("Response from PCE "+pr.toString());
return pr;
}
catch(Exception e){
log.info("Exception");
log.info(UtilsFunctions.exceptionToString(e));
return null;
}
}