es.tid.util.UtilsFunctions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pce Show documentation
Show all versions of pce Show documentation
Path Computation Element
The newest version!
package es.tid.util;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.LinkedList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.CharacterData;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import es.tid.pce.computingEngine.ComputingResponse;
import es.tid.rsvp.objects.subobjects.EROSubobject;
import es.tid.rsvp.objects.subobjects.GeneralizedLabelEROSubobject;
import es.tid.rsvp.objects.subobjects.SubObjectValues;
public class UtilsFunctions {
public static void printByte(byte[] bytes,String name){
System.out.print(name +": ");
for (int i =0;i erolist=rep.getResponseList().getFirst().getPathList().getFirst().geteRO().getEROSubobjectList();
int size = erolist.size();
for (int i=0;i< size-1;i++){
if (erolist.get(i).getType()==SubObjectValues.ERO_SUBOBJECT_LABEL){
byte [] bytes = (((GeneralizedLabelEROSubobject) erolist.get(i)).getLabel());
int n=((bytes[2]&0xFF)<<8)|(bytes[3]&0xFF);
log.info("lambda devuelta:"+n);
}
}
}
public static void imprimeRespuesta(ComputingResponse rep, Logger log, long id){
LinkedList erolist=rep.getResponseList().getFirst().getPathList().getFirst().geteRO().getEROSubobjectList();
int size = erolist.size();
int n=-1;
boolean noEncontrada=true;
for (int i=0;((i< size-1)&&(noEncontrada));i++){
if (erolist.get(i).getType()==SubObjectValues.ERO_SUBOBJECT_LABEL){
byte [] bytes = (((GeneralizedLabelEROSubobject) erolist.get(i)).getLabel());
n=((bytes[2]&0xFF)<<8)|(bytes[3]&0xFF);
noEncontrada=false;
}
}
log.info("REQUEST - ID: "+ id +" RESPUESTA: "+erolist.toString()+" LAMDBA: "+n);
}
public static void printByte(byte[] bytes,String name, Logger log){
String s= name +": ";
for (int i =0;i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy