perfsonar-dev - perfsonar: r3481 - in branches/geant2_java-sshtelnet-mp-STABLE: ant src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata src/main/java/org/perfsonar/service/measurementPoint/remote/telnet
Subject: perfsonar development work
List archive
perfsonar: r3481 - in branches/geant2_java-sshtelnet-mp-STABLE: ant src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata src/main/java/org/perfsonar/service/measurementPoint/remote/telnet
Chronological Thread
- From:
- To:
- Subject: perfsonar: r3481 - in branches/geant2_java-sshtelnet-mp-STABLE: ant src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata src/main/java/org/perfsonar/service/measurementPoint/remote/telnet
- Date: Thu, 6 Mar 2008 05:26:09 -0500
Author: melis
Date: 2008-03-06 05:26:09 -0500 (Thu, 06 Mar 2008)
New Revision: 3481
Modified:
branches/geant2_java-sshtelnet-mp-STABLE/ant/configure-targets.xml
branches/geant2_java-sshtelnet-mp-STABLE/ant/const.properties
branches/geant2_java-sshtelnet-mp-STABLE/ant/const.properties.template
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoAdapter.java
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/RequestExecutingThread.java
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/WebserviceEngineAdapter.java
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata/DbMetadataConfiguration.java
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/remote/telnet/TelnetManager.java
Log:
added the bug fix for the telnet timeout problem to the stable branch as well
Modified: branches/geant2_java-sshtelnet-mp-STABLE/ant/configure-targets.xml
===================================================================
--- branches/geant2_java-sshtelnet-mp-STABLE/ant/configure-targets.xml
2008-03-06 10:22:08 UTC (rev 3480)
+++ branches/geant2_java-sshtelnet-mp-STABLE/ant/configure-targets.xml
2008-03-06 10:26:09 UTC (rev 3481)
@@ -74,7 +74,7 @@
<include name="*.jar"/>
</fileset>
</classpath>
- <arg value="../conf/metadata.xml"/>
+ <arg value="../conf/sshtelnetmetadata.xml"/>
</java>
<propertyfile file="${basedir}/conf/service.properties">
Modified: branches/geant2_java-sshtelnet-mp-STABLE/ant/const.properties
===================================================================
--- branches/geant2_java-sshtelnet-mp-STABLE/ant/const.properties
2008-03-06 10:22:08 UTC (rev 3480)
+++ branches/geant2_java-sshtelnet-mp-STABLE/ant/const.properties
2008-03-06 10:26:09 UTC (rev 3481)
@@ -11,7 +11,7 @@
service.name=geant2_java-sshtelnet-mp
jarfilename=perfsonar-sshtelnet-mp
-version=1.3RC2
+version=1.3RC3
exist.war.file=exist-1.0.1.war
exist.war.download.url=http://www.perfsonar.net/download/dependencies/preinstall_download.php?product=exist-war&version=1.0.1
Modified:
branches/geant2_java-sshtelnet-mp-STABLE/ant/const.properties.template
===================================================================
--- branches/geant2_java-sshtelnet-mp-STABLE/ant/const.properties.template
2008-03-06 10:22:08 UTC (rev 3480)
+++ branches/geant2_java-sshtelnet-mp-STABLE/ant/const.properties.template
2008-03-06 10:26:09 UTC (rev 3481)
@@ -11,7 +11,7 @@
service.name=geant2_java-sshtelnet-mp
jarfilename=perfsonar-sshtelnet-mp
-version=1.3RC2
+version=1.3RC3
exist.war.file=exist-1.0.1.war
exist.war.download.url=http://www.perfsonar.net/download/dependencies/preinstall_download.php?product=exist-war&version=1.0.1
Modified:
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoAdapter.java
===================================================================
---
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoAdapter.java
2008-03-06 10:22:08 UTC (rev 3480)
+++
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoAdapter.java
2008-03-06 10:26:09 UTC (rev 3481)
@@ -75,7 +75,7 @@
} catch (PerfSONARException e) {
- logger.error("[CISCOADAPTER][Constructor]" +
e.getStackTrace().toString());
+ logger.error("[CISCOADAPTER][Constructor]" +
e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Failed to obtain reference to the properties and/or
logger instances.");
}
@@ -115,7 +115,7 @@
//eventTypeString =
eventTypeString.substring(ServicePropertiesConfigurator.EVENTTYPE_PREFIX.length()-1,
eventTypeString.lastIndexOf("/"));
} catch (Exception e) {
- logger.error("[CISCOADAPTER][TakeAction]" +
e.getStackTrace().toString());
+ logger.error("[CISCOADAPTER][TakeAction]" +
e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.command",
"No Command/EventType specified in request");
}
@@ -128,7 +128,7 @@
try {
rate = properties.getProperty(subjectString, "rate");
} catch (PerfSONARException e2) {
- logger.error("[CISCOADAPTER][TakeAction]" +
e2.getStackTrace().toString());
+ logger.error("[CISCOADAPTER][TakeAction]" +
e2.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Failed to obtain reference to the properties and/or
logger instances.");
}
@@ -152,18 +152,18 @@
s.writeLong(System.currentTimeMillis());
s.flush();
} catch (FileNotFoundException e1) {
- logger.error("[CISCOADAPTER][TakeAction]" +
e1.getStackTrace().toString());
+ logger.error("[CISCOADAPTER][TakeAction]" +
e1.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.token",
"Unable to write/retrieve token for request");
} catch (IOException e1) {
- logger.error("[CISCOADAPTER][TakeAction]" +
e1.getStackTrace().toString());
+ logger.error("[CISCOADAPTER][TakeAction]" +
e1.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.token",
"Unable to write/retrieve token for request");
}
//e.printStackTrace();
} catch (IOException e) {
- logger.error("[CISCOADAPTER][TakeAction]" +
e.getStackTrace().toString());
+ logger.error("[CISCOADAPTER][TakeAction]" +
e.getStackTrace()[0].toString());
}
if (System.currentTimeMillis() - last > rateLong) {
Modified:
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/RequestExecutingThread.java
===================================================================
---
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/RequestExecutingThread.java
2008-03-06 10:22:08 UTC (rev 3480)
+++
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/RequestExecutingThread.java
2008-03-06 10:26:09 UTC (rev 3481)
@@ -90,10 +90,7 @@
*/
public void run() {
try {
- //if (timeout > 0) //timeout <=0 -> no timeout
- // requestMonitor.startTimer(this, timeout);
-
- ServiceEngine serviceEngine =
ServiceEngineFactory.getServiceEngine(serviceEngineString);
+ ServiceEngine serviceEngine =
ServiceEngineFactory.getServiceEngine(serviceEngineString);
resultMessage = serviceEngine.takeAction(actionType,
requestMessage);
// Inclusion of the result code tags
Modified:
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/WebserviceEngineAdapter.java
===================================================================
---
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/WebserviceEngineAdapter.java
2008-03-06 10:22:08 UTC (rev 3480)
+++
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/WebserviceEngineAdapter.java
2008-03-06 10:26:09 UTC (rev 3481)
@@ -97,7 +97,7 @@
} catch (PerfSONARException e) {
-
logger.error("[WEBSERVICEENGINEADAPTER][Constructor]"+e.getStackTrace().toString());
+
logger.error("[WEBSERVICEENGINEADAPTER][Constructor]"+e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Failed to obtain reference to the properties and/or
logger instances.");
@@ -290,7 +290,7 @@
//toolkit.beep();
Thread.sleep(2000);
} catch (InterruptedException e) {
-
logger.error("[WEBSERVICEENGINEADAPTER][TakeAction]"+e.getStackTrace().toString());
+
logger.error("[WEBSERVICEENGINEADAPTER][TakeAction]"+e.getStackTrace()[0].toString());
}
}
@@ -372,7 +372,8 @@
try {
metaparam.setParameterValue(configuration.getProperty(token,
"url"));
} catch (PerfSONARException e1) {
-
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]"+e1.getStackTrace().toString());
+
logger.debug("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]
url parameter not found for device: "+ token);
+
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse] "+
e1.getStackTrace()[0].toString());
}
metaParams.addChild(metaparam);
@@ -408,7 +409,8 @@
param1.setParameterName("description");
param1.setParameterValue(configuration.getProperty(token, innerToken,
"description"));
} catch (PerfSONARException e) {
-
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]"+e.getStackTrace()[0].toString());
+
logger.debug("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]
description parameter not found for device: "+ token + " and command: " +
innerToken);
+
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse] "+
e.getStackTrace()[0].toString());
}
Parameter param2 = new Parameter();
@@ -417,7 +419,8 @@
param2.setParameterName("syntax");
param2.setParameterValue(configuration.getProperty(token, innerToken,
"syntax"));
} catch (PerfSONARException e) {
-
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]"+e.getStackTrace()[0].toString());
+
logger.debug("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]
syntax parameter not found for device: "+ token + " and command: " +
innerToken);
+
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse] "+
e.getStackTrace()[0].toString());
}
Parameter param3 = new Parameter();
@@ -426,7 +429,8 @@
param3.setParameterName("command");
param3.setParameterValue(configuration.getProperty(token, innerToken,
"command"));
} catch (PerfSONARException e) {
-
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]"+e.getStackTrace()[0].toString());
+
logger.debug("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]
command parameter not found for device: "+ token + " and command: " +
innerToken);
+
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse] "+
e.getStackTrace()[0].toString());
}
params.addChild(param1);
Modified:
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata/DbMetadataConfiguration.java
===================================================================
---
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata/DbMetadataConfiguration.java
2008-03-06 10:22:08 UTC (rev 3480)
+++
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata/DbMetadataConfiguration.java
2008-03-06 10:26:09 UTC (rev 3481)
@@ -72,13 +72,13 @@
}
public String getProperty(String property) throws PerfSONARException {
- logger.debug("[DbMetadataConfiguration] getProperty(" + property +
") called.");
+ //logger.debug("[DbMetadataConfiguration] getProperty(" + property +
") called.");
return null;
}
public String getProperty(String device, String property) throws
PerfSONARException {
- logger.debug("[DbMetadataConfiguration] getProperty(" + device + ",
" + property + ") called.");
+ //logger.debug("[DbMetadataConfiguration] getProperty(" + device +
", " + property + ") called.");
String query = "";
@@ -129,7 +129,7 @@
public String getProperty(String device, String command, String
property) throws PerfSONARException {
- logger.debug("[DbMetadataConfiguration] getProperty(" + device + ",
" + command + ", " + property + ") called.");
+ //logger.debug("[DbMetadataConfiguration] getProperty(" + device +
", " + command + ", " + property + ") called.");
String query = "";
@@ -184,7 +184,7 @@
public List getProperties(String property) throws PerfSONARException {
- logger.debug("[DbMetadataConfiguration] getProperties(" + property +
") called.");
+ //logger.debug("[DbMetadataConfiguration] getProperties(" + property
+ ") called.");
String query = "";
@@ -242,7 +242,7 @@
public List getProperties(String device, String property) throws
PerfSONARException {
- logger.debug("[DbMetadataConfiguration] getProperty(" + device + ",
" + property + ") called.");
+ //logger.debug("[DbMetadataConfiguration] getProperty(" + device +
", " + property + ") called.");
String query = "";
Modified:
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/remote/telnet/TelnetManager.java
===================================================================
---
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/remote/telnet/TelnetManager.java
2008-03-06 10:22:08 UTC (rev 3480)
+++
branches/geant2_java-sshtelnet-mp-STABLE/src/main/java/org/perfsonar/service/measurementPoint/remote/telnet/TelnetManager.java
2008-03-06 10:26:09 UTC (rev 3481)
@@ -51,7 +51,7 @@
} catch (PerfSONARException e1) {
- logger.error("[TELNETMANAGER][Constructor]" +
e1.getStackTrace().toString());
+ logger.error("[TELNETMANAGER][Constructor]" +
e1.getStackTrace()[0].toString());
}
@@ -71,7 +71,7 @@
} catch (IOException e) {
logger.error("[TelnetManager] Connection failed");
- logger.error("[TelnetManager] " +
e.getStackTrace().toString());
+ logger.error("[TelnetManager] " +
e.getStackTrace()[0].toString());
}
@@ -98,7 +98,7 @@
} catch (IOException e) {
logger.error("[TelnetManager] Connection failed");
- logger.error("[TelnetManager] " + e.getStackTrace().toString());
+ logger.error("[TelnetManager] " +
e.getStackTrace()[0].toString());
}
@@ -110,11 +110,11 @@
}//connect
public void connect(String userName, String loginPrompt, String passwd,
String passwdPrompt) {
- logger.debug("[TelnetManager] Trying to connect ... ");
+ logger.debug("[TelnetManager] Trying to connect ... ");
// Create a new Client for communication
telnet = new TelnetWrapper();
-
+
// Connect to the remote host
try {
@@ -128,7 +128,7 @@
} catch (IOException e) {
logger.error("[TelnetManager] Connection failed");
- logger.error("[TelnetManager] " + e.getStackTrace().toString());
+ logger.error("[TelnetManager] " +
e.getStackTrace()[0].toString());
}
@@ -173,7 +173,7 @@
*/
public String executeCommand(String command) {
- System.out.println("[TelnetManager] Executing command");
+ logger.debug("[TelnetManager] Executing command");
if (connected) {
@@ -182,39 +182,52 @@
String temp;
if (timeout != 0){
- final TelnetWrapper telnet2 = telnet;
+
+ final TelnetWrapper telnet2 = telnet;
Runnable updateAComponent = new Runnable() {
-
+
public void run() {
try {
-
logger.debug("[TelnetManager][ExecuteCommand]Sleeping for " + timeout + "
milliseconds...");
+
logger.debug("[TelnetManager][ExecuteCommand] Sleeping for " + timeout + "
milliseconds...");
Thread.sleep(timeout);
-
logger.debug("[TelnetManager][ExecuteCommand]Sleeping ended");
+
logger.debug("[TelnetManager][ExecuteCommand] Sleeping ended");
- telnet2.disconnect();
+ if (connected){
+ telnet2.disconnect();
+ connected = false;
+ }
} catch (IOException ex) {
-
logger.error("[TelnetManager][ExecuteCommand]" +
ex.getStackTrace()[0].toString());
+
logger.error("[TelnetManager][ExecuteCommand]" + ex.toString() + ": " +
ex.getStackTrace()[0].toString());
} catch (InterruptedException ex) {
- }
+
logger.error("[TelnetManager][ExecuteCommand]" + ex.toString() + ": " +
ex.getStackTrace()[0].toString());
+ }
}
};
- SwingUtilities.invokeLater(updateAComponent);
+ if (!command.equals(" ")) //only start timer if the
command is the actual command
+ SwingUtilities.invokeLater(updateAComponent);
}
temp = telnet.send(command);
- //logger.debug("[TelnetManager][ExecuteCommand] result: " +
temp);
- if(timeout==0)
- telnet.disconnect();
+ if(timeout==0){
+ if (command.equals(" ")) {
+ // only disconnect if the
command is the "empty command"
+ // if the command isn't the
"empty command", then the "empty command" will follow
+ // and the session still
needs to be open
+ telnet.disconnect();
+ connected = false;
+ }
+
+ }
if (temp == null)
temp = "";
return temp;
} catch (IOException e) {
- e.printStackTrace();
+ logger.error("[TelnetManager][ExecuteCommand]" +
e.toString() + ": " + e.getStackTrace()[0].toString());
logger.debug("[TelnetManager][ExecuteCommand]TimeOut!");
- return "";
+ return " A timeout has occured!";
}
}//connected
@@ -238,7 +251,7 @@
} catch (IOException e) {
logger.error("[TelnetManager] Disconnection failed");
- logger.error("[TelnetManager] " +
e.getStackTrace().toString());
+ logger.error("[TelnetManager] " +
e.getStackTrace()[0].toString());
}
}//connected
- perfsonar: r3481 - in branches/geant2_java-sshtelnet-mp-STABLE: ant src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata src/main/java/org/perfsonar/service/measurementPoint/remote/telnet, svnlog, 03/06/2008
Archive powered by MHonArc 2.6.16.