Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r5884 - in trunk/perfsonar_base/src/main/java/org/perfsonar/base: . nmwg nmwg/owamp

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/ps-java-services] r5884 - in trunk/perfsonar_base/src/main/java/org/perfsonar/base: . nmwg nmwg/owamp


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/ps-java-services] r5884 - in trunk/perfsonar_base/src/main/java/org/perfsonar/base: . nmwg nmwg/owamp
  • Date: Thu, 6 Oct 2011 16:43:15 +0100 (BST)

Author: psnc.pikusa
Date: 2011-10-06 16:43:14 +0100 (Thu, 06 Oct 2011)
New Revision: 5884

Added:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/nmwg/
trunk/perfsonar_base/src/main/java/org/perfsonar/base/nmwg/owamp/

trunk/perfsonar_base/src/main/java/org/perfsonar/base/nmwg/owamp/Parameters.java
Log:
Initial commit of a the class that is used to gather owamp:parameters

Added:
trunk/perfsonar_base/src/main/java/org/perfsonar/base/nmwg/owamp/Parameters.java
===================================================================
---
trunk/perfsonar_base/src/main/java/org/perfsonar/base/nmwg/owamp/Parameters.java
(rev 0)
+++
trunk/perfsonar_base/src/main/java/org/perfsonar/base/nmwg/owamp/Parameters.java
2011-10-06 15:43:14 UTC (rev 5884)
@@ -0,0 +1,141 @@
+/**
+ * Describes the basic format of the ping parameters.
+ *
+ * @author Martin Swany
+ * @author Jason Zurawski
+ * @author Piotr Pikusa
+ * @version $Id$
+ * @see org.ggf.ns.nmwg.base.v2_0.Element
+ * @see org.ggf.ns.nmwg.base.v2_0.Parameter
+ * @see org.w3c.dom.Document
+ * @see org.w3c.dom.Element
+ */
+package org.perfsonar.base.nmwg.owamp;
+
+import org.ggf.ns.nmwg.base.v2_0.Parameter;
+
+public class Parameters extends org.ggf.ns.nmwg.base.v2_0.Parameters {
+
+ /**
+ * Constructor.
+ */
+ public Parameters() {
+ parent = null;
+ id = "";
+ completed = false;
+
+ localName = "parameters";
+ uri = "http://ggf.org/ns/nmwg/tools/owamp/2.0/";;
+ qName = "owamp:parameters";
+ prefix = "owamp";
+ fileName = "org/ggf/ns/nmwg/tools/owamp/v2_0/Parameters.java";
+ }
+
+ /**
+ * Return parameter by name.
+ */
+ public Parameter getParameterByName(String name) {
+ if(!(name.equals(""))) {
+ if(name.equals("count") ||
+ name.equals("dscp") ||
+ name.equals("phb") ||
+ name.equals("wait") ||
+ name.equals("timeOut") ||
+ name.equals("padding") ||
+ name.equals("endDelay") ||
+ name.equals("portRange") ||
+ name.equals("size") ||
+ name.equals("output") ||
+ name.equals("direction")) {

+ Parameter p = new Parameter();
+ p = (Parameter)parameterMap.get(name);
+ return(p);
+ }
+ else {
+ System.err.println("Error: " + getFileName()
+
+ "
'getParameterByName(String)' Unrecognized " +
+ " parameter: "+name+".");
+ return null;
+ }
+ }
+ else {
+ System.err.println("Error: " + getFileName() +
+ " 'getParameterByName(String)' name
cannont be nil.");
+ return null;
+ }
+ }
+
+ /**
+ * Adds a parameter to the map
+ */
+ public void addParameter(Parameter newParameter) {
+ if(newParameter != null) {
+ if(newParameter.getParameterName().equals("count") ||
+
newParameter.getParameterName().equals("dscp") ||
+
newParameter.getParameterName().equals("phb") ||
+
newParameter.getParameterName().equals("wait") ||
+
newParameter.getParameterName().equals("timeOut") ||
+
newParameter.getParameterName().equals("padding") ||
+
newParameter.getParameterName().equals("direction") ||
+
newParameter.getParameterName().equals("size") ||
+
newParameter.getParameterName().equals("output") ||
+
newParameter.getParameterName().equals("portRange") ||
+
newParameter.getParameterName().equals("endDelay")) {
+
if(getParameterByName(newParameter.getParameterName())!=null){
+ System.err.println("Error: " +
getFileName() +
+ "
'setParameter(Parameter)' Duplicate parameter" +
+ " name: " +
newParameter.getParameterName() +
+ " for id: " +
newParameter.getId());
+ return;
+ }
+
parameterMap.put(newParameter.getParameterName(),newParameter);
+ }
+ else {
+ System.err.println("Error: " + getFileName()
+
+ " 'addParameter(Parameter)'
Unrecognized " +
+ " parameter:
"+newParameter.getParameterName()+".");
+ return;
+ }
+ }
+ else {
+ System.err.println("Error: " + getFileName() +
+ " 'addParameter(Paramter)' Parameter cannont be
nil.");
+ return;
+ }
+ }
+
+ public void addParameter(String name, String value) {
+ if(!(name.equals("")) && !(value.equals(""))) {
+ if(name.equals("count") ||
+ name.equals("dscp") ||
+ name.equals("phb") ||
+ name.equals("wait") ||
+ name.equals("timeOut") ||
+ name.equals("padding") ||
+ name.equals("endDelay") ||
+ name.equals("portRange") ||
+ name.equals("size") ||
+ name.equals("output") ||
+ name.equals("direction")) {
+ Parameter p = new Parameter();
+ p.setParameterName(name);
+ p.setParameterValue(value);
+ this.addParameter(p);
+ }
+ else {
+ System.err.println("Error: " + getFileName()
+
+ " 'addParameter(String,
String)' Unrecognized " +
+ " parameter: "+name+".");
+ return;
+ }
+ }
+ else {
+ System.err.println("Error: " + getFileName() +
+ " 'addParameter(String, String)'
cannot have nil value" +
+ " for name or value.");
+ return;
+ }
+ }
+
+}
+



  • [pS-dev] [GEANT/SA2/ps-java-services] r5884 - in trunk/perfsonar_base/src/main/java/org/perfsonar/base: . nmwg nmwg/owamp, svn-noreply, 10/06/2011

Archive powered by MHonArc 2.6.16.

Top of Page