Skip to Content.
Sympa Menu

perfsonar-dev - r2148 - branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools

Subject: perfsonar development work

List archive

r2148 - branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools


Chronological Thread 
  • From:
  • To:
  • Subject: r2148 - branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools
  • Date: Tue, 27 Feb 2007 07:56:12 -0500

Author: fernandes
Date: 2007-02-27 07:56:12 -0500 (Tue, 27 Feb 2007)
New Revision: 2148

Modified:

branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Bwctl.java

branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Owamp.java

branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Ping.java

branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Traceroute.java
Log:
Fixed bugs 159 and 165.

Modified:
branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Bwctl.java
===================================================================
---
branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Bwctl.java
2007-02-27 12:50:16 UTC (rev 2147)
+++
branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Bwctl.java
2007-02-27 12:56:12 UTC (rev 2148)
@@ -132,15 +132,40 @@

org.ggf.ns.nmwg.tools.bwctl.v2_0.Subject sub =
(org.ggf.ns.nmwg.tools.bwctl.v2_0.Subject) subject.getSubject();
+
+ if (sub == null){
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The request message metadata must have a subject
element with " +
+ "an endPointPair element. The endPointPair element must
have at" +
+ " least a dst element."
+ );
+ }
+
org.ggf.ns.nmwg.topology.v2_0.EndPointPair end =
sub.getEndPointPair();
+
+ if (end == null){
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The request message must have an endPointPair element
inside " +
+ "the subject element of its metadata. The endPointPair
element" +
+ " must have at least a dst element."
+ );
+ }
+
org.ggf.ns.nmwg.topology.v2_0.Dst dst = end.getDestinationElement();
org.ggf.ns.nmwg.topology.v2_0.Src src = end.getSourceElement();

//String tmpFolder = System.getProperty("java.io.tmpdir");

- Parameters params = subject.getParameters();
+ Parameters params = subject.getParameters();
Parameter p = null;

+ if (params == null){
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The request message metadata must have a parameters
element. If " +
+ "no parameters are wanted, an empty parameters element
must exist."
+ );
+ }
+
/*
* Build cmd array
*/
@@ -174,7 +199,10 @@

// Check for dst addr
if(dst == null){
- //TODO: throw request exception
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The endPointPair element must have at least a
dst element. " +
+ "The dst element informs the destination IP
address."
+ );
}
else{
if (dst.getPort().length() > 0) {
@@ -475,9 +503,25 @@

datumList[idxDatumList].add(datum);
}
}
- } catch (IOException e) {
- }
-
+ } catch (IOException e) {
+ logger.debug(
+ CNAME + ": IOException
ocurred while processing response. " +
+ "Related files: "+ os.getName() + "
and "+ es.getName()
+ );
+ throw new
SystemException("error.mp.clmp.system.ioexception.bwctl",
+ "An error ocurred while trying to parse
the results of the request. Please try again. " +
+ "If this problem persists, contact the
service administrator."
+ );
+ }
+
+ try {
+ File tmp = new File(line);
+ if (tmp != null){
+ tmp.delete();
+ }
+ }catch(Exception e){
+
+ }
}
}
br.close();
@@ -490,9 +534,9 @@
CNAME + ": IOException ocurred while
processing response. " +
"Related files: "+ os.getName() + " and "+
es.getName()
);
- throw new SystemException("error.mp.clmp.system.tool_response",
- "an error ocurred while trying to process the response
for the request.",
- ioe
+ throw new
SystemException("error.mp.clmp.system.ioexception.bwctl",
+ "An error ocurred while trying to parse the results of
the request. Please try again. " +
+ "If this problem persists, contact the service
administrator."
);
}

@@ -537,12 +581,9 @@
toolOptions.put("dynamicWindowSize","-W:");
toolOptions.put("concurrentConnections","-P:");
toolOptions.put("tos","-S:");
+ toolOptions.put("unsynchronized","-a:novalue");
toolOptions.put("bandwidth","-b:");
toolOptions.put("duration","-t:");
- toolOptions.put("sessionInterval","-I:");
- toolOptions.put("testNumber","-n:");
- toolOptions.put("randomize","-R:");
- toolOptions.put("latestDelay","-L:");

}
}

Modified:
branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Owamp.java
===================================================================
---
branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Owamp.java
2007-02-27 12:50:16 UTC (rev 2147)
+++
branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Owamp.java
2007-02-27 12:56:12 UTC (rev 2148)
@@ -98,13 +98,38 @@

org.ggf.ns.nmwg.tools.owamp.v2_0.Subject sub =
(org.ggf.ns.nmwg.tools.owamp.v2_0.Subject) mdArr[0].getSubject();
+
+ if (sub == null){
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The request message metadata must have a subject
element with " +
+ "an endPointPair element. The endPointPair element must
have at" +
+ " least a dst element."
+ );
+ }
+
org.ggf.ns.nmwg.topology.v2_0.EndPointPair end =
sub.getEndPointPair();
+
+ if (end == null){
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The request message must have an endPointPair element
inside " +
+ "the subject element of its metadata. The endPointPair
element" +
+ " must have at least a dst element."
+ );
+ }
+
org.ggf.ns.nmwg.topology.v2_0.Dst dst = end.getDestinationElement();
org.ggf.ns.nmwg.topology.v2_0.Src src = end.getSourceElement();

Parameters params = mdArr[0].getParameters();
Parameter p = null;

+ if (params == null){
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The request message metadata must have a parameters
element. If " +
+ "no parameters are wanted, an empty parameters element
must exist."
+ );
+ }
+
/*
* Build cmd array
*/
@@ -126,10 +151,11 @@
else if
(p.getParameterValue().toLowerCase().equals("to")) {
cmd.add("-t");
} else
- //throw exception
- ;
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "Parameter direction must be 'from' or
'to'."
+ );
} else {
- //default both directions test
+ cmd.add("-t");
}
}

@@ -137,7 +163,10 @@

// Check for dst addr
if(dst == null){
- //TODO: throw request exception
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The endPointPair element must have at least a
dst element. " +
+ "The dst element informs the destination IP
address."
+ );
}
else{
cmd.add(dst.getValue());
@@ -288,9 +317,9 @@
CNAME + ": IOException ocurred while
processing response. " +
"Related files: "+ os.getName() + " and "+
es.getName()
);
- throw new SystemException("error.mp.clmp.system.tool_response",
- "an error ocurred while trying to process the response
for the request.",
- ioe
+ throw new
SystemException("error.mp.clmp.system.ioexception.owamp",
+ "An error ocurred while trying to parse the results of
the request. Please try again. " +
+ "If this problem persists, contact the service
administrator."
);
}

@@ -327,8 +356,7 @@
toolOptions.put("phb","-H:");
toolOptions.put("wait","-i:");
toolOptions.put("timeOut","-L:");
- toolOptions.put("padding","-s:");
- toolOptions.put("delayStart","-z:");
+ toolOptions.put("padding","-s:");
toolOptions.put("portRange","-P:");
}
}

Modified:
branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Ping.java
===================================================================
---
branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Ping.java
2007-02-27 12:50:16 UTC (rev 2147)
+++
branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Ping.java
2007-02-27 12:56:12 UTC (rev 2148)
@@ -107,13 +107,37 @@

org.ggf.ns.nmwg.tools.ping.v2_0.Subject sub =
(org.ggf.ns.nmwg.tools.ping.v2_0.Subject) mdArr[0].getSubject();
+
+ if (sub == null){
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The request message metadata must have a subject
element with " +
+ "an endPointPair element. The endPointPair element must
have at" +
+ " least a dst element."
+ );
+ }
+
org.ggf.ns.nmwg.topology.v2_0.EndPointPair end =
sub.getEndPointPair();
+
+ if (end == null){
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The request message must have an endPointPair element
inside " +
+ "the subject element of its metadata. The endPointPair
element" +
+ " must have at least a dst element."
+ );
+ }
+
org.ggf.ns.nmwg.topology.v2_0.Dst dst = end.getDestinationElement();
org.ggf.ns.nmwg.topology.v2_0.Src src = end.getSourceElement();

Parameters params = mdArr[0].getParameters();
Parameter p = null;

+ if (params == null){
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The request message metadata must have a parameters
element. If " +
+ "no parameters are wanted, an empty parameters element
must exist."
+ );
+ }
/*
* Build cmd array
*/
@@ -142,7 +166,10 @@

// Check for dst addr
if(dst == null){
- //TODO: throw request exception
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The endPointPair element must have at least a
dst element. " +
+ "The dst element informs the destination IP
address."
+ );
}
else{
cmd.add(dst.getValue());
@@ -286,9 +313,9 @@
CNAME + ": IOException ocurred while
processing response. " +
"Related files: "+ os.getName() + " and "+
es.getName()
);
- throw new SystemException("error.mp.clmp.system.tool_response",
- "an error ocurred while trying to process the response
for the request.",
- ioe
+ throw new
SystemException("error.mp.clmp.system.ioexception.ping",
+ "An error ocurred while trying to parse the results of
the request. Please try again. " +
+ "If this problem persists, contact the service
administrator."
);
}


Modified:
branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Traceroute.java
===================================================================
---
branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Traceroute.java
2007-02-27 12:50:16 UTC (rev 2147)
+++
branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Traceroute.java
2007-02-27 12:56:12 UTC (rev 2148)
@@ -104,12 +104,38 @@

org.ggf.ns.nmwg.tools.traceroute.v2_0.Subject sub =
(org.ggf.ns.nmwg.tools.traceroute.v2_0.Subject)
mdArr[0].getSubject();
+
+ if (sub == null){
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The request message metadata must have a subject
element with " +
+ "an endPointPair element. The endPointPair element must
have at" +
+ " least a dst element."
+ );
+ }
+
org.ggf.ns.nmwg.topology.v2_0.EndPointPair end =
sub.getEndPointPair();
+
+ if (end == null){
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The request message must have an endPointPair element
inside " +
+ "the subject element of its metadata. The endPointPair
element" +
+ " must have at least a dst element."
+ );
+ }
+
org.ggf.ns.nmwg.topology.v2_0.Dst dst = end.getDestinationElement();
org.ggf.ns.nmwg.topology.v2_0.Src src = end.getSourceElement();

Parameters params = mdArr[0].getParameters();
Parameter p = null;
+
+ if (params == null){
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The request message metadata must have a parameters
element. If " +
+ "no parameters are wanted, an empty parameters element
must exist."
+ );
+ }
+
/*
* Build cmd array
*/
@@ -120,16 +146,16 @@
// cmd itself
// TODO: Check config for cmd name
cmd.add("traceroute");
- cmd.add("-n");
- if (OS.indexOf("linux") > -1) {
- cmd.add("-l");
- }
+ cmd.add("-n");

// Check for src addr
cmd = cl.checkParameters(cmd, params, toolOptions);
// Check for dst addr
if(dst == null){
- //TODO: throw request exception
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ "The endPointPair element must have at least a
dst element. " +
+ "The dst element informs the destination IP
address."
+ );
}
else{
cmd.add(dst.getValue());
@@ -265,7 +291,7 @@
throw new
SystemException("error.mp.clmp.system.tool_response",
"The tool returned no response data. This might
be caused by a wrong parameter syntax " +
"or this tool might not be available at the
server."
- );
+ );
}

while( (line = br.readLine()) != null){
@@ -317,9 +343,9 @@
CNAME + ": IOException ocurred while processing
response. " +
"Related files: "+ os.getName() + " and "+
es.getName()
);
- throw new SystemException("error.mp.clmp.system.tool_response",
- "an error ocurred while trying to process the response
for the request.",
- ioe
+ throw new
SystemException("error.mp.clmp.system.ioexception.traceroute",
+ "An error ocurred while trying to parse the results of
the request. Please try again. " +
+ "If this problem persists, contact the service
administrator."
);
}

@@ -354,7 +380,7 @@
* VALUE= string containing [command line option]:[default value
(if any)]
*/
toolOptions.put("firstTtl","-f:");
- toolOptions.put("maxTtl","-m:");
+ toolOptions.put("maxTtl","-m:");
toolOptions.put("waitTime","-w:");
toolOptions.put("pause","-z:");
toolOptions.put("dontFragment","-F:novalue");
@@ -362,5 +388,9 @@
toolOptions.put("port","-p:");
toolOptions.put("tos","-t:");
toolOptions.put("numQueries","-q:3");
+
+ if (OS.indexOf("linux") > -1) {
+ toolOptions.put("displayTtl","-l:novalue");
+ }
}
}



  • r2148 - branches/CL-MP-STABLE/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools, svnlog, 02/27/2007

Archive powered by MHonArc 2.6.16.

Top of Page