perfsonar-dev - perfsonar: r3258 - in trunk/geant2_java-sshtelnet-mp: conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters lib/misc samples src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters src/main/java/org/perfsonar/service/measurementPoint/remote/ssh src/main/java/org/perfsonar/service/measurementPoint/remote/telnet
Subject: perfsonar development work
List archive
perfsonar: r3258 - in trunk/geant2_java-sshtelnet-mp: conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters lib/misc samples src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters src/main/java/org/perfsonar/service/measurementPoint/remote/ssh src/main/java/org/perfsonar/service/measurementPoint/remote/telnet
Chronological Thread
- From:
- To:
- Subject: perfsonar: r3258 - in trunk/geant2_java-sshtelnet-mp: conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters lib/misc samples src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters src/main/java/org/perfsonar/service/measurementPoint/remote/ssh src/main/java/org/perfsonar/service/measurementPoint/remote/telnet
- Date: Tue, 22 Jan 2008 11:21:28 -0500
Author: melis
Date: 2008-01-22 11:21:27 -0500 (Tue, 22 Jan 2008)
New Revision: 3258
Added:
trunk/geant2_java-sshtelnet-mp/lib/misc/perfsonar-base-ant-1.0.20071008.jar
Modified:
trunk/geant2_java-sshtelnet-mp/conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.class
trunk/geant2_java-sshtelnet-mp/samples/sshtelnetmptemplate.csv
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoBgpAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoKeyBgpAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoSshBgpAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperBgpAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperKeyBgpAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperSshBgpAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/RequestExecutingThread.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/WebserviceEngineAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoIpAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoKeyIpAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoSshIpAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperIpAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperKeyIpAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperSshIpAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoIpv6Adapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoKeyIpv6Adapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoSshIpv6Adapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperIpv6Adapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperKeyIpv6Adapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperSshIpv6Adapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoKeyStatusAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoSshStatusAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoStatusAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperKeyStatusAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperSshStatusAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperStatusAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/ssh/SshKeyManager.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/ssh/SshManager.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/telnet/TelnetManager.java
Log:
added ongoing development
Modified:
trunk/geant2_java-sshtelnet-mp/conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.class
===================================================================
(Binary files differ)
Added:
trunk/geant2_java-sshtelnet-mp/lib/misc/perfsonar-base-ant-1.0.20071008.jar
Property changes on:
trunk/geant2_java-sshtelnet-mp/lib/misc/perfsonar-base-ant-1.0.20071008.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/geant2_java-sshtelnet-mp/samples/sshtelnetmptemplate.csv
===================================================================
--- trunk/geant2_java-sshtelnet-mp/samples/sshtelnetmptemplate.csv
2008-01-21 23:11:55 UTC (rev 3257)
+++ trunk/geant2_java-sshtelnet-mp/samples/sshtelnetmptemplate.csv
2008-01-22 16:21:27 UTC (rev 3258)
@@ -1,8 +1,8 @@
-device1@@@ciscotelnet@@@url@@@port@@@prompt@@@rate@@@username@@@password@@@maxusers%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
-device2@@@ciscossh@@@url@@@port@@@prompt@@@rate@@@username@@@password@@@maxusers%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
-device3@@@ciscokey@@@url@@@port@@@prompt@@@rate@@@username@@@path_to_key@@@maxusers%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
-device4@@@ciscokey@@@url@@@port@@@prompt@@@rate@@@username@@@path_to_key@@@maxusers@@@passphrase%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
-device5@@@junipertelnet@@@url@@@port@@@prompt@@@rate@@@username@@@password@@@maxusers%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
-device6@@@juniperssh@@@url@@@port@@@prompt@@@rate@@@username@@@password@@@maxusers%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
-device7@@@juniperkey@@@url@@@port@@@prompt@@@rate@@@username@@@path_to_key@@@maxusers%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
-device8@@@juniperkey@@@url@@@port@@@prompt@@@rate@@@username@@@path_to_key@@@maxusers@@@passphrase%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
\ No newline at end of file
+device1@@@ciscotelnet@@@url@@@port@@@prompt@@@rate@@@username@@@password@@@timeout@@@maxusers@@@timeout%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
+device2@@@ciscossh@@@url@@@port@@@prompt@@@rate@@@username@@@password@@@timeout@@@maxusers%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
+device3@@@ciscokey@@@url@@@port@@@prompt@@@rate@@@username@@@path_to_key@@@timeout@@@maxusers%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
+device4@@@ciscokey@@@url@@@port@@@prompt@@@rate@@@username@@@path_to_key@@@timeout@@@maxusers@@@passphrase%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
+device5@@@junipertelnet@@@url@@@port@@@prompt@@@rate@@@username@@@password@@@timeout@@@maxusers%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
+device6@@@juniperssh@@@url@@@port@@@prompt@@@rate@@@username@@@password@@@timeout@@@maxusers%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
+device7@@@juniperkey@@@url@@@port@@@prompt@@@rate@@@username@@@path_to_key@@@timeout@@@maxusers%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
+device8@@@juniperkey@@@url@@@port@@@prompt@@@rate@@@username@@@path_to_key@@@timeout@@@maxusers@@@passphrase%%%command_name1@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name2@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions%%%command_name3@@@command@@@minParamCount@@@maxParamCount@@@cache@@@description@@@syntax@@@regExpressions
\ No newline at end of file
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoBgpAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoBgpAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoBgpAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,6 +57,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -198,12 +199,13 @@
prompt = properties.getProperty(subject, "prompt");
username = properties.getProperty(subject, "username");
password = properties.getProperty(subject, "password");
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
//System.out.println(username);
//System.out.println(password);
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
((TelnetManager)
manager).setPrompt(properties.getProperty(subject, "prompt"));
}
@@ -400,9 +402,10 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
+
+ manager = new TelnetManager(url, port, false, timeout);
- manager = new TelnetManager(url, port, false);
-
} catch (NumberFormatException e1) {
logger.error("[CISCOBGPADAPTER][TakeAction]"+e1.getStackTrace().toString());
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoKeyBgpAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoKeyBgpAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoKeyBgpAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,6 +57,7 @@
private String keyUrl = "";
private String passphrase = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -197,9 +198,10 @@
keyUrl = properties.getProperty(subject, "keyUrl");
passphrase = properties.getProperty(subject, "passphrase");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
+
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
- manager = new SshKeyManager(url, username, keyUrl, false);
-
}
logger.info("[CiscoKeyBgpAdapter] Trying to connect");
@@ -396,8 +398,9 @@
username = properties.getProperty(subject, "username");
keyUrl = properties.getProperty(subject, "keyUrl");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoSshBgpAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoSshBgpAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoSshBgpAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -56,7 +56,8 @@
private String username = "";
private String password = "";
private int caching = 0;
-
+ private int timeout = 0;
+
// ---------------------- class-fields
private List availableSpecificCommands = null;
private RemoteManager manager = null;
@@ -194,11 +195,12 @@
username = properties.getProperty(subject, "username");
password = properties.getProperty(subject, "password");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
//System.out.println(username);
//System.out.println(password);
- manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);
+ manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false, timeout);
}
@@ -395,9 +397,10 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
+
+ manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false, timeout);
- manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);
-
} catch (NumberFormatException e1) {
logger.error("[CISCOSSHBGPADAPTER][TakeAction]" +
e1.getStackTrace().toString());
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperBgpAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperBgpAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperBgpAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -56,6 +56,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -198,8 +199,9 @@
username = properties.getProperty(subject, "username");
password = properties.getProperty(subject, "password");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
((TelnetManager)
manager).setPrompt(properties.getProperty(subject, "prompt"));
}
@@ -404,8 +406,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperKeyBgpAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperKeyBgpAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperKeyBgpAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,6 +57,7 @@
private String keyUrl = "";
private String passphrase = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -196,8 +197,9 @@
keyUrl = properties.getProperty(subject, "keyUrl");
passphrase = properties.getProperty(subject, "passphrase");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
}
@@ -409,8 +411,9 @@
username = properties.getProperty(subject, "username");
keyUrl = properties.getProperty(subject, "keyUrl");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperSshBgpAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperSshBgpAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperSshBgpAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -56,6 +56,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -196,11 +197,12 @@
username = properties.getProperty(subject, "username");
password = properties.getProperty(subject, "password");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
//System.out.println(username);
//System.out.println(password);
- manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);
+ manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false, timeout);
}
@@ -411,8 +413,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);
+ manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/RequestExecutingThread.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/RequestExecutingThread.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/RequestExecutingThread.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -34,7 +34,7 @@
private Message resultMessage = null;
private RequestMonitor requestMonitor = null;
private Metadata requestMetadata = null;
- private long timeout = 0;
+ //private long timeout = 0;
public RequestExecutingThread(int id,
String actionType,
@@ -53,7 +53,7 @@
this.requestMetadata = requestMetadata;
}
- public RequestExecutingThread(int id,
+ /*public RequestExecutingThread(int id,
String actionType,
String serviceEngineString,
Message requestMessage,
@@ -71,7 +71,7 @@
this.requestMetadata = requestMetadata;
this.timeout = timeout;
- }
+ }*/
/**
* Retrieve the result and compose it into an XML compliant
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -220,11 +220,11 @@
param.setAttribute("name", "password");
param.setAttribute("value", "" +
PasswordEncryptor.encryptPassword(deviceTok.nextToken()));
params.addContent(param);
- //param = new Element("parameter", NMWG);
- //param.setAttribute("name", "timeout");
- //param.setAttribute("value", "" +
deviceTok.nextToken());
- //params.addContent(param);
param = new Element("parameter", NMWG);
+ param.setAttribute("name", "timeout");
+ param.setAttribute("value", "" + deviceTok.nextToken());
+ params.addContent(param);
+ param = new Element("parameter", NMWG);
param.setAttribute("name", "numberOfUsers");
param.setAttribute("value", "" + deviceTok.nextToken());
params.addContent(param);
@@ -263,11 +263,11 @@
param.setAttribute("name", "password");
param.setAttribute("value", "" +
PasswordEncryptor.encryptPassword(deviceTok.nextToken()));
params.addContent(param);
- //param = new Element("parameter", NMWG);
- //param.setAttribute("name", "timeout");
- //param.setAttribute("value", "" +
deviceTok.nextToken());
- //params.addContent(param);
param = new Element("parameter", NMWG);
+ param.setAttribute("name", "timeout");
+ param.setAttribute("value", "" + deviceTok.nextToken());
+ params.addContent(param);
+ param = new Element("parameter", NMWG);
param.setAttribute("name", "numberOfUsers");
param.setAttribute("value", "" + deviceTok.nextToken());
params.addContent(param);
@@ -306,11 +306,11 @@
param.setAttribute("name", "keyUrl");
param.setAttribute("value", "" + deviceTok.nextToken());
params.addContent(param);
- //param = new Element("parameter", NMWG);
- //param.setAttribute("name", "timeout");
- //param.setAttribute("value", "" +
deviceTok.nextToken());
- //params.addContent(param);
param = new Element("parameter", NMWG);
+ param.setAttribute("name", "timeout");
+ param.setAttribute("value", "" + deviceTok.nextToken());
+ params.addContent(param);
+ param = new Element("parameter", NMWG);
param.setAttribute("name", "numberOfUsers");
param.setAttribute("value", "" + deviceTok.nextToken());
params.addContent(param);
@@ -355,11 +355,11 @@
param.setAttribute("name", "password");
param.setAttribute("value", "" +
PasswordEncryptor.encryptPassword(deviceTok.nextToken()));
params.addContent(param);
- //param = new Element("parameter", NMWG);
- //param.setAttribute("name", "timeout");
- //param.setAttribute("value", "" +
deviceTok.nextToken());
- //params.addContent(param);
param = new Element("parameter", NMWG);
+ param.setAttribute("name", "timeout");
+ param.setAttribute("value", "" + deviceTok.nextToken());
+ params.addContent(param);
+ param = new Element("parameter", NMWG);
param.setAttribute("name", "numberOfUsers");
param.setAttribute("value", "" + deviceTok.nextToken());
params.addContent(param);
@@ -398,11 +398,11 @@
param.setAttribute("name", "password");
param.setAttribute("value", "" +
PasswordEncryptor.encryptPassword(deviceTok.nextToken()));
params.addContent(param);
- //param = new Element("parameter", NMWG);
- //param.setAttribute("name", "timeout");
- //param.setAttribute("value", "" +
deviceTok.nextToken());
- //params.addContent(param);
param = new Element("parameter", NMWG);
+ param.setAttribute("name", "timeout");
+ param.setAttribute("value", "" + deviceTok.nextToken());
+ params.addContent(param);
+ param = new Element("parameter", NMWG);
param.setAttribute("name", "numberOfUsers");
param.setAttribute("value", "" + deviceTok.nextToken());
params.addContent(param);
@@ -441,11 +441,11 @@
param.setAttribute("name", "keyUrl");
param.setAttribute("value", "" + deviceTok.nextToken());
params.addContent(param);
- //param = new Element("parameter", NMWG);
- //param.setAttribute("name", "timeout");
- //param.setAttribute("value", "" +
deviceTok.nextToken());
- //params.addContent(param);
param = new Element("parameter", NMWG);
+ param.setAttribute("name", "timeout");
+ param.setAttribute("value", "" + deviceTok.nextToken());
+ params.addContent(param);
+ param = new Element("parameter", NMWG);
param.setAttribute("name", "numberOfUsers");
param.setAttribute("value", "" + deviceTok.nextToken());
params.addContent(param);
@@ -719,7 +719,7 @@
param.setAttribute("value",
PasswordEncryptor.encryptPassword(input));
params.addContent(param);
- /*System.out.println("Please give the timeout for
the device: " + device + "(enter 0 if you don't want to use a timeout): ");
+ System.out.println("Please give the timeout for the
device: " + device + "(enter 0 if you don't want to use a timeout): ");
input = br.readLine();
valid = false;
while (!valid){
@@ -737,7 +737,7 @@
param = new Element("parameter", NMWG);
param.setAttribute("name", "timeout");
param.setAttribute("value", input);
- params.addContent(param);*/
+ params.addContent(param);
System.out.println("Please give the maximum number
of users for the device: " + device + "(enter 0 if you want an unlimited
amount of users): ");
input = br.readLine();
valid = false;
@@ -864,7 +864,7 @@
}
- /*System.out.println("Please give the timeout for
the device: " + device + "(enter 0 if you don't want to use a timeout): ");
+ System.out.println("Please give the timeout for the
device: " + device + "(enter 0 if you don't want to use a timeout): ");
input = br.readLine();
valid = false;
while (!valid){
@@ -882,7 +882,7 @@
param = new Element("parameter", NMWG);
param.setAttribute("name", "timeout");
param.setAttribute("value", input);
- params.addContent(param);*/
+ params.addContent(param);
System.out.println("Please give the maximum number
of users for the device: " + device + "(enter 0 if you want an unlimited
amount of users): ");
input = br.readLine();
valid = false;
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/WebserviceEngineAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/WebserviceEngineAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/WebserviceEngineAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -56,6 +56,9 @@
// files
private List devices = null;
+ private static boolean arrayInitialized = false;
+
+
// ---------------------- constructors
public WebserviceEngineAdapter() throws PerfSONARException {
@@ -73,10 +76,13 @@
registerServiceWithLS();
- count = new int[devices.size()];
-
- for (int i = 0; i < count.length; i++)
- count[i] = 0;
+ if (!arrayInitialized){
+ count = new int[devices.size()];
+ arrayInitialized = true;
+ }
+
+ //for (int i = 0; i < count.length; i++)
+ // count[i] = 0;
} catch (PerfSONARException e) {
@@ -389,7 +395,7 @@
param1.setParameterName("description");
param1.setParameterValue(configuration.getProperty(token, innerToken,
"description"));
} catch (PerfSONARException e) {
-
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]"+e.getStackTrace().toString());
+
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]"+e.getStackTrace()[0].toString());
}
Parameter param2 = new Parameter();
@@ -398,7 +404,7 @@
param2.setParameterName("syntax");
param2.setParameterValue(configuration.getProperty(token, innerToken,
"syntax"));
} catch (PerfSONARException e) {
-
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]"+e.getStackTrace().toString());
+
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]"+e.getStackTrace()[0].toString());
}
Parameter param3 = new Parameter();
@@ -407,7 +413,7 @@
param3.setParameterName("command");
param3.setParameterValue(configuration.getProperty(token, innerToken,
"command"));
} catch (PerfSONARException e) {
-
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]"+e.getStackTrace().toString());
+
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]"+e.getStackTrace()[0].toString());
}
params.addChild(param1);
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoIpAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoIpAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoIpAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,6 +57,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -164,7 +165,7 @@
manager.executeCommand(command.getCommand() + " " +
command.getParameterString());
String temp2 = manager.executeCommand(" ");
- logger.debug("temp2: " + temp2);
+ //logger.debug("temp2: " + temp2);
manager.disconnect();
@@ -210,8 +211,9 @@
throw e;
}
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
((TelnetManager)
manager).setPrompt(properties.getProperty(subject, "prompt"));
}
@@ -417,8 +419,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoKeyIpAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoKeyIpAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoKeyIpAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -68,6 +68,8 @@
private String passphrase = "";
private int caching = 0;
+
+ private int timeout = 0;
// ---------------------- class-fields
@@ -236,8 +238,9 @@
throw e;
}
caching =
Integer.parseInt(properties.getProperty(subject, "cache"));
+ timeout =
Integer.parseInt(properties.getProperty(subject, "timeout"));
- manager = new SshKeyManager(url, username,
keyUrl, false);
+ manager = new SshKeyManager(url, username,
keyUrl, false, timeout);
}
@@ -452,8 +455,9 @@
throw e;
}
caching =
Integer.parseInt(properties.getProperty(subject, "cache"));
+ timeout =
Integer.parseInt(properties.getProperty(subject, "timeout"));
- manager = new SshKeyManager(url, username, keyUrl,
false);
+ manager = new SshKeyManager(url, username, keyUrl,
false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoSshIpAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoSshIpAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoSshIpAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,6 +57,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -206,12 +207,12 @@
throw e;
}
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
//System.out.println(username);
//System.out.println(password);
- manager = new SshManager(url, username, password, false);
-
+ manager = new SshManager(url, username, password, false,
timeout);
}
logger.info("[CiscoSshIpAdapter] Trying to connect");
@@ -407,9 +408,10 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);
-
+ manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false, timeout);
+
} catch (NumberFormatException e1) {
logger.error("[CISCOSSHIPADAPTER][TakeAction]" +
e1.getStackTrace().toString());
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperIpAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperIpAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperIpAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,7 +57,8 @@
private String username = "";
private String password = "";
private int caching = 0;
-
+ private int timeout = 0;
+
// ---------------------- class-fields
private List availableSpecificCommands = null;
private RemoteManager manager = null;
@@ -164,7 +165,7 @@
manager.executeCommand(command.getCommand() + " " +
command.getParameterString());
String temp2 = manager.executeCommand(" ");
- logger.debug("temp2: " + temp2);
+ //logger.debug("temp2: " + temp2);
manager.disconnect();
@@ -209,8 +210,9 @@
throw e;
}
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
((TelnetManager)
manager).setPrompt(properties.getProperty(subject, "prompt"));
}
@@ -417,8 +419,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperKeyIpAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperKeyIpAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperKeyIpAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -60,6 +60,7 @@
private String keyUrl = "";
private String passphrase = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -210,8 +211,9 @@
throw e;
}
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
}
@@ -434,8 +436,9 @@
throw e;
}
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperSshIpAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperSshIpAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperSshIpAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,6 +57,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -207,11 +208,12 @@
throw e;
}
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
//System.out.println(username);
//System.out.println(password);
- manager = new SshManager(url, username, password, false);
+ manager = new SshManager(url, username, password, false,
timeout);
}
@@ -422,8 +424,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);
+ manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoIpv6Adapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoIpv6Adapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoIpv6Adapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,6 +57,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -201,8 +202,9 @@
username = properties.getProperty(subject, "username");
password = properties.getProperty(subject, "password");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
((TelnetManager)
manager).setPrompt(properties.getProperty(subject, "prompt"));
}
@@ -403,8 +405,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoKeyIpv6Adapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoKeyIpv6Adapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoKeyIpv6Adapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -61,6 +61,7 @@
private String keyUrl = "";
private String passphrase = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -201,8 +202,9 @@
keyUrl = properties.getProperty(subject, "keyUrl");
passphrase = properties.getProperty(subject, "passphrase");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
}
@@ -401,8 +403,9 @@
username = properties.getProperty(subject, "username");
keyUrl = properties.getProperty(subject, "keyUrl");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoSshIpv6Adapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoSshIpv6Adapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoSshIpv6Adapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,6 +57,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -196,11 +197,12 @@
username = properties.getProperty(subject, "username");
password = properties.getProperty(subject, "password");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
//System.out.println(username);
//System.out.println(password);
- manager = new SshManager(url, username, password, false);
+ manager = new SshManager(url, username, password, false,
timeout);
}
@@ -397,8 +399,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);
+ manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperIpv6Adapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperIpv6Adapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperIpv6Adapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,6 +57,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -199,8 +200,9 @@
username = properties.getProperty(subject, "username");
password = properties.getProperty(subject, "password");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
((TelnetManager)
manager).setPrompt(properties.getProperty(subject, "prompt"));
}
@@ -409,8 +411,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperKeyIpv6Adapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperKeyIpv6Adapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperKeyIpv6Adapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -61,6 +61,7 @@
private String keyUrl = "";
private String passphrase = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -201,8 +202,9 @@
keyUrl = properties.getProperty(subject, "keyUrl");
passphrase = properties.getProperty(subject, "passphrase");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
}
@@ -415,8 +417,9 @@
username = properties.getProperty(subject, "username");
keyUrl = properties.getProperty(subject, "keyUrl");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperSshIpv6Adapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperSshIpv6Adapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperSshIpv6Adapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,6 +57,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -196,11 +197,12 @@
username = properties.getProperty(subject, "username");
password = properties.getProperty(subject, "password");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
//System.out.println(username);
//System.out.println(password);
- manager = new SshManager(url, username, password, false);
+ manager = new SshManager(url, username, password, false,
timeout);
}
@@ -411,8 +413,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);
+ manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoKeyStatusAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoKeyStatusAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoKeyStatusAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -61,6 +61,7 @@
private String keyUrl = "";
private String passphrase = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -203,8 +204,9 @@
keyUrl = properties.getProperty(subject, "keyUrl");
passphrase = properties.getProperty(subject, "passphrase");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
}
@@ -404,8 +406,9 @@
username = properties.getProperty(subject, "username");
keyUrl = properties.getProperty(subject, "keyUrl");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoSshStatusAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoSshStatusAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoSshStatusAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,6 +57,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -204,11 +205,12 @@
username = properties.getProperty(subject, "username");
password = properties.getProperty(subject, "password");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
//System.out.println(username);
//System.out.println(password);
- manager = new SshManager(url, username, password, false);
+ manager = new SshManager(url, username, password, false,
timeout);
}
@@ -405,8 +407,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);
+ manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoStatusAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoStatusAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoStatusAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -58,6 +58,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -204,8 +205,9 @@
password = properties.getProperty(subject, "password");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
logger.debug("[CiscoStatusAdapter] cache: " + caching);
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
((TelnetManager)
manager).setPrompt(properties.getProperty(subject, "prompt"));
}
@@ -347,22 +349,27 @@
private String filterResult(String temp,
StatusCommandInterface statusCommand) {
+ //logger.debug("[CiscoStatusAdapter][filterResult] result: " + temp);
+
String temp1;
String temp2;
while (temp.indexOf(" --More-- ") > -1) {
temp1 = temp.substring(0, temp.indexOf(" --More-- "));
+ //logger.debug("[CiscoStatusAdapter][filterResult] temp1: " +
temp1);
temp2 = temp.substring(temp.indexOf(" --More-- ") + 41);
+ //logger.debug("[CiscoStatusAdapter][filterResult] temp2: " +
temp2);
temp = temp1 + temp2;
}
String tempResult = temp.substring((statusCommand.getCommand() + "
" + statusCommand.getParameterString()).length());
-
+ //logger.debug("[CiscoStatusAdapter][filterResult] tempResult: " +
tempResult);
+
String t1 = tempResult.replaceAll("\\n", "");
- logger.debug(t1);
+ //logger.debug(t1);
String t2 = t1.replaceAll("\\r", "@@@");
- logger.debug(t2);
+ //logger.debug(t2);
StringBuffer resultBuffer = new StringBuffer(t2);
@@ -421,8 +428,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperKeyStatusAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperKeyStatusAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperKeyStatusAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -61,6 +61,7 @@
private String keyUrl = "";
private String passphrase = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -203,8 +204,9 @@
keyUrl = properties.getProperty(subject, "keyUrl");
passphrase = properties.getProperty(subject, "passphrase");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
}
@@ -418,8 +420,9 @@
username = properties.getProperty(subject, "username");
keyUrl = properties.getProperty(subject, "keyUrl");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshKeyManager(url, username, keyUrl, false);
+ manager = new SshKeyManager(url, username, keyUrl, false,
timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperSshStatusAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperSshStatusAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperSshStatusAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -57,6 +57,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -196,11 +197,12 @@
username = properties.getProperty(subject, "username");
password = properties.getProperty(subject, "password");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
//System.out.println(username);
//System.out.println(password);
- manager = new SshManager(url, username, password, false);
+ manager = new SshManager(url, username, password, false,
timeout);
}
@@ -411,8 +413,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);
+ manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperStatusAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperStatusAdapter.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperStatusAdapter.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -58,6 +58,7 @@
private String username = "";
private String password = "";
private int caching = 0;
+ private int timeout = 0;
// ---------------------- class-fields
private List availableSpecificCommands = null;
@@ -200,8 +201,9 @@
username = properties.getProperty(subject, "username");
password = properties.getProperty(subject, "password");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
((TelnetManager)
manager).setPrompt(properties.getProperty(subject, "prompt"));
}
@@ -425,8 +427,9 @@
port = Integer.parseInt(properties.getProperty(subject, "port"));
prompt = properties.getProperty(subject, "prompt");
caching = Integer.parseInt(properties.getProperty(subject,
"cache"));
+ timeout = Integer.parseInt(properties.getProperty(subject,
"timeout"));
- manager = new TelnetManager(url, port, false);
+ manager = new TelnetManager(url, port, false, timeout);
} catch (NumberFormatException e1) {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/ssh/SshKeyManager.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/ssh/SshKeyManager.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/ssh/SshKeyManager.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -8,6 +8,8 @@
import java.io.IOException;
import java.io.InputStream;
+import javax.swing.SwingUtilities;
+
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
@@ -37,14 +39,16 @@
private String keyUrl = null;
private LoggerComponent logger = null;
private boolean connected = false;
+ private int timeout = 0;
public SshKeyManager(String url, String userName, String keyUrl,
- boolean connect) {
+ boolean connect, int timeout) {
super();
this.url = url;
this.userName = userName;
this.keyUrl = keyUrl;
+ this.timeout = timeout;
try {
@@ -198,19 +202,47 @@
}
}// getSshSessionChannel
- public String executeCommand(String command) {
+
+ /**
+ * Executes the command in the remote machine over the Ssh connection
+ *
+ * @param cmd
+ * command
+ */
+ public String executeCommand(String cmd) {
+ String result = "";
+
try {
Channel channel = session.openChannel("exec");
- ((ChannelExec) channel).setCommand(command);
+ ((ChannelExec) channel).setCommand(cmd);
channel.setInputStream(null);
((ChannelExec) channel).setErrStream(System.err);
InputStream in = channel.getInputStream();
channel.connect();
+ if (timeout != 0){
+ final Channel channel2 = channel;
- String result = "";
+ Runnable updateAComponent = new Runnable() {
+
+ public void run() {
+ try {
+
logger.debug("[SshKeyManager][ExecuteCommand]Sleeping for " + timeout + "
milliseconds...");
+ Thread.sleep(timeout);
+
logger.debug("[SshKeyManager][ExecuteCommand]Sleeping ended");
+ channel2.disconnect();
+ session.disconnect();
+ } catch (InterruptedException ex) {
+
+
logger.error("[SshKeyManager][ExecuteCommand]" +
ex.getStackTrace()[0].toString());
+
+ }
+ }
+ };
+ SwingUtilities.invokeLater(updateAComponent);
+ }
byte[] tmp = new byte[1024];
while (true) {
while (in.available() > 0) {
@@ -219,30 +251,33 @@
break;
}
result += new String(tmp, 0, i);
- logger.debug(new String(tmp, 0, i));
+ System.out.println(new String(tmp, 0, i));
}
if (channel.isClosed()) {
- logger.debug("exit-status: " + channel.getExitStatus());
+ System.out.println("exit-status: " +
channel.getExitStatus());
break;
}
try {
Thread.sleep(1000);
} catch (Exception ee) {
- logger.error("[SSHKEYMANAGER][ExecuteCommand]" +
ee.getStackTrace().toString());
+ ee.printStackTrace();
}
}
- channel.disconnect();
- session.disconnect();
+ if (timeout == 0){
+ channel.disconnect();
+ session.disconnect();
+ }
+ logger.debug("result: " + result);
return result;
} catch (JSchException e) {
- logger.error("[SSHKEYMANAGER][ExecuteCommand]" +
e.getStackTrace().toString());
- return "An error occured";
+ e.printStackTrace();
+ return "An Error Occured";
} catch (IOException e) {
- logger.error("[SSHKEYMANAGER][ExecuteCommand]" +
e.getStackTrace().toString());
- return "An error occured";
+ e.printStackTrace();
+ return "An Error Occured";
}
- } //executeCommand
+ }// executeCommand
public void disconnect() {
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/ssh/SshManager.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/ssh/SshManager.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/ssh/SshManager.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -8,6 +8,8 @@
import java.io.IOException;
import java.io.InputStream;
+import javax.swing.SwingUtilities;
+
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
@@ -41,15 +43,17 @@
private String password = null;
private LoggerComponent logger = null;
private boolean connected = false;
+ private int timeout = 0;
// ---------------------- constructors
public SshManager(String url, String userName, String password,
- boolean connect) {
+ boolean connect, int timeout) {
super();
this.url = url;
this.userName = userName;
this.password = password;
+ this.timeout = timeout;
ui = new MyUserInfo(password);
try {
@@ -184,7 +188,27 @@
InputStream in = channel.getInputStream();
channel.connect();
+ if (timeout != 0){
+ final Channel channel2 = channel;
+ Runnable updateAComponent = new Runnable() {
+
+ public void run() {
+ try {
+
logger.debug("[SshManager][ExecuteCommand]Sleeping for " + timeout + "
milliseconds...");
+ Thread.sleep(timeout);
+
logger.debug("[SshManager][ExecuteCommand]Sleeping ended");
+ channel2.disconnect();
+ session.disconnect();
+ } catch (InterruptedException ex) {
+
+ logger.error("[SshManager][ExecuteCommand]" +
ex.getStackTrace()[0].toString());
+
+ }
+ }
+ };
+ SwingUtilities.invokeLater(updateAComponent);
+ }
byte[] tmp = new byte[1024];
while (true) {
while (in.available() > 0) {
@@ -193,31 +217,34 @@
break;
}
result += new String(tmp, 0, i);
- logger.debug(new String(tmp, 0, i));
+ System.out.println(new String(tmp, 0, i));
}
if (channel.isClosed()) {
- logger.debug("exit-status: " + channel.getExitStatus());
+ System.out.println("exit-status: " +
channel.getExitStatus());
break;
}
try {
Thread.sleep(1000);
} catch (Exception ee) {
- logger.error("[SSHMANAGER][ExecuteCommand]" +
ee.getStackTrace().toString());
+ ee.printStackTrace();
}
}
- channel.disconnect();
- session.disconnect();
+ if (timeout == 0){
+ channel.disconnect();
+ session.disconnect();
+ }
logger.debug("result: " + result);
return result;
} catch (JSchException e) {
- logger.error("[SSHMANAGER][ExecuteCommand]" +
e.getStackTrace().toString());
+ e.printStackTrace();
return "An Error Occured";
} catch (IOException e) {
- logger.error("[SSHMANAGER][ExecuteCommand]" +
e.getStackTrace().toString());
+ e.printStackTrace();
return "An Error Occured";
}
}// executeCommand
+
/**
* Closing and disconnection management
*
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/telnet/TelnetManager.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/telnet/TelnetManager.java
2008-01-21 23:11:55 UTC (rev 3257)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/telnet/TelnetManager.java
2008-01-22 16:21:27 UTC (rev 3258)
@@ -7,6 +7,8 @@
import java.io.IOException;
+import javax.swing.SwingUtilities;
+
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
@@ -33,13 +35,15 @@
private String prompt = null;
private LoggerComponent logger = null;
private boolean connected = false;
+ private int timeout = 0;
// ---------------------- constructors
- public TelnetManager(String url, int port, boolean connect) {
+ public TelnetManager(String url, int port, boolean connect, int timeout)
{
super();
this.url = url;
this.port = port;
+ this.timeout = timeout;
try {
@@ -159,7 +163,7 @@
}
/**
- * This method executes a command on th remote machine and returns a
string
+ * This method executes a command on the remote machine and returns a
string
* containing the captures output from standardout of that remote
process.
* All output is contained in this string until the earlier configured
* prompt is encountered.
@@ -169,24 +173,48 @@
*/
public String executeCommand(String command) {
- logger.debug("[TelnetManager] Executing command");
+ System.out.println("[TelnetManager] Executing command");
if (connected) {
try {
String temp;
- temp = telnet.send(command);
+ if (timeout != 0){
+ final TelnetWrapper telnet2 = telnet;
+
+ Runnable updateAComponent = new Runnable() {
+
+ public void run() {
+ try {
+
logger.debug("[TelnetManager][ExecuteCommand]Sleeping for " + timeout + "
milliseconds...");
+ Thread.sleep(timeout);
+
logger.debug("[TelnetManager][ExecuteCommand]Sleeping ended");
- //telnet.disconnect();
+ telnet2.disconnect();
+ } catch (IOException ex) {
+
+
logger.error("[TelnetManager][ExecuteCommand]" +
ex.getStackTrace()[0].toString());
+ } catch (InterruptedException ex) {
+ }
+ }
+ };
+ SwingUtilities.invokeLater(updateAComponent);
+ }
+ temp = telnet.send(command);
+ //logger.debug("[TelnetManager][ExecuteCommand] result: " +
temp);
+ if(timeout==0)
+ telnet.disconnect();
+ if (temp == null)
+ temp = "";
return temp;
} catch (IOException e) {
- logger.error("[TelnetManager] Execution of command failed");
- logger.error("[TelnetManager] " +
e.getStackTrace().toString());
- //e.printStackTrace();
+ e.printStackTrace();
+ logger.debug("[TelnetManager][ExecuteCommand]TimeOut!");
+ return "";
}
}//connected
- perfsonar: r3258 - in trunk/geant2_java-sshtelnet-mp: conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters lib/misc samples src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters src/main/java/org/perfsonar/service/measurementPoint/remote/ssh src/main/java/org/perfsonar/service/measurementPoint/remote/telnet, svnlog, 01/22/2008
Archive powered by MHonArc 2.6.16.