
es.tid.pce.client.multiLayer.AutomaticTesterMLNetworkTask Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of network-emulator Show documentation
Show all versions of network-emulator Show documentation
Emulator of GMPLS-controlled transport Network
The newest version!
package es.tid.pce.client.multiLayer;
import java.io.BufferedWriter;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.TimerTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import es.tid.emulator.node.transport.EmulatedPCCPCEPSession;
import es.tid.pce.client.ClientRequestManager;
import es.tid.pce.pcep.PCEPProtocolViolationException;
import es.tid.pce.pcep.constructs.Path;
import es.tid.pce.pcep.messages.PCEPRequest;
import es.tid.pce.pcep.messages.PCEPResponse;
import es.tid.pce.pcep.messages.PCEPTELinkSuggestion;
import es.tid.pce.pcep.objects.ExplicitRouteObject;
import es.tid.rsvp.objects.subobjects.EROSubobject;
import es.tid.rsvp.objects.subobjects.IPv4prefixEROSubobject;
import es.tid.rsvp.objects.subobjects.SubObjectValues;
public class AutomaticTesterMLNetworkTask extends TimerTask {
private ClientRequestManager crm;
private Logger log;
static long requestID=123;
private EmulatedPCCPCEPSession psVNTM;
/*Variable used for counter how many requests there are*/
PCEPRequest request;
public AutomaticTesterMLNetworkTask(PCEPRequest request,EmulatedPCCPCEPSession ps,EmulatedPCCPCEPSession psVNTM ){
this.request = request;
log=LoggerFactory.getLogger("PCCClient");
this.crm=ps.crm;
this.psVNTM=psVNTM;
}
@Override
public void run() {
log.info("Starting Automatic Client Interface");
PCEPResponse pr;
request.getRequestList().getFirst().getRequestParameters().setRequestID(requestID);
requestID=requestID+1;
pr=crm.newRequest(this.request);
System.out.println("Respuesta "+pr.toString());
String strPrev=null;
if (pr.getResponseList().isEmpty()){
System.out.println("ERROR");
return;
}else {
if (pr.getResponseList().get(0).getNoPath()!=null){
System.out.println("NO PATH");
return;
}else {
Path path=pr.getResponseList().get(0).getPath(0);
ExplicitRouteObject ero=path.geteRO();
LinkedList eroSubObjList=ero.getEROSubobjectList();
boolean layerInfoFound=false;
int numNewLinks=0;
ArrayList sourceList = new ArrayList();
ArrayList destinationList = new ArrayList();
//cREAR LISTA DE EROS
LinkedList eroList=new LinkedList();
LinkedList eroSubObjList2=null;
int counterArray=0;
for (int i=0;i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy