perfsonar-dev - perfsonar: r4019 - in trunk/geant2_java-sshtelnet-mp: ant conf conf/axis-1.4/WEB-INF/classes/perfsonar/conf doc src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/encryption src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/internalChecks 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: r4019 - in trunk/geant2_java-sshtelnet-mp: ant conf conf/axis-1.4/WEB-INF/classes/perfsonar/conf doc src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/encryption src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/internalChecks src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata src/main/java/org/perfsonar/service/measurementPoint/remote/telnet
Chronological Thread
- From:
- To:
- Subject: perfsonar: r4019 - in trunk/geant2_java-sshtelnet-mp: ant conf conf/axis-1.4/WEB-INF/classes/perfsonar/conf doc src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/encryption src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/internalChecks src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata src/main/java/org/perfsonar/service/measurementPoint/remote/telnet
- Date: Wed, 18 Jun 2008 09:46:40 -0400
Author: melis
Date: 2008-06-18 09:46:40 -0400 (Wed, 18 Jun 2008)
New Revision: 4019
Added:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/internalChecks/
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/internalChecks/InternalChecker.java
Modified:
trunk/geant2_java-sshtelnet-mp/ant/const.properties
trunk/geant2_java-sshtelnet-mp/ant/const.properties.template
trunk/geant2_java-sshtelnet-mp/conf/axis-1.4/WEB-INF/classes/perfsonar/conf/service.properties
trunk/geant2_java-sshtelnet-mp/conf/service.properties
trunk/geant2_java-sshtelnet-mp/conf/service.properties.template
trunk/geant2_java-sshtelnet-mp/doc/changelog.txt
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/encryption/PasswordEncryptor.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoKeyAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoSshAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperKeyAdapter.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperSshAdapter.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/metadata/DbMetadataConfiguration.java
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/telnet/TelnetManager.java
Log:
updated the trunk to reflect the changes made for 1.3.3 (see changelog.txt)
also added the class for the internal checks (isn't used by anything else
yet) and started cleaning up the logs in some files
Modified: trunk/geant2_java-sshtelnet-mp/ant/const.properties
===================================================================
--- trunk/geant2_java-sshtelnet-mp/ant/const.properties 2008-06-18 10:33:12
UTC (rev 4018)
+++ trunk/geant2_java-sshtelnet-mp/ant/const.properties 2008-06-18 13:46:40
UTC (rev 4019)
@@ -11,7 +11,7 @@
service.name=geant2-java-sshtelnet-mp
jarfilename=perfsonar-sshtelnet-mp
-version=1.3.3RC1
+version=1.3.3
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: trunk/geant2_java-sshtelnet-mp/ant/const.properties.template
===================================================================
--- trunk/geant2_java-sshtelnet-mp/ant/const.properties.template
2008-06-18 10:33:12 UTC (rev 4018)
+++ trunk/geant2_java-sshtelnet-mp/ant/const.properties.template
2008-06-18 13:46:40 UTC (rev 4019)
@@ -11,7 +11,7 @@
service.name=geant2-java-sshtelnet-mp
jarfilename=perfsonar-sshtelnet-mp
-version=1.3.3RC1
+version=1.3.3
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:
trunk/geant2_java-sshtelnet-mp/conf/axis-1.4/WEB-INF/classes/perfsonar/conf/service.properties
===================================================================
---
trunk/geant2_java-sshtelnet-mp/conf/axis-1.4/WEB-INF/classes/perfsonar/conf/service.properties
2008-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/conf/axis-1.4/WEB-INF/classes/perfsonar/conf/service.properties
2008-06-18 13:46:40 UTC (rev 4019)
@@ -55,6 +55,10 @@
# Description=Type of service
service.r.type=mp
+# Group=Internal
+# Description=The path where the temporary token files will be stored (be
sure to make the path writable!)
+service.mp.tokenPath=/opt/perfsonar/services/geant2-java-sshtelnet-mp/WEB-INF/classes/perfsonar/
+
#LS properties
#-------------
@@ -80,7 +84,7 @@
# Group=LS
# Description=The version of the service
-service.r.service_version=1.3.3RC1
+service.r.service_version=1.3.3
# Group=LS
# Description=The e-mail address of the contact person for the service
Modified: trunk/geant2_java-sshtelnet-mp/conf/service.properties
===================================================================
--- trunk/geant2_java-sshtelnet-mp/conf/service.properties 2008-06-18
10:33:12 UTC (rev 4018)
+++ trunk/geant2_java-sshtelnet-mp/conf/service.properties 2008-06-18
13:46:40 UTC (rev 4019)
@@ -55,6 +55,10 @@
# Description=Type of service
service.r.type=mp
+# Group=Internal
+# Description=The path where the temporary token files will be stored (be
sure to make the path writable!)
+service.mp.tokenPath=/opt/perfsonar/services/geant2-java-sshtelnet-mp/WEB-INF/classes/perfsonar/
+
#LS properties
#-------------
@@ -80,7 +84,7 @@
# Group=LS
# Description=The version of the service
-service.r.service_version=1.3.3RC1
+service.r.service_version=1.3.3
# Group=LS
# Description=The e-mail address of the contact person for the service
Modified: trunk/geant2_java-sshtelnet-mp/conf/service.properties.template
===================================================================
--- trunk/geant2_java-sshtelnet-mp/conf/service.properties.template
2008-06-18 10:33:12 UTC (rev 4018)
+++ trunk/geant2_java-sshtelnet-mp/conf/service.properties.template
2008-06-18 13:46:40 UTC (rev 4019)
@@ -55,6 +55,10 @@
# Description=Type of service
service.r.type=mp
+# Group=Internal
+# Description=The path where the temporary token files will be stored (be
sure to make the path writable!)
+service.mp.tokenPath=/opt/perfsonar/services/geant2-java-sshtelnet-mp/WEB-INF/classes/perfsonar/
+
#LS properties
#-------------
@@ -80,7 +84,7 @@
# Group=LS
# Description=The version of the service
-service.r.service_version=1.3.3RC1
+service.r.service_version=1.3.3
# Group=LS
# Description=The e-mail address of the contact person for the service
Modified: trunk/geant2_java-sshtelnet-mp/doc/changelog.txt
===================================================================
--- trunk/geant2_java-sshtelnet-mp/doc/changelog.txt 2008-06-18 10:33:12
UTC (rev 4018)
+++ trunk/geant2_java-sshtelnet-mp/doc/changelog.txt 2008-06-18 13:46:40
UTC (rev 4019)
@@ -1,6 +1,13 @@
Change log
----------
+1.3.3 - 18/06/2008
+
+ * ps-base version: 1.0.20080310
+ * web-admin version: 0.8.3b
+ * fixed the design flaw which was related to the command parameters (had to
update the list of commands for this)
+ * added a parameter to the service.properties file, which defines a
directory to put the temporary token files
+
1.3.2 - 06/06/2008
* ps-base version: 1.0.20080310
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-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoBgpAdapter.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -70,6 +70,8 @@
// ---------------------- constructors
public CiscoBgpAdapter() throws PerfSONARException {
+
+
try {
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.LOGGER);
@@ -83,16 +85,14 @@
} catch (PerfSONARException e) {
-
logger.error("[CISCOBGPADAPTER][Constructor]"+e.getStackTrace().toString());
+
logger.error("[CiscoBgpAdapter][Constructor]"+e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Failed to obtain reference to the properties and/or
logger instances.");
}
- logger.debug("[CiscoBgpAdapter] Constructor started");
+ logger.info("[CiscoBgpAdapter] Constructor finished");
- logger.debug("[CiscoBgpAdapter] Constructor finished");
-
}// CiscoBgpAdapter
// ---------------------- public methods
@@ -101,7 +101,7 @@
*/
public List getAvailableSpecificCommands() {
- logger.debug("[CiscoBgpAdapter] getAvailableSpecificCommands
called");
+ logger.info("[CiscoBgpAdapter] getAvailableSpecificCommands called");
return availableSpecificCommands;
@@ -111,7 +111,7 @@
*/
public void setAvailableSpecificCommands(List availableSpecificCommands)
{
- logger.debug("[CiscoBgpAdapter] setAvailableSpecificCommand called");
+ logger.info("[CiscoBgpAdapter] setAvailableSpecificCommand called");
this.availableSpecificCommands = availableSpecificCommands;
@@ -121,7 +121,7 @@
*/
public void addAvailableSpecificCommand(BgpCommandInterface command) {
- logger.debug("[CiscoBgpAdapter] addAvailableSpecificCommand called");
+ logger.info("[CiscoBgpAdapter] addAvailableSpecificCommand called");
availableSpecificCommands.add(command);
@@ -132,7 +132,7 @@
public BgpCommandInterface getCommand(String description)
throws PerfSONARException {
- logger.debug("[CiscoBgpAdapter] getCommand called");
+ logger.info("[CiscoBgpAdapter] getCommand called");
BgpCommandInterface command = null;
Iterator it = availableSpecificCommands.iterator();
@@ -143,14 +143,14 @@
if (command.getDescription().equalsIgnoreCase(description)) {
- logger.debug("[CiscoBgpAdapter] Command found");
+ logger.debug("[CiscoBgpAdapter][getCommand] Command found: "
+ command);
return command;
}
}// while
-
- logger.error("[CiscoBgpAdapter] Command NOT found");
+ logger.debug("[CiscoBgpAdapter][getCommand] Command NOT found!");
+ logger.error("[CiscoBgpAdapter][getCommand] Command NOT found!");
throw new PerfSONARException("error.mp.sshtelnet.nosuchcommand",
"Requested command not found");
@@ -160,7 +160,7 @@
*/
public BgpCommandInterface executeCommand(BgpCommandInterface command) {
- logger.debug("[CiscoBgpAdapter] executeCommand called");
+ logger.info("[CiscoBgpAdapter] executeCommand called");
if (manager != null) {
@@ -174,7 +174,7 @@
}// if
- logger.info("NEW RESULT RETURNED");
+ logger.info("[CiscoBgpAdapter][executeCommand] New result returned");
cachedResults.add(command);
logger.debug("[CiscoBgpAdapter] executeCommand finished");
return command;
@@ -210,16 +210,16 @@
}
- logger.info("[CiscoBgpAdapter] Trying to connect");
+ logger.debug("[CiscoBgpAdapter][connect] Trying to connect");
manager.connect(username, "Username:",
PasswordEncryptor.decryptPassword(password), "Password:");
- logger.info("[CiscoBgpAdapter Login");
+ logger.debug("[CiscoBgpAdapter][connect] Logged in");
} catch (Exception e) {
logger.error("[CiscoBgpAdapter][Connect] Error occuring while
connecting");
- logger.error(e.getStackTrace().toString());
+ logger.error(e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.connect",
"Could not connect to underlying device");
@@ -271,7 +271,7 @@
*/
private void configureCommands(String subject) throws PerfSONARException
{
- logger.debug("[CiscoBgpAdapter] Configuring available operations
...");
+ logger.info("[CiscoBgpAdapter] Configuring available operations
...");
Iterator commands = null;
String token = null;
@@ -286,17 +286,16 @@
BgpCommand command = new BgpCommand(token,
properties.getProperty(subject, token, "command"));
try {
-
logger.debug("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties.getProperty(subject, token, "minParamCount"));
command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
-
logger.error("[CISCOBGPADAPTER][ConfigureCommands]"+e1.getStackTrace().toString());
+ logger.error("[CiscoBgpAdapter][ConfigureCommands]
MinParamCount not found: "+e1.getStackTrace()[0].toString());
}
try {
int maxParamCount =
Integer.parseInt(properties.getProperty(subject, token, "maxParamCount"));
command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
-
logger.error("[CISCOBGPADAPTER][ConfigureCommands]"+e1.getStackTrace().toString());
+ logger.error("[CiscoBgpAdapter][ConfigureCommands]
MaxParamCount not found: "+e1.getStackTrace()[0].toString());
}
command.setDeviceName(subject);
@@ -308,13 +307,13 @@
} catch (PerfSONARException e) {
-
logger.error("[CISCOBGPADAPTER][ConfigureCommands]"+e.getStackTrace().toString());
+ logger.error("[CiscoBgpAdapter][ConfigureCommands] Unable to
retrieve commands: "+e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Unable to retrieve commands");
}
- logger.debug("[CiscoBgpAdapter] Available operations configured");
+ logger.info("[CiscoBgpAdapter] Available operations configured");
}
@@ -374,7 +373,7 @@
public Message takeAction(String actionType, Message request)
throws PerfSONARException {
- logger.info("[CiscoBgpAdapter] Webservice takeAction call received");
+ logger.info("[CiscoBgpAdapter][takeAction] Webservice takeAction
call received");
Metadata[] metadata = request.getMetadataArray();
Subject s = metadata[0].getSubject();
@@ -382,13 +381,13 @@
EndPoint endpoint = (EndPoint) s.getChildArray()[0];
String subject = endpoint.getValue();
- logger.debug("SUBJECTSTRING: " + subject);
+ logger.debug("[CiscoBgpAdapter][takeAction] SubjectString: " +
subject);
EventType eventType = metadata[0].getEventType();
String eventTypeString = eventType.getEventType();
//eventTypeString =
eventTypeString.substring(ServicePropertiesConfigurator.EVENTTYPE_PREFIX.length()-1,
eventTypeString.lastIndexOf("/"));
- logger.debug("EVENTTYPESTRING: " + eventTypeString);
+ logger.debug("[CiscoBgpAdapter][takeAction] EventTypeString: " +
eventTypeString);
CiscoBgpAdapter adapter = new CiscoBgpAdapter();
@@ -408,20 +407,21 @@
} catch (NumberFormatException e1) {
-
logger.error("[CISCOBGPADAPTER][TakeAction]"+e1.getStackTrace().toString());
+ logger.error("[CiscoBgpAdapter][takeAction] One of the numbers
in the metadata" +
+ " configuration file is not parsable:
"+e1.getStackTrace()[0].toString());
throw new PerfSONARException(
"error.mp.sshtelnet.configuration",
- "Invalid port number in configuration");
+ "Invalid port number or cache or timeout value in
configuration");
} catch (PerfSONARException e1) {
-
logger.error("[CISCOBGPADAPTER][TakeAction]"+e1.getStackTrace().toString());
+
logger.error("[CiscoBgpAdapter][takeAction]"+e1.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Unable to retrieve connection details");
}
- logger.debug("[CiscoStatusAdapter] TelnetManager created: " + url +
" " + port);
+ logger.debug("[CiscoBgpAdapter][takeAction] TelnetManager created: "
+ url + " " + port);
try {
@@ -429,13 +429,13 @@
} catch (PerfSONARException e) {
-
logger.error("[CISCOBGPADAPTER][TakeAction]"+e.getStackTrace().toString());
+ logger.error("[CiscoBgpAdapter][takeAction] Unable to retrieve
prompt: "+e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Unable to retrieve prompt");
}
- logger.debug("[CiscoStatusAdapter] Prompt set in TelnetManager: " +
prompt);
+ logger.debug("[CiscoStatusAdapter][takeAction] Prompt set in
TelnetManager: " + prompt);
//This private method call will include all supported methods
//that can be performed on the remote device
@@ -455,7 +455,7 @@
Parameter param = parametersArray[i];
String parameter = param.getParameterValue();
- logger.debug("PARAMETERVALUE: " + parameter);
+ logger.debug("[CiscoBgpAdapter][takeAction] Parameter value:
" + parameter);
if (new ParameterChecker().checkParam(subject,
eventTypeString,
parameter)) {
@@ -479,12 +479,12 @@
if
(cachedCommand.getCommand().equalsIgnoreCase(bgpCommand.getCommand()) &&
cachedCommand.getParameterString().equalsIgnoreCase(bgpCommand.getParameterString())
&&
cachedCommand.getDeviceName().equalsIgnoreCase(bgpCommand.getDeviceName()) &&
cachedCommand.getTimestamp() + (caching * 1000) > System.currentTimeMillis())
{
- logger.info("CACHED RESULT RETURNED");
+ logger.info("[CiscoBgpAdapter][takeAction] Cached
result returned");
temp = cachedCommand.getResult();
} else if (cachedCommand.getTimestamp() + (caching *
1000) <= System.currentTimeMillis()) {
- logger.info("CACHED RESULT REMOVED");
+ logger.info("[CiscoBgpAdapter][takeAction] Cached
result removed");
it.remove();
}
@@ -515,12 +515,12 @@
if
(cachedCommand.getCommand().equalsIgnoreCase(bgpCommand.getCommand()) &&
cachedCommand.getParameterString().equalsIgnoreCase(bgpCommand.getParameterString())
&&
cachedCommand.getDeviceName().equalsIgnoreCase(bgpCommand.getDeviceName()) &&
cachedCommand.getTimestamp() + (caching * 1000) > System.currentTimeMillis())
{
- logger.info("CACHED RESULT RETURNED");
+ logger.info("[CiscoBgpAdapter][takeAction] Cached result
returned");
temp = cachedCommand.getResult();
} else if (cachedCommand.getTimestamp() + (caching * 1000)
<= System.currentTimeMillis()) {
- logger.info("CACHED RESULT REMOVED");
+ logger.info("[CiscoBgpAdapter][takeAction] Cached result
removed");
it.remove();
}
@@ -542,7 +542,7 @@
}
- logger.info("[CiscoBgpAdapter] Command executed succesfully");
+ logger.info("[CiscoBgpAdapter][takeAction] Command executed
succesfully");
Datum datum = new Datum();
if (valid) {
@@ -551,7 +551,7 @@
datum.setDatum(temp);
}
- logger.info("[CiscoBgpAdapter] Constructing response message");
+ logger.info("[CiscoBgpAdapter][takeAction] Constructing response
message");
Message response = new Message();
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-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoKeyBgpAdapter.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -70,6 +70,8 @@
// ---------------------- constructors
public CiscoKeyBgpAdapter() throws PerfSONARException {
+
+
try {
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.LOGGER);
@@ -84,13 +86,13 @@
} catch (PerfSONARException e) {
- logger.error("[CISCOKEYBGPADAPTER][Constructor]" +
e.getStackTrace().toString());
+ logger.error("[CiscoKeyBgpAdapter][Constructor]" +
e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Failed to obtain reference to the properties and/or
logger instances.");
}
- logger.debug("[CiscoKeyBgpAdapter] Constructor finished");
+ logger.info("[CiscoKeyBgpAdapter] Constructor finished");
}// CiscoKeyBgpAdapter
@@ -100,7 +102,7 @@
*/
public List getAvailableSpecificCommands() {
- logger.debug("[CiscoKeyBgpAdapter] getAvailableSpecificCommands
called");
+ logger.info("[CiscoKeyBgpAdapter] getAvailableSpecificCommands
called");
return availableSpecificCommands;
@@ -110,7 +112,7 @@
*/
public void setAvailableSpecificCommands(List availableSpecificCommands)
{
- logger.debug("[CiscoKeyBgpAdapter] setAvailableSpecificCommand
called");
+ logger.info("[CiscoKeyBgpAdapter] setAvailableSpecificCommand
called");
this.availableSpecificCommands = availableSpecificCommands;
@@ -120,7 +122,7 @@
*/
public void addAvailableSpecificCommand(BgpCommandInterface command) {
- logger.debug("[CiscoKeyBgpAdapter] addAvailableSpecificCommand
called");
+ logger.info("[CiscoKeyBgpAdapter] addAvailableSpecificCommand
called");
availableSpecificCommands.add(command);
@@ -131,7 +133,7 @@
public BgpCommandInterface getCommand(String description)
throws PerfSONARException {
- logger.debug("[CiscoKeyBgpAdapter] getCommand called");
+ logger.info("[CiscoKeyBgpAdapter] getCommand called");
BgpCommandInterface command = null;
Iterator it = availableSpecificCommands.iterator();
@@ -142,7 +144,7 @@
if (command.getDescription().equalsIgnoreCase(description)) {
- logger.debug("[CiscoKeyBgpAdapter] Command found");
+ logger.debug("[CiscoKeyBgpAdapter][getCommand] Command
found: " + command);
return command;
}
@@ -159,11 +161,10 @@
*/
public BgpCommandInterface executeCommand(BgpCommandInterface command) {
- logger.debug("[CiscoKeyBgpAdapter] executeCommand called");
+ logger.info("[CiscoKeyBgpAdapter] executeCommand called");
if (manager != null) {
- logger.info("Executing command");
String temp2 = manager.executeCommand(command.getCommand() + " "
+ command.getParameterString());
command.setResult(temp2);
@@ -171,9 +172,9 @@
}// if
- logger.info("NEW RESULT RETURNED");
+ logger.info("[CiscoKeyBgpAdapter][execute Command] New result
returned");
cachedResults.add(command);
- logger.debug("[JuniperStatusAdapter] executeCommand finished");
+ logger.debug("[CiscoKeyBgpAdapter] executeCommand finished");
return command;
}// executeCommand
@@ -205,19 +206,19 @@
} else manager = new SshKeyManager(url, username, keyUrl,
PasswordEncryptor.decryptPassword(passphrase), false, timeout);
}
- logger.info("[CiscoKeyBgpAdapter] Trying to connect");
+ logger.debug("[CiscoKeyBgpAdapter] Trying to connect");
//if (passphrase == null || passphrase.equals("")) {
//manager.connect(username, keyUrl);
//} else {
//manager.connect(username, keyUrl,
PasswordEncryptor.decryptPassword(passphrase));
//}
- logger.info("[CiscoKeyBgpAdapter] Login");
+ logger.debug("[CiscoKeyBgpAdapter][connect] Logged in");
} catch (Exception e) {
logger.error("[CiscoKeyBgpAdapter][Connect] Error occuring while
connecting");
- logger.error(e.getStackTrace().toString());
+ logger.error(e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.connect",
"Could not connect to underlying device");
}
@@ -268,7 +269,7 @@
*/
private void configureCommands(String subject) throws PerfSONARException
{
- logger.debug("[CiscoKeyBgpAdapter] Configuring available operations
...");
+ logger.info("[CiscoKeyBgpAdapter] Configuring available operations
...");
Iterator commands = null;
String token = null;
@@ -286,13 +287,13 @@
int minParamCount =
Integer.parseInt(properties.getProperty(subject, token, "minParamCount"));
command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
-
logger.error("[CiscoKeyBgpAdapter][ConfigureCommands]" +
e1.getStackTrace().toString());
+
logger.error("[CiscoKeyBgpAdapter][ConfigureCommands] MinParamCount not
found: " + e1.getStackTrace()[0].toString());
}
try {
int maxParamCount =
Integer.parseInt(properties.getProperty(subject, token, "maxParamCount"));
command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
-
logger.error("[CiscoKeyBgpAdapter][ConfigureCommands]" +
e1.getStackTrace().toString());
+
logger.error("[CiscoKeyBgpAdapter][ConfigureCommands] MaxParamCount not
found: " + e1.getStackTrace()[0].toString());
}
command.setDeviceName(subject);
@@ -304,13 +305,13 @@
} catch (PerfSONARException e) {
- logger.error("[CiscoKeyBgpAdapter][ConfigureCommands]" +
e.getStackTrace().toString());
+ logger.error("[CiscoKeyBgpAdapter][ConfigureCommands] Unable to
retrieve commands: " + e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Unable to retrieve commands");
}
- logger.debug("[CiscoKeyBgpAdapter] Available operations configured");
+ logger.info("[CiscoKeyBgpAdapter] Available operations configured");
}
@@ -378,14 +379,14 @@
EndPoint endpoint = (EndPoint) s.getChildArray()[0];
String subject = endpoint.getValue();
- logger.debug("SUBJECTSTRING: " + subject);
+ logger.debug("[CiscoKeyBgpAdapter][takeAction] SubjectString: " +
subject);
EventType eventType = metadata[0].getEventType();
String eventTypeString = eventType.getEventType();
//eventTypeString =
eventTypeString.substring(ServicePropertiesConfigurator.EVENTTYPE_PREFIX.length()-1,
eventTypeString.lastIndexOf("/"));
- logger.debug("EVENTTYPESTRING: " + eventTypeString);
+ logger.debug("[CiscoKeyBgpAdapter][takeAction] EventTypeString: " +
eventTypeString);
//CiscoKeyBgpAdapter adapter = new CiscoKeyBgpAdapter();
@@ -405,20 +406,21 @@
} catch (NumberFormatException e1) {
- logger.error("[CiscoKeyBgpAdapter][TakeAction]" +
e1.getStackTrace().toString());
+ logger.error("[CiscoKeyBgpAdapter][takeAction] One of the
numbers in the metadata " +
+ "configuration file is not parsable: " +
e1.getStackTrace()[0].toString());
throw new PerfSONARException(
"error.mp.sshtelnet.configuration",
- "Invalid port number in configuration");
+ "Invalid port number or cache or timeout value in
configuration");
} catch (PerfSONARException e1) {
- logger.error("[CiscoKeyBgpAdapter][TakeAction]" +
e1.getStackTrace().toString());
+ logger.error("[CiscoKeyBgpAdapter][takeAction]" +
e1.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Unable to retrieve connection details");
}
- logger.debug("[CiscoKeyBgpAdapter] TelnetManager created: " + url +
" " + port);
+ logger.debug("[CiscoKeyBgpAdapter][takeAction] SshKeyManager
created: " + url + " " + port);
// This private method call will include all supported methods
// that can be performed on the remote device
@@ -436,7 +438,7 @@
Parameter param = parametersArray[i];
String parameter = param.getParameterValue();
- logger.debug("PARAMETERVALUE: " + parameter);
+ logger.debug("[CiscoKeyBgpAdapter][takeAction] Parameter
value: " + parameter);
if (new ParameterChecker().checkParam(subject,
eventTypeString,
parameter)) {
@@ -460,12 +462,12 @@
if
(cachedCommand.getCommand().equalsIgnoreCase(bgpCommand.getCommand()) &&
cachedCommand.getParameterString().equalsIgnoreCase(bgpCommand.getParameterString())
&&
cachedCommand.getDeviceName().equalsIgnoreCase(bgpCommand.getDeviceName()) &&
cachedCommand.getTimestamp() + (caching * 1000) > System.currentTimeMillis())
{
- logger.info("CACHED RESULT RETURNED");
+ logger.info("[CiscoKeyBgpAdapter][takeAction] Cached
result returned");
temp = cachedCommand.getResult();
} else if (cachedCommand.getTimestamp() + (caching *
1000) <= System.currentTimeMillis()) {
- logger.info("CACHED RESULT REMOVED");
+ logger.info("[CiscoKeyBgpAdapter][takeAction] Cached
result removed");
it.remove();
}
@@ -496,12 +498,12 @@
if
(cachedCommand.getCommand().equalsIgnoreCase(bgpCommand.getCommand()) &&
cachedCommand.getParameterString().equalsIgnoreCase(bgpCommand.getParameterString())
&&
cachedCommand.getDeviceName().equalsIgnoreCase(bgpCommand.getDeviceName()) &&
cachedCommand.getTimestamp() + (caching * 1000) > System.currentTimeMillis())
{
- logger.info("CACHED RESULT RETURNED");
+ logger.info("[CiscoKeyBgpAdapter][takeAction] Cached
result returned");
temp = cachedCommand.getResult();
} else if (cachedCommand.getTimestamp() + (caching * 1000)
<= System.currentTimeMillis()) {
- logger.info("CACHED RESULT REMOVED");
+ logger.info("[CiscoKeyBgpAdapter][takeAction] Cached
result removed");
it.remove();
}
@@ -523,7 +525,7 @@
}
- logger.info("[CiscoKeyBgpAdapter] Command executed succesfully");
+ logger.info("[CiscoKeyBgpAdapter][takeAction] Command executed
succesfully");
Datum datum = new Datum();
@@ -533,7 +535,7 @@
datum.setDatum(temp);
}
- logger.info("[CiscoKeyBgpAdapter] Constructing response message");
+ logger.info("[CiscoKeyBgpAdapter][takeAction] Constructing response
message");
Message response = new Message();
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-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoSshBgpAdapter.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -82,16 +82,14 @@
} catch (PerfSONARException e) {
- logger.error("[CISCOSSHBGPADAPTER][Constructor]" +
e.getStackTrace().toString());
+ logger.error("[CiscoSshBgpAdapter][Constructor]" +
e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshYE.configuration",
"Failed to obtain reference to the properties and/or
logger instances.");
}
- logger.debug("[CiscoSshBgpAdapter] Constructor started");
+ logger.info("[CiscoSshBgpAdapter] Constructor finished");
- logger.debug("[CiscoSshBgpAdapter] Constructor finished");
-
}// CiscoSshBgpAdapter
// ---------------------- public methods
@@ -100,7 +98,7 @@
*/
public List getAvailableSpecificCommands() {
- logger.debug("[CiscoSshBgpAdapter] getAvailableSpecificCommands
called");
+ logger.info("[CiscoSshBgpAdapter] getAvailableSpecificCommands
called");
return availableSpecificCommands;
@@ -110,7 +108,7 @@
*/
public void setAvailableSpecificCommands(List availableSpecificCommands)
{
- logger.debug("[CiscoSshBgpAdapter] setAvailableSpecificCommand
called");
+ logger.info("[CiscoSshBgpAdapter] setAvailableSpecificCommand
called");
this.availableSpecificCommands = availableSpecificCommands;
@@ -120,7 +118,7 @@
*/
public void addAvailableSpecificCommand(BgpCommandInterface command) {
- logger.debug("[CiscoSshBgpAdapter] addAvailableSpecificCommand
called");
+ logger.info("[CiscoSshBgpAdapter] addAvailableSpecificCommand
called");
availableSpecificCommands.add(command);
@@ -131,7 +129,7 @@
public BgpCommandInterface getCommand(String description)
throws PerfSONARException {
- logger.debug("[CiscoSshBgpAdapter] getCommand called");
+ logger.info("[CiscoSshBgpAdapter] getCommand called");
BgpCommandInterface command = null;
Iterator it = availableSpecificCommands.iterator();
@@ -142,7 +140,7 @@
if (command.getDescription().equalsIgnoreCase(description)) {
- logger.debug("[CiscoSshBgpAdapter] Command found");
+ logger.debug("[CiscoSshBgpAdapter][getCommand] Command
found: " + command);
return command;
}
@@ -159,7 +157,7 @@
*/
public BgpCommandInterface executeCommand(BgpCommandInterface command) {
- logger.debug("[CiscoSshBgpAdapter] executeCommand called");
+ logger.info("[CiscoSshBgpAdapter] executeCommand called");
if (manager != null) {
@@ -169,7 +167,7 @@
}// if
- logger.info("NEW RESULT RETURNED");
+ logger.info("[CiscoSshBgpAdapter][execute Command] New result
returned");
cachedResults.add(command);
logger.debug("[CiscoSshBgpAdapter] executeCommand finished");
return command;
@@ -204,16 +202,16 @@
}
- logger.info("[CiscoSshBgpAdapter] Trying to connect");
+ logger.info("[CiscoSshBgpAdapter][connect] Trying to connect");
//manager.connect(username, "Username:",
PasswordEncryptor.decryptPassword(password), "Password:");
- logger.info("[CiscoSshBgpAdapter Login");
+ logger.info("[CiscoSshBgpAdapter][connect] Logged in");
} catch (Exception e) {
logger.error("[CiscoSshBgpAdapter] Error occuring while
connecting");
- logger.error(e.getStackTrace().toString());
+ logger.error(e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.connect",
"Could not connect to underlying device");
@@ -265,7 +263,7 @@
*/
private void configureCommands(String subject) throws PerfSONARException
{
- logger.debug("[CiscoSshBgpAdapter] Configuring available operations
...");
+ logger.info("[CiscoSshBgpAdapter] Configuring available operations
...");
Iterator commands = null;
String token = null;
@@ -284,13 +282,13 @@
int minParamCount =
Integer.parseInt(properties.getProperty(subject, token, "minParamCount"));
command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
-
logger.error("[CISCOSSHBGPADAPTER][ConfigureCommands]" +
e1.getStackTrace().toString());
+
logger.error("[CiscoSshBgpAdapter][ConfigureCommands] MinParamCount not
found: " + e1.getStackTrace()[0].toString());
}
try {
int maxParamCount =
Integer.parseInt(properties.getProperty(subject, token, "maxParamCount"));
command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
-
logger.error("[CISCOSSHBGPADAPTER][ConfigureCommands]" +
e1.getStackTrace().toString());
+
logger.error("[CiscoSshBgpAdapter][ConfigureCommands] MaxParamCount not
found: " + e1.getStackTrace()[0].toString());
}
command.setDeviceName(subject);
@@ -302,13 +300,13 @@
} catch (PerfSONARException e) {
- logger.error("[CISCOSSHBGPADAPTER][ConfigureCommands]" +
e.getStackTrace().toString());
+ logger.error("[CiscoSshBgpAdapter][ConfigureCommands] Unable to
retrieve commands: " + e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Unable to retrieve commands");
}
- logger.debug("[CiscoSshBgpAdapter] Available operations configured");
+ logger.info("[CiscoSshBgpAdapter] Available operations configured");
}
@@ -378,14 +376,14 @@
EndPoint endpoint = (EndPoint) s.getChildArray()[0];
String subject = endpoint.getValue();
- logger.debug("SUBJECTSTRING: " + subject);
+ logger.debug("[CiscoSshBgpAdapter][takeAction] SubjectString: " +
subject);
EventType eventType = metadata[0].getEventType();
String eventTypeString = eventType.getEventType();
//eventTypeString =
eventTypeString.substring(ServicePropertiesConfigurator.EVENTTYPE_PREFIX.length()-1,
eventTypeString.lastIndexOf("/"));
- logger.debug("EVENTTYPESTRING: " + eventTypeString);
+ logger.debug("[CiscoSshBgpAdapter][takeAction] EventTypeString: " +
eventTypeString);
//CiscoSshBgpAdapter adapter = new CiscoSshBgpAdapter();
@@ -407,20 +405,21 @@
} catch (NumberFormatException e1) {
- logger.error("[CISCOSSHBGPADAPTER][TakeAction]" +
e1.getStackTrace()[0].toString());
+ logger.error("[CiscoSshBgpAdapter][TakeAction] One of the
numbers in the metadata " +
+ "configuration file is not parsable: " +
e1.getStackTrace()[0].toString());
throw new PerfSONARException(
"error.mp.sshtelnet.configuration",
- "Invalid port number in configuration");
+ "Invalid port number or cache or timeout value in
configuration");
} catch (PerfSONARException e1) {
- logger.error("[CISCOSSHBGPADAPTER][TakeAction]" +
e1.getStackTrace()[0].toString());
+ logger.error("[CiscoSshBgpAdapter][TakeAction]" +
e1.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Unable to retrieve connection details");
}
- logger.debug("[CiscoStatusAdapter] SshManager created: " + url + " "
+ port);
+ logger.debug("[CiscoStatusAdapter][takeAction] SshManager created: "
+ url + " " + port);
//This private method call will include all supported methods
//that can be performed on the remote device
@@ -440,7 +439,7 @@
Parameter param = parametersArray[i];
String parameter = param.getParameterValue();
- logger.debug("PARAMETERVALUE: " + parameter);
+ logger.debug("[CiscoSshBgpAdapter][takeAction] Parameter
value: " + parameter);
if (new ParameterChecker().checkParam(subject,
eventTypeString,
parameter)) {
@@ -464,12 +463,12 @@
if
(cachedCommand.getCommand().equalsIgnoreCase(bgpCommand.getCommand()) &&
cachedCommand.getParameterString().equalsIgnoreCase(bgpCommand.getParameterString())
&&
cachedCommand.getDeviceName().equalsIgnoreCase(bgpCommand.getDeviceName()) &&
cachedCommand.getTimestamp() + (caching * 1000) > System.currentTimeMillis())
{
- logger.info("CACHED RESULT RETURNED");
+ logger.info("[CiscoSshBgpAdapter][takeAction] Cached
result returned");
temp = cachedCommand.getResult();
} else if (cachedCommand.getTimestamp() + (caching *
1000) <= System.currentTimeMillis()) {
- logger.info("CACHED RESULT REMOVED");
+ logger.info("[CiscoSshBgpAdapter][takeAction] Cached
result removed");
it.remove();
}
@@ -500,12 +499,12 @@
if
(cachedCommand.getCommand().equalsIgnoreCase(bgpCommand.getCommand()) &&
cachedCommand.getParameterString().equalsIgnoreCase(bgpCommand.getParameterString())
&&
cachedCommand.getDeviceName().equalsIgnoreCase(bgpCommand.getDeviceName()) &&
cachedCommand.getTimestamp() + (caching * 1000) > System.currentTimeMillis())
{
- logger.info("CACHED RESULT RETURNED");
+ logger.info("[CiscoSshBgpAdapter][takeAction] Cached
result returned");
temp = cachedCommand.getResult();
} else if (cachedCommand.getTimestamp() + (caching * 1000)
<= System.currentTimeMillis()) {
- logger.info("CACHED RESULT REMOVED");
+ logger.info("[CiscoSshBgpAdapter][takeAction] Cached
result removed");
it.remove();
}
@@ -527,7 +526,7 @@
}
- logger.info("[CiscoSshBgpAdapter] Command executed succesfully");
+ logger.info("[CiscoSshBgpAdapter][takeAction] Command executed
succesfully");
logger.debug("" + valid);
Datum datum = new Datum();
@@ -537,7 +536,7 @@
datum.setDatum(temp);
}
- logger.info("[CiscoSshBgpAdapter] Constructing response message");
+ logger.info("[CiscoSshBgpAdapter][takeAction] Constructing response
message");
Message response = new Message();
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-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperBgpAdapter.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -83,13 +83,13 @@
} catch (PerfSONARException e) {
- logger.error("[JUNIPERBGPADAPTER][Constructor]" +
e.getStackTrace().toString());
+ logger.error("[JuniperBgpAdapter][Constructor]" +
e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Failed to obtain reference to the properties and/or
logger instances.");
}
- logger.debug("[JuniperBgpAdapter] Constructor finished");
+ logger.info("[JuniperBgpAdapter] Constructor finished");
}// JuniperBgpAdapter
@@ -99,7 +99,7 @@
*/
public List getAvailableSpecificCommands() {
- logger.debug("[JuniperBgpAdapter] getAvailableSpecificCommands
called");
+ logger.info("[JuniperBgpAdapter] getAvailableSpecificCommands
called");
return availableSpecificCommands;
@@ -109,7 +109,7 @@
*/
public void setAvailableSpecificCommands(List availableSpecificCommands)
{
- logger.debug("[JuniperBgpAdapter] setAvailableSpecificCommand
called");
+ logger.info("[JuniperBgpAdapter] setAvailableSpecificCommand
called");
this.availableSpecificCommands = availableSpecificCommands;
@@ -119,7 +119,7 @@
*/
public void addAvailableSpecificCommand(BgpCommandInterface command) {
- logger.debug("[JuniperBgpAdapter] addAvailableSpecificCommand
called");
+ logger.info("[JuniperBgpAdapter] addAvailableSpecificCommand
called");
availableSpecificCommands.add(command);
@@ -130,7 +130,7 @@
public BgpCommandInterface getCommand(String description)
throws PerfSONARException {
- logger.debug("[JuniperBgpAdapter] getCommand called");
+ logger.info("[JuniperBgpAdapter] getCommand called");
BgpCommandInterface command = null;
Iterator it = availableSpecificCommands.iterator();
@@ -141,7 +141,7 @@
if (command.getDescription().equalsIgnoreCase(description)) {
- logger.debug("[JuniperBgpAdapter] Command found");
+ logger.debug("[JuniperBgpAdapter][getCommand] Command found:
" + command);
return command;
}
@@ -158,7 +158,7 @@
*/
public BgpCommandInterface executeCommand(BgpCommandInterface command) {
- logger.debug("[JuniperStatusAdapter] executeCommand called");
+ logger.info("[JuniperStatusAdapter] executeCommand called");
if (manager != null) {
@@ -173,9 +173,9 @@
}// if
- logger.info("NEW RESULT RETURNED");
+ logger.info("[JuniperBgpAdapter][executeCommand] New result
returned");
cachedResults.add(command);
- logger.debug("[JuniperStatusAdapter] executeCommand finished");
+ logger.debug("[JuniperBgpAdapter] executeCommand finished");
return command;
}// executeCommand
@@ -206,16 +206,17 @@
}
- logger.info("[JuniperBgpAdapter] Trying to connect");
+ logger.info("[JuniperBgpAdapter][connect] Trying to connect");
((TelnetManager)
manager).setPrompt(properties.getProperty(subject, "prompt"));
manager.connect(username, "login:",
PasswordEncryptor.decryptPassword(password), "Password:");
- logger.info("[JuniperBgpAdapter] Login");
+
+ logger.info("[JuniperBgpAdapter][connect] Logged in");
} catch (Exception e) {
logger.error("[JuniperBgpAdapter] Error occuring while
connecting");
- logger.error(e.getStackTrace().toString());
+ logger.error(e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.connect",
"Could not connect to underlying device");
@@ -267,7 +268,7 @@
*/
private void configureCommands(String subject) throws PerfSONARException
{
- logger.debug("[JuniperBgpAdapter] Configuring available operations
...");
+ logger.info("[JuniperBgpAdapter] Configuring available operations
...");
Iterator commands = null;
String token = null;
@@ -286,13 +287,13 @@
int minParamCount =
Integer.parseInt(properties.getProperty(subject, token, "minParamCount"));
command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
-
logger.error("[JUNIPERBGPADAPTER][ConfigureCommands]" +
e1.getStackTrace().toString());
+ logger.error("[JuniperBgpAdapter][ConfigureCommands]
MinParamCount not found: " + e1.getStackTrace()[0].toString());
}
try {
int maxParamCount =
Integer.parseInt(properties.getProperty(subject, token, "maxParamCount"));
command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
-
logger.error("[JUNIPERBGPADAPTER][ConfigureCommands]" +
e1.getStackTrace().toString());
+ logger.error("[JuniperBgpAdapter][ConfigureCommands]
MaxParamCount not found: " + e1.getStackTrace()[0].toString());
}
command.setDeviceName(subject);
@@ -304,13 +305,13 @@
} catch (PerfSONARException e) {
- logger.error("[JUNIPERBGPADAPTER][ConfigureCommands]" +
e.getStackTrace().toString());
+ logger.error("[JuniperBgpAdapter][ConfigureCommands] Unable to
retrieve commands: " + e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Unable to retrieve commands");
}
- logger.debug("[JuniperBgpAdapter] Available operations configured");
+ logger.info("[JuniperBgpAdapter] Available operations configured");
}
@@ -386,14 +387,14 @@
EndPoint endpoint = (EndPoint) s.getChildArray()[0];
String subject = endpoint.getValue();
- logger.debug("SUBJECTSTRING: " + subject);
+ logger.debug("[JuniperBgpAdapter][takeAction] SubjectString: " +
subject);
EventType eventType = metadata[0].getEventType();
String eventTypeString = eventType.getEventType();
//eventTypeString =
eventTypeString.substring(ServicePropertiesConfigurator.EVENTTYPE_PREFIX.length()-1,
eventTypeString.lastIndexOf("/"));
- logger.debug("EVENTTYPESTRING: " + eventTypeString);
+ logger.debug("[JuniperBgpAdapter][takeAction] EventTypeString: " +
eventTypeString);
JuniperBgpAdapter adapter = new JuniperBgpAdapter();
@@ -412,14 +413,15 @@
} catch (NumberFormatException e1) {
- logger.error("[JUNIPERBGPADAPTER][TakeAction]" +
e1.getStackTrace().toString());
+ logger.error("[JuniperBgpAdapter][TakeAction] One of the numbers
in the metadata " +
+ "configuration file is not parsable: " +
e1.getStackTrace()[0].toString());
throw new PerfSONARException(
"error.mp.sshtelnet.configuration",
- "Invalid port number in configuration");
+ "Invalid port number or cache or timeout value in
configuration");
} catch (PerfSONARException e1) {
- logger.error("[JUNIPERBGPADAPTER][TakeAction]" +
e1.getStackTrace().toString());
+ logger.error("[JuniperBgpAdapter][TakeAction]" +
e1.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Unable to retrieve connection details");
@@ -433,7 +435,7 @@
} catch (PerfSONARException e) {
- logger.error("[JUNIPERBGPADAPTER][TakeAction]" +
e.getStackTrace().toString());
+ logger.error("[JuniperBgpAdapter][TakeAction]" +
e.getStackTrace()[0].toString());
throw new PerfSONARException("error.mp.sshtelnet.configuration",
"Unable to retrieve prompt");
@@ -457,7 +459,7 @@
Parameter param = parametersArray[i];
String parameter = param.getParameterValue();
- logger.debug("PARAMETERVALUE: " + parameter);
+ logger.debug("[JuniperBgpAdapter][takeAction] Parameter
value: " + parameter);
if (new ParameterChecker().checkParam(subject,
eventTypeString,
parameter)) {
@@ -481,12 +483,12 @@
if
(cachedCommand.getCommand().equalsIgnoreCase(bgpCommand.getCommand()) &&
cachedCommand.getParameterString().equalsIgnoreCase(bgpCommand.getParameterString())
&&
cachedCommand.getDeviceName().equalsIgnoreCase(bgpCommand.getDeviceName()) &&
cachedCommand.getTimestamp() + (caching * 1000) > System.currentTimeMillis())
{
- logger.info("CACHED RESULT RETURNED");
+ logger.info("[JuniperBgpAdapter][takeAction] Cached
result returned");
temp = cachedCommand.getResult();
} else if (cachedCommand.getTimestamp() + (caching *
1000) <= System.currentTimeMillis()) {
- logger.info("CACHED RESULT REMOVED");
+ logger.info("[JuniperBgpAdapter][takeAction] Cached
result removed");
it.remove();
}
@@ -517,12 +519,12 @@
if
(cachedCommand.getCommand().equalsIgnoreCase(bgpCommand.getCommand()) &&
cachedCommand.getParameterString().equalsIgnoreCase(bgpCommand.getParameterString())
&&
cachedCommand.getDeviceName().equalsIgnoreCase(bgpCommand.getDeviceName()) &&
cachedCommand.getTimestamp() + (caching * 1000) > System.currentTimeMillis())
{
- logger.info("CACHED RESULT RETURNED");
+ logger.info("[JuniperBgpAdapter][takeAction] Cached
result returned");
temp = cachedCommand.getResult();
} else if (cachedCommand.getTimestamp() + (caching * 1000)
<= System.currentTimeMillis()) {
- logger.info("CACHED RESULT REMOVED");
+ logger.info("[JuniperBgpAdapter][takeAction] Cached
result removed");
it.remove();
}
@@ -544,7 +546,7 @@
}
- logger.info("[JuniperBgpAdapter] Command executed succesfully");
+ logger.info("[JuniperBgpAdapter][takeAction] Command executed
succesfully");
Datum datum = new Datum();
@@ -554,7 +556,7 @@
datum.setDatum(temp);
}
- logger.info("[JuniperBgpAdapter] Constructing response message");
+ logger.info("[JuniperBgpAdapter][takeAction] Constructing response
message");
Message response = new Message();
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/encryption/PasswordEncryptor.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/encryption/PasswordEncryptor.java
2008-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/encryption/PasswordEncryptor.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -68,6 +68,8 @@
ciphertext = desCipher.doFinal(cleartext);
+ System.out.println("CipherText: " + ciphertext);
+
return Base64.encode(ciphertext);
//System.out.println("result.length()" + result.length());
@@ -149,5 +151,12 @@
return result;
}
+ public static void main (String[] args) {
+ //String encrypt = encryptPassword(args[0]);
+ //System.out.println("Encrypted Password : " + encrypt);
+
+ //System.out.println("Decrypted string: " + decryptPassword(encrypt));
+ System.out.println("Decrypted string: " + decryptPassword(args[0]));
+ }
}
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoAdapter.java
2008-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoAdapter.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -22,6 +22,7 @@
import org.ggf.ns.nmwg.topology.v2_0.EndPoint;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
+import
org.perfsonar.base.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -50,6 +51,7 @@
// ---------------------- class-fields
private LoggerComponent logger = null;
+ private ConfigurationComponent configuration = null;
private MetadataConfiguration properties = null;
private CiscoIpAdapter ciscoIpAdapter = null;
private CiscoIpv6Adapter ciscoIpv6Adapter = null;
@@ -68,6 +70,8 @@
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";
+ this.configuration = (ConfigurationComponent)
AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.CONFIG);
+
ciscoIpAdapter = new CiscoIpAdapter();
ciscoIpv6Adapter = new CiscoIpv6Adapter();
ciscoStatusAdapter = new CiscoStatusAdapter();
@@ -135,19 +139,24 @@
long rateLong = Long.parseLong(rate);
try {
- FileInputStream in = new FileInputStream("token_" +
subjectString);
+ String path =
configuration.getProperty("service.mp.tokenPath");
+ if (!path.endsWith("/"))
+ path = path + "/";
+ FileInputStream in = new FileInputStream(path + "token_" +
subjectString);
ObjectInputStream is = new ObjectInputStream(in);
last = is.readLong();
is.close();
- FileOutputStream out = new FileOutputStream("token_" +
subjectString);
+ FileOutputStream out = new FileOutputStream(path + "token_" +
subjectString);
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeLong(System.currentTimeMillis());
s.flush();
} catch (FileNotFoundException e) {
-
+ String path =
configuration.getProperty("service.mp.tokenPath");
+ if (!path.endsWith("/"))
+ path = path + "/";
try {
- FileOutputStream out = new FileOutputStream("token_" +
subjectString);
+ FileOutputStream out = new FileOutputStream(path + "token_"
+ subjectString);
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeLong(System.currentTimeMillis());
s.flush();
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoKeyAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoKeyAdapter.java
2008-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoKeyAdapter.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -22,6 +22,7 @@
import org.ggf.ns.nmwg.topology.v2_0.EndPoint;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
+import
org.perfsonar.base.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -50,6 +51,7 @@
// ---------------------- class-fields
private LoggerComponent logger = null;
+ private ConfigurationComponent configuration = null;
private MetadataConfiguration properties = null;
private CiscoKeyIpAdapter ciscoKeyIpAdapter = null;
private CiscoKeyIpv6Adapter ciscoKeyIpv6Adapter = null;
@@ -68,6 +70,8 @@
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";
+ this.configuration = (ConfigurationComponent)
AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.CONFIG);
+
ciscoKeyIpAdapter = new CiscoKeyIpAdapter();
ciscoKeyIpv6Adapter = new CiscoKeyIpv6Adapter();
ciscoKeyStatusAdapter = new CiscoKeyStatusAdapter();
@@ -134,19 +138,24 @@
long rateLong = Long.parseLong(rate);
try {
- FileInputStream in = new FileInputStream("token_" +
subjectString);
+ String path =
configuration.getProperty("service.mp.tokenPath");
+ if (!path.endsWith("/"))
+ path = path + "/";
+ FileInputStream in = new FileInputStream(path + "token_" +
subjectString);
ObjectInputStream is = new ObjectInputStream(in);
last = is.readLong();
is.close();
- FileOutputStream out = new FileOutputStream("token_" +
subjectString);
+ FileOutputStream out = new FileOutputStream(path + "token_" +
subjectString);
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeLong(System.currentTimeMillis());
s.flush();
} catch (FileNotFoundException e) {
-
+ String path =
configuration.getProperty("service.mp.tokenPath");
+ if (!path.endsWith("/"))
+ path = path + "/";
try {
- FileOutputStream out = new FileOutputStream("token_" +
subjectString);
+ FileOutputStream out = new FileOutputStream(path + "token_"
+ subjectString);
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeLong(System.currentTimeMillis());
s.flush();
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoSshAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoSshAdapter.java
2008-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoSshAdapter.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -30,6 +30,7 @@
import org.ggf.ns.nmwg.topology.v2_0.EndPoint;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
+import
org.perfsonar.base.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -61,6 +62,8 @@
// ---------------------- class-fields
private LoggerComponent logger = null;
+
+ private ConfigurationComponent configuration = null;
private MetadataConfiguration properties = null;
@@ -85,7 +88,9 @@
properties.initStorage();
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";
-
+
+ this.configuration = (ConfigurationComponent)
AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.CONFIG);
+
ciscoSshIpAdapter = new CiscoSshIpAdapter();
ciscoSshIpv6Adapter = new CiscoSshIpv6Adapter();
ciscoSshStatusAdapter = new CiscoSshStatusAdapter();
@@ -155,20 +160,25 @@
long rateLong = Long.parseLong(rate);
try {
- FileInputStream in = new FileInputStream("token_" +
subjectString);
+ String path =
configuration.getProperty("service.mp.tokenPath");
+ if (!path.endsWith("/"))
+ path = path + "/";
+ FileInputStream in = new FileInputStream(path +
"token_" + subjectString);
ObjectInputStream is = new ObjectInputStream(in);
last = is.readLong();
is.close();
- FileOutputStream out = new FileOutputStream("token_"
+ FileOutputStream out = new FileOutputStream(path +
"token_"
+ subjectString);
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeLong(System.currentTimeMillis());
s.flush();
} catch (FileNotFoundException e) {
-
+ String path =
configuration.getProperty("service.mp.tokenPath");
+ if (!path.endsWith("/"))
+ path = path + "/";
try {
- FileOutputStream out = new
FileOutputStream("token_"
+ FileOutputStream out = new
FileOutputStream(path + "token_"
+ subjectString);
ObjectOutputStream s = new
ObjectOutputStream(out);
s.writeLong(System.currentTimeMillis());
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperAdapter.java
2008-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperAdapter.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -22,6 +22,7 @@
import org.ggf.ns.nmwg.topology.v2_0.EndPoint;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
+import
org.perfsonar.base.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -50,6 +51,7 @@
// ---------------------- class-fields
private LoggerComponent logger = null;
+ private ConfigurationComponent configuration = null;
private MetadataConfiguration properties = null;
private JuniperIpAdapter juniperIpAdapter = null;
private JuniperIpv6Adapter juniperIpv6Adapter = null;
@@ -68,6 +70,8 @@
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";
+ this.configuration = (ConfigurationComponent)
AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.CONFIG);
+
juniperIpAdapter = new JuniperIpAdapter();
juniperIpv6Adapter = new JuniperIpv6Adapter();
juniperStatusAdapter = new JuniperStatusAdapter();
@@ -135,19 +139,24 @@
long rateLong = Long.parseLong(rate);
try {
- FileInputStream in = new FileInputStream("token_" +
subjectString);
+ String path =
configuration.getProperty("service.mp.tokenPath");
+ if (!path.endsWith("/"))
+ path = path + "/";
+ FileInputStream in = new FileInputStream(path + "token_" +
subjectString);
ObjectInputStream is = new ObjectInputStream(in);
last = is.readLong();
is.close();
- FileOutputStream out = new FileOutputStream("token_" +
subjectString);
+ FileOutputStream out = new FileOutputStream(path + "token_" +
subjectString);
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeLong(System.currentTimeMillis());
s.flush();
} catch (FileNotFoundException e) {
-
+ String path =
configuration.getProperty("service.mp.tokenPath");
+ if (!path.endsWith("/"))
+ path = path + "/";
try {
- FileOutputStream out = new FileOutputStream("token_" +
subjectString);
+ FileOutputStream out = new FileOutputStream(path + "token_"
+ subjectString);
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeLong(System.currentTimeMillis());
s.flush();
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperKeyAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperKeyAdapter.java
2008-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperKeyAdapter.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -22,6 +22,7 @@
import org.ggf.ns.nmwg.topology.v2_0.EndPoint;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
+import
org.perfsonar.base.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -52,6 +53,8 @@
private LoggerComponent logger = null;
+ private ConfigurationComponent configuration = null;
+
private MetadataConfiguration properties = null;
private JuniperKeyIpAdapter juniperKeyIpAdapter = null;
@@ -76,6 +79,8 @@
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";
+ this.configuration = (ConfigurationComponent)
AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.CONFIG);
+
juniperKeyIpAdapter = new JuniperKeyIpAdapter();
juniperKeyIpv6Adapter = new JuniperKeyIpv6Adapter();
juniperKeyStatusAdapter = new
JuniperKeyStatusAdapter();
@@ -144,20 +149,25 @@
long rateLong = Long.parseLong(rate);
try {
- FileInputStream in = new FileInputStream("token_" +
subjectString);
+ String path =
configuration.getProperty("service.mp.tokenPath");
+ if (!path.endsWith("/"))
+ path = path + "/";
+ FileInputStream in = new FileInputStream(path +
"token_" + subjectString);
ObjectInputStream is = new ObjectInputStream(in);
last = is.readLong();
is.close();
- FileOutputStream out = new FileOutputStream("token_"
+ FileOutputStream out = new FileOutputStream(path +
"token_"
+ subjectString);
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeLong(System.currentTimeMillis());
s.flush();
} catch (FileNotFoundException e) {
-
+ String path =
configuration.getProperty("service.mp.tokenPath");
+ if (!path.endsWith("/"))
+ path = path + "/";
try {
- FileOutputStream out = new
FileOutputStream("token_"
+ FileOutputStream out = new
FileOutputStream(path + "token_"
+ subjectString);
ObjectOutputStream s = new
ObjectOutputStream(out);
s.writeLong(System.currentTimeMillis());
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperSshAdapter.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperSshAdapter.java
2008-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperSshAdapter.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -22,6 +22,7 @@
import org.ggf.ns.nmwg.topology.v2_0.EndPoint;
import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
import org.perfsonar.base.auxiliary.ComponentNames;
+import
org.perfsonar.base.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -54,6 +55,8 @@
private MetadataConfiguration properties = null;
+ private ConfigurationComponent configuration = null;
+
private JuniperSshIpAdapter juniperSshIpAdapter = null;
private JuniperSshIpv6Adapter juniperSshIpv6Adapter = null;
@@ -76,6 +79,8 @@
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";
+ this.configuration = (ConfigurationComponent)
AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.CONFIG);
+
juniperSshIpAdapter = new JuniperSshIpAdapter();
juniperSshIpv6Adapter = new JuniperSshIpv6Adapter();
juniperSshStatusAdapter = new
JuniperSshStatusAdapter();
@@ -144,20 +149,25 @@
long rateLong = Long.parseLong(rate);
try {
- FileInputStream in = new FileInputStream("token_" +
subjectString);
+ String path =
configuration.getProperty("service.mp.tokenPath");
+ if (!path.endsWith("/"))
+ path = path + "/";
+ FileInputStream in = new FileInputStream(path +
"token_" + subjectString);
ObjectInputStream is = new ObjectInputStream(in);
last = is.readLong();
is.close();
- FileOutputStream out = new FileOutputStream("token_"
+ FileOutputStream out = new FileOutputStream(path +
"token_"
+ subjectString);
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeLong(System.currentTimeMillis());
s.flush();
} catch (FileNotFoundException e) {
-
+ String path =
configuration.getProperty("service.mp.tokenPath");
+ if (!path.endsWith("/"))
+ path = path + "/";
try {
- FileOutputStream out = new
FileOutputStream("token_"
+ FileOutputStream out = new
FileOutputStream(path + "token_"
+ subjectString);
ObjectOutputStream s = new
ObjectOutputStream(out);
s.writeLong(System.currentTimeMillis());
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-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/WebserviceEngineAdapter.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -153,13 +153,13 @@
if (deviceElementOK && devices.contains(value)) {
logger.debug("Device: " + value);
- logger.debug("Device index: " +
devices.indexOf(value));
- logger.debug("Size of Count: " + count.length +
"\nindex of device: " + devices.indexOf(value));
+ //logger.debug("Device index: " +
devices.indexOf(value));
+ //logger.debug("Size of Count: " + count.length +
"\nindex of device: " + devices.indexOf(value));
count[devices.indexOf(value)]++;
- logger.debug("Count["+ devices.indexOf(value) + "]: "
+ count[devices.indexOf(value)]);
- logger.debug("Size of currentDevices: " +
currentDevices.length + "\nindex : " + i);
+ //logger.debug("Count["+ devices.indexOf(value) + "]:
" + count[devices.indexOf(value)]);
+ //logger.debug("Size of currentDevices: " +
currentDevices.length + "\nindex : " + i);
currentDevices[i] = devices.indexOf(value);
//contains the indexes of the devices in use
- logger.debug("currentDevices["+i+"]: " +
currentDevices[i]);
+ //logger.debug("currentDevices["+i+"]: " +
currentDevices[i]);
logger.debug("Number of current connections for
device \"" + value + "\": " + count[currentDevices[i]]);
@@ -371,7 +371,6 @@
metaparam.setParameterValue(configuration.getProperty(token,
"url"));
} catch (PerfSONARException e1) {
logger.debug("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse]
url parameter not found for device: "+ token);
-
logger.error("[WEBSERVICEENGINEADAPTER][CreateServiceCapabilitiesResponse] "+
e1.getStackTrace()[0].toString());
}
metaParams.addChild(metaparam);
@@ -408,7 +407,6 @@
param1.setParameterValue(configuration.getProperty(token, innerToken,
"description"));
} catch (PerfSONARException e) {
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();
@@ -418,7 +416,6 @@
param2.setParameterValue(configuration.getProperty(token, innerToken,
"syntax"));
} catch (PerfSONARException e) {
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();
@@ -428,7 +425,6 @@
param3.setParameterValue(configuration.getProperty(token, innerToken,
"command"));
} catch (PerfSONARException e) {
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);
Added:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/internalChecks/InternalChecker.java
Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata/DbMetadataConfiguration.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata/DbMetadataConfiguration.java
2008-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata/DbMetadataConfiguration.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -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 = "";
@@ -197,7 +197,7 @@
query += "return data($i)";
}
- logger.debug("[DbMetadataConfiguration] query: " + query);
+ //logger.debug("[DbMetadataConfiguration] query: " + query);
Object object = null;
try {
@@ -217,7 +217,7 @@
"DbMetadataConfiguration.getProperties: " + "Result
array of metadata search in null");
}
- logger.debug("DbMetadataConfiguration.getProperties: " + "The number
of elements returned as a result of xquery statement: " + xmlResults.length);
+ //logger.debug("DbMetadataConfiguration.getProperties: " + "The
number of elements returned as a result of xquery statement: " +
xmlResults.length);
if (xmlResults.length == 0) {
throw new PerfSONARException(
@@ -338,7 +338,7 @@
xmldbAccess, dataRepository);
storageManager.setResultType(
XmlDbStorageManager.STRING_ARRAY_TYPE);
-
+
return storageManager;
}
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-06-18 10:33:12 UTC (rev 4018)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/remote/telnet/TelnetManager.java
2008-06-18 13:46:40 UTC (rev 4019)
@@ -123,6 +123,7 @@
telnet.connect(url, port);
logger.debug("Logging in ...");
telnet.login(userName, loginPrompt, passwd, passwdPrompt);
+
logger.debug("logged in !!");
} catch (IOException e) {
- perfsonar: r4019 - in trunk/geant2_java-sshtelnet-mp: ant conf conf/axis-1.4/WEB-INF/classes/perfsonar/conf doc src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/encryption src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/internalChecks src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata src/main/java/org/perfsonar/service/measurementPoint/remote/telnet, svnlog, 06/18/2008
Archive powered by MHonArc 2.6.16.