perfsonar-dev - perfsonar: r2859 - in branches/SSHTelnet-MP-STABLE: . ant ant/ssh conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/commands
Subject: perfsonar development work
List archive
perfsonar: r2859 - in branches/SSHTelnet-MP-STABLE: . ant ant/ssh conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/commands
Chronological Thread
- From:
- To:
- Subject: perfsonar: r2859 - in branches/SSHTelnet-MP-STABLE: . ant ant/ssh conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/commands
- Date: Fri, 21 Sep 2007 10:12:03 -0400
Author: melis
Date: 2007-09-21 10:12:03 -0400 (Fri, 21 Sep 2007)
New Revision: 2859
Modified:
branches/SSHTelnet-MP-STABLE/.classpath
branches/SSHTelnet-MP-STABLE/ant/const.properties
branches/SSHTelnet-MP-STABLE/ant/ssh/sshtelnetMP-pre-install-targets.xml
branches/SSHTelnet-MP-STABLE/conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.class
branches/SSHTelnet-MP-STABLE/src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.java
branches/SSHTelnet-MP-STABLE/src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/commands/ParameterChecker.java
Log:
fixed the regular expressions bug
Modified: branches/SSHTelnet-MP-STABLE/.classpath
===================================================================
--- branches/SSHTelnet-MP-STABLE/.classpath 2007-09-21 04:36:12 UTC (rev
2858)
+++ branches/SSHTelnet-MP-STABLE/.classpath 2007-09-21 14:12:03 UTC (rev
2859)
@@ -10,5 +10,5 @@
<classpathentry kind="lib" path="lib/remote/jsch-0.1.25.jar"/>
<classpathentry kind="lib" path="lib/remote/jta20.jar"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="conf"/>
+ <classpathentry kind="output" path="build"/>
</classpath>
Modified: branches/SSHTelnet-MP-STABLE/ant/const.properties
===================================================================
--- branches/SSHTelnet-MP-STABLE/ant/const.properties 2007-09-21 04:36:12
UTC (rev 2858)
+++ branches/SSHTelnet-MP-STABLE/ant/const.properties 2007-09-21 14:12:03
UTC (rev 2859)
@@ -1,22 +1,22 @@
-#This file was created by the Ant configuration script.
-#Wed Aug 01 18:54:23 CEST 2007
-package.root=org/perfsonar
-target.port=8080
-api.windowtitle=perfSONAR
-release.basename=perfSONAR
-deploy.root=perfSONAR-SSHTelnet-MP-1.2
-service.name=JAVA-SSHTELNET-MP-1.2
-api.bottom=JRA1 GEANT2 Project
-wsdd.path=org/perfsonar/service/web/wsdd
-release.servicename=perfSONAR-SSHTelnet-MP-1.2
-build=build
-api.title=perfSONAR
-tomcat.home=/opt/apache-tomcat-5.5.20
-wsdd.home=service/web/wsdd
-package.nmwg.root=org/ggf
-api.location=doc/api
-wsdd.file.undeploy=sshtelnetmp-service-undeploy.wsdd
-webservice.name=MeasurementPointService
-release.version=1.2
-target.server=localhost
-wsdd.file.deploy=sshtelnetmp-service-deploy.wsdd
+#This file was created by the Ant configuration script.
+#Thu Sep 20 16:31:39 CEST 2007
+package.root=org/perfsonar
+target.port=8080
+api.windowtitle=perfSONAR
+release.basename=perfSONAR
+deploy.root=perfSONAR-SSHTelnet-MP-1.2.1_RC1
+service.name=JAVA-SSHTELNET-MP-1.2.1_RC1
+api.bottom=JRA1 GEANT2 Project
+wsdd.path=org/perfsonar/service/web/wsdd
+release.servicename=perfSONAR-SSHTelnet-MP-1.2.1_RC1
+build=build
+api.title=perfSONAR
+tomcat.home=/opt/apache-tomcat-5.5.20
+wsdd.home=service/web/wsdd
+package.nmwg.root=org/ggf
+api.location=doc/api
+wsdd.file.undeploy=sshtelnetmp-service-undeploy.wsdd
+webservice.name=MeasurementPointService
+release.version=1.2.1_RC1
+target.server=localhost
+wsdd.file.deploy=sshtelnetmp-service-deploy.wsdd
Modified:
branches/SSHTelnet-MP-STABLE/ant/ssh/sshtelnetMP-pre-install-targets.xml
===================================================================
--- branches/SSHTelnet-MP-STABLE/ant/ssh/sshtelnetMP-pre-install-targets.xml
2007-09-21 04:36:12 UTC (rev 2858)
+++ branches/SSHTelnet-MP-STABLE/ant/ssh/sshtelnetMP-pre-install-targets.xml
2007-09-21 14:12:03 UTC (rev 2859)
@@ -17,7 +17,7 @@
<project name="sshtelnetmp-pre-install-targets">
- <property name="service.name" value="JAVA-SSHTELNET-MP-1.2" />
+ <property name="service.name" value="JAVA-SSHTELNET-MP-1.2.1_RC1" />
<property file="ant/const.properties" />
Modified:
branches/SSHTelnet-MP-STABLE/conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.class
===================================================================
(Binary files differ)
Modified:
branches/SSHTelnet-MP-STABLE/src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.java
===================================================================
---
branches/SSHTelnet-MP-STABLE/src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.java
2007-09-21 04:36:12 UTC (rev 2858)
+++
branches/SSHTelnet-MP-STABLE/src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.java
2007-09-21 14:12:03 UTC (rev 2859)
@@ -145,8 +145,8 @@
String device;
String deviceType;
-
- for (int i=0; i<lines.length; i++){
+ String[] devicesArray = new String[lines.length];
+ for (int i=0; i<lines.length && lines[i] != null;
i++){
//System.out.println(" Writing: Line
"+(i+1)+": "+lines[i]);
//out.write("Line "+(i+1)+":
"+lines[i]+"\n");
tok = new StringTokenizer(lines[i],"%%%");
@@ -155,6 +155,7 @@
deviceInfo = tok.nextToken();
deviceTok = new
StringTokenizer(deviceInfo,"@@@");
device = deviceTok.nextToken();
+ devicesArray[i] = device;
deviceType = deviceTok.nextToken();
if
(deviceType.equalsIgnoreCase("quaggatelnet")) {
out.write("service.mp."+ device
@@ -164,9 +165,10 @@
out.write("service.r.mp." + device +
".prompt=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".rate=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".password=" + deviceTok.nextToken() + "\n");
- out.write("service.r.mp." + device +
"bgp.port=" + deviceTok.nextToken() + "\n");
- out.write("service.r.mp." + device +
"bgp.prompt=" + deviceTok.nextToken() + "\n");
- out.write("service.r.mp." + device +
"bgp.password=" + deviceTok.nextToken() + "\n");
+ out.write("service.r.mp." + device +
".bgp.port=" + deviceTok.nextToken() + "\n");
+ out.write("service.r.mp." + device +
".bgp.prompt=" + deviceTok.nextToken() + "\n");
+ out.write("service.r.mp." + device +
".bgp.password=" + deviceTok.nextToken() + "\n");
+ out.write("service.r.mp." + device +
".cache=0\n");
} else if
(deviceType.equalsIgnoreCase("ciscotelnet")) {
out.write("service.mp."+ device
+
".class_name=org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.CiscoAdapter\n");
@@ -176,6 +178,7 @@
out.write("service.r.mp." + device +
".rate=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".username=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".password=" + deviceTok.nextToken() + "\n");
+ out.write("service.r.mp." + device +
".cache=0\n");
} else if
(deviceType.equalsIgnoreCase("ciscossh")) {
out.write("service.mp."+ device
+
".class_name=org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.CiscoSshAdapter\n");
@@ -185,6 +188,7 @@
out.write("service.r.mp." + device +
".rate=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".username=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".password=" + deviceTok.nextToken() + "\n");
+ out.write("service.r.mp." + device +
".cache=0\n");
} else if
(deviceType.equalsIgnoreCase("ciscokey")) {
out.write("service.mp."+ device
+
".class_name=org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.CiscoKeyAdapter\n");
@@ -194,6 +198,7 @@
out.write("service.r.mp." + device +
".rate=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".username=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".keyUrl=" + deviceTok.nextToken() + "\n");
+ out.write("service.r.mp." + device +
".cache=0\n");
} else if
(deviceType.equalsIgnoreCase("junipertelnet")) {
out.write("service.mp."+ device
+
".class_name=org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.JuniperAdapter\n");
@@ -203,6 +208,7 @@
out.write("service.r.mp." + device +
".rate=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".username=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".password=" + deviceTok.nextToken() + "\n");
+ out.write("service.r.mp." + device +
".cache=0\n");
} else if
(deviceType.equalsIgnoreCase("juniperssh")) {
out.write("service.mp."+ device
+
".class_name=org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.JuniperSshAdapter\n");
@@ -212,6 +218,7 @@
out.write("service.r.mp." + device +
".rate=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".username=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".password=" + deviceTok.nextToken() + "\n");
+ out.write("service.r.mp." + device +
".cache=0\n");
} else if
(deviceType.equalsIgnoreCase("juniperkey")) {
out.write("service.mp."+ device
+
".class_name=org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.JuniperKeyAdapter\n");
@@ -221,6 +228,7 @@
out.write("service.r.mp." + device +
".rate=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".username=" + deviceTok.nextToken() + "\n");
out.write("service.r.mp." + device +
".keyUrl=" + deviceTok.nextToken() + "\n");
+ out.write("service.r.mp." + device +
".cache=0\n");
} else {
System.out.println("There was an
unknown device type in the csv file: "+deviceType);
@@ -241,7 +249,13 @@
//Then use this temporary file for writing
all command info
addSelectedCommandsToConfig(device,
outputFile, tempFile.toString());
}
-
+
+ out.write("service.mp.devices=");
+ String tmp = "";
+ for (int i=0; i<devicesArray.length &&
devicesArray[i] != null ; i++){
+ tmp += devicesArray[i]+",";
+ }
+ out.write(tmp.substring(0,tmp.length()-1));
out.close();
} catch (IOException e) {
e.printStackTrace();
Modified:
branches/SSHTelnet-MP-STABLE/src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/commands/ParameterChecker.java
===================================================================
---
branches/SSHTelnet-MP-STABLE/src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/commands/ParameterChecker.java
2007-09-21 04:36:12 UTC (rev 2858)
+++
branches/SSHTelnet-MP-STABLE/src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/commands/ParameterChecker.java
2007-09-21 14:12:03 UTC (rev 2859)
@@ -36,8 +36,8 @@
public boolean checkParam(String subject, String eventTypeString,
String parameter) {
+
-
try {
Class c =
Class.forName("org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands."+subject+"Checker");
return
((Boolean)c.getDeclaredMethods()[0].invoke(c.newInstance(), new Object[]
{subject, eventTypeString, parameter})).booleanValue();
@@ -57,28 +57,30 @@
properties =
(PropertiesConfigurationComponent)AuxiliaryComponentManager.
getInstance().getComponent(ComponentNames.CONFIG);
-
- StringTokenizer disjunct = new
StringTokenizer(properties.getProperty("service.mp."+subject+".commands."+eventTypeString+".regex"),
"#");
+ String regularExpressions =
properties.getProperty("service.mp."+subject+".commands."+eventTypeString+".regex");
+ System.out.println("Regular Expressions for command "
+ eventTypeString + ": "+regularExpressions);
+ StringTokenizer disjunct = new
StringTokenizer(regularExpressions, "#");
while (disjunct.hasMoreTokens() && !ok) {
String disjunctToken = disjunct.nextToken();
- StringTokenizer tokenizer = new
StringTokenizer (disjunctToken, ","); // get property
+ StringTokenizer tokenizer = new
StringTokenizer (disjunctToken, ";"); // get property
ok = true;
while (tokenizer.hasMoreTokens() && ok) {
String token = tokenizer.nextToken();
- // System.out.println("pattern: " +
token);
- // System.out.println("parameter: " +
parameter);
+ System.out.println("pattern: " +
token);
+ System.out.println("parameter: " +
parameter);
Pattern pattern =
Pattern.compile(token);
Matcher matcher =
pattern.matcher(parameter);
ok = matcher.find();
- // System.out.println("OK: " + ok);
+ System.out.println("OK: " + ok);
}
}
} catch (SystemException e1) {
+ e1.printStackTrace();
}
return ok;
- perfsonar: r2859 - in branches/SSHTelnet-MP-STABLE: . ant ant/ssh conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/org/perfsonar/service/measurementPoint/lookingGlassType/engine/commands, svnlog, 09/21/2007
Archive powered by MHonArc 2.6.16.