Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r3151 - in trunk/geant2_java-sshtelnet-mp: ant conf conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters 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/engine/commands 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/metadata src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters

Subject: perfsonar development work

List archive

perfsonar: r3151 - in trunk/geant2_java-sshtelnet-mp: ant conf conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters 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/engine/commands 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/metadata src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r3151 - in trunk/geant2_java-sshtelnet-mp: ant conf conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters 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/engine/commands 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/metadata src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters
  • Date: Wed, 19 Dec 2007 06:02:04 -0500

Author: melis
Date: 2007-12-19 06:02:01 -0500 (Wed, 19 Dec 2007)
New Revision: 3151

Added:

trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata/

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/MetadataConfiguration.java
Removed:
trunk/geant2_java-sshtelnet-mp/conf/quaggabgpcommands.txt
trunk/geant2_java-sshtelnet-mp/conf/quaggaipcommands.txt
trunk/geant2_java-sshtelnet-mp/conf/quaggaipv6commands.txt
trunk/geant2_java-sshtelnet-mp/conf/quaggaminimumpackage.txt
trunk/geant2_java-sshtelnet-mp/conf/quaggastatuscommand.txt

trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/QuaggaAdapter.java
Modified:
trunk/geant2_java-sshtelnet-mp/ant/axis-deploy-targets.xml
trunk/geant2_java-sshtelnet-mp/ant/configure-targets.xml
trunk/geant2_java-sshtelnet-mp/ant/libs-download-targets.xml
trunk/geant2_java-sshtelnet-mp/conf/juniperipcommands.txt

trunk/geant2_java-sshtelnet-mp/conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.class

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/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/engine/commands/ParameterChecker.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
Log:
Added ongoing development

Modified: trunk/geant2_java-sshtelnet-mp/ant/axis-deploy-targets.xml
===================================================================
--- trunk/geant2_java-sshtelnet-mp/ant/axis-deploy-targets.xml 2007-12-18
19:02:30 UTC (rev 3150)
+++ trunk/geant2_java-sshtelnet-mp/ant/axis-deploy-targets.xml 2007-12-19
11:02:01 UTC (rev 3151)
@@ -50,7 +50,7 @@
depends="copy-dep-base-service-jars">

<copy
file="${basedir}/lib/repository/nmwg/nmwg/1.0.20071008/nmwg-1.0.20071008.jar"
todir="${service.home}/${deploy.root}/WEB-INF/lib"/>
- <copy
file="${basedir}/lib/repository/perfsonar/perfsonar-base/1.0.20071107/perfsonar-base-1.0.20071107.jar"
todir="${service.home}/${deploy.root}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/perfsonar/perfsonar-base/1.0.20071121/perfsonar-base-1.0.20071121.jar"
todir="${service.home}/${deploy.root}/WEB-INF/lib"/>

<copy file="${basedir}/conf/eventType-map.xml"
todir="${service.home}/${deploy.root}/WEB-INF/classes/perfsonar/conf"/>
<copy file="${basedir}/conf/eventType-rules.xml"
todir="${service.home}/${deploy.root}/WEB-INF/classes/perfsonar/conf"/>

Modified: trunk/geant2_java-sshtelnet-mp/ant/configure-targets.xml
===================================================================
--- trunk/geant2_java-sshtelnet-mp/ant/configure-targets.xml 2007-12-18
19:02:30 UTC (rev 3150)
+++ trunk/geant2_java-sshtelnet-mp/ant/configure-targets.xml 2007-12-19
11:02:01 UTC (rev 3151)
@@ -70,8 +70,11 @@
<fileset
dir="./lib/repository/wss4j/wss4j/1.5.1">
<include name="*.jar"/>
</fileset>
+ <fileset
dir="./lib/repository/jdom/jdom/1.0b8">
+ <include name="*.jar"/>
+ </fileset>
</classpath>
- <arg value="../conf/service.properties"/>
+ <arg value="../conf/metadata.xml"/>
</java>

<propertyfile file="${basedir}/conf/service.properties">
@@ -83,14 +86,24 @@

<!-- for LookupInfoRequest message -->
<entry key="service.r.service_type" value="mp"/>
+ <entry key="service.r.type" value="mp"/>
<entry key="service.r.service_name"
value="${service.name}"/>
<entry key="service.r.service_version"
value="${version}"/>

+ <entry key="service.mp.message_types"
value="SetupDataRequest,MetadataKeyRequest,EchoRequest"/>
+
<entry key="service.as.authn_active"
value="on"/>
<entry key="service.as.authn_for_msg_types"
value="SetupDataRequest,MetadataKeyRequest"/>
<entry key="service.as.point"

value="http://homer.rediris.es:8080/perfSONAR-AS/services/AuthService"/>

<entry key="service.mp.class_name"
value="org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters.WebserviceEngineAdapter"/>
+
+ <entry key="component.mp.xmldb.db_uri"
value="xmldb:exist://localhost:8680/exist/xmlrpc"/>
+ <entry key="component.mp.xmldb.db_uri.xmlrpc"
value="xmldb:exist://localhost:8680/exist/xmlrpc"/>
+ <entry key="component.mp.xmldb.db_username"
value="sshtelnet"/>
+ <entry key="component.mp.xmldb.db_password"
value="sshtelnet"/>
+ <entry key="component.mp.xmldb.db_access"
value="xmlrpc"/>
+ <entry key="component.mp.xmldb.metadata_file_name"
value="metadata.xml"/>
</propertyfile>

</target>

Modified: trunk/geant2_java-sshtelnet-mp/ant/libs-download-targets.xml
===================================================================
--- trunk/geant2_java-sshtelnet-mp/ant/libs-download-targets.xml
2007-12-18 19:02:30 UTC (rev 3150)
+++ trunk/geant2_java-sshtelnet-mp/ant/libs-download-targets.xml
2007-12-19 11:02:01 UTC (rev 3151)
@@ -60,7 +60,7 @@
<artifact:dependencies>

<dependency groupId="rrdjtool" artifactId="rrdjtool"
version="1.0"/>
- <dependency groupId="perfsonar" artifactId="perfsonar-base"
version="1.0.20071107"/>
+ <dependency groupId="perfsonar" artifactId="perfsonar-base"
version="1.0.20071121"/>
<dependency groupId="nmwg" artifactId="nmwg"
version="1.0.20071008"/>

<localRepository refid="local.repository"/>

Modified: trunk/geant2_java-sshtelnet-mp/conf/juniperipcommands.txt
===================================================================
--- trunk/geant2_java-sshtelnet-mp/conf/juniperipcommands.txt 2007-12-18
19:02:30 UTC (rev 3150)
+++ trunk/geant2_java-sshtelnet-mp/conf/juniperipcommands.txt 2007-12-19
11:02:01 UTC (rev 3151)
@@ -9,7 +9,7 @@
IP_RPF@@@show multicast rpf@@@1@@@1@@@cache@@@display RPF information for
<ip address>@@@<ip
address>@@@^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(\/[0-9]{1,2})?$
IP_SAP@@@show multicast sessions@@@0@@@0@@@cache@@@display the SAP
cache@@@---@@@---
IP_SAP_DETAIL@@@show multicast sessions detail@@@0@@@0@@@cache@@@displays
the SAP cache details@@@---@@@---
-IP_PING@@@ping rapid count 5@@@4@@@4@@@cache@@@ping an <ip address>@@@<ip
address>@@@^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(\/[0-9]{1,2})?$
+IP_PING@@@ping rapid count 5@@@1@@@1@@@cache@@@ping an <ip address>@@@<ip
address>@@@^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(\/[0-9]{1,2})?$
IP_TRACEROUTE@@@traceroute@@@1@@@1@@@cache@@@trace the IPv4 path to <ip
address>@@@<ip
address>@@@^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(\/[0-9]{1,2})?$
IP_TRACEROUTE_MULTICAST@@@mtrace@@@1@@@1@@@cache@@@trace the path of a
packet from the specified source interface to the receivers of the multicast
traffic@@@<ip
address>@@@^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(\/[0-9]{1,2})?$
IP_SHOW_VRF@@@show configuration routing-instance@@@1@@@1@@@cache@@@display
VPN Routing/Forwarding instance information@@@<routing-instance name>@@@---

Modified:
trunk/geant2_java-sshtelnet-mp/conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/ServicePropertiesConfigurator.class
===================================================================
(Binary files differ)

Deleted: trunk/geant2_java-sshtelnet-mp/conf/quaggabgpcommands.txt

Deleted: trunk/geant2_java-sshtelnet-mp/conf/quaggaipcommands.txt

Deleted: trunk/geant2_java-sshtelnet-mp/conf/quaggaipv6commands.txt

Deleted: trunk/geant2_java-sshtelnet-mp/conf/quaggaminimumpackage.txt

Deleted: trunk/geant2_java-sshtelnet-mp/conf/quaggastatuscommand.txt

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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoBgpAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -8,7 +8,6 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.util.StringTokenizer;

import org.ggf.ns.nmwg.base.v2_0.Data;
import org.ggf.ns.nmwg.base.v2_0.Datum;
@@ -21,7 +20,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +28,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.bgp.commands.BgpCommandInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.encryption.PasswordEncryptor;
import
org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands.ParameterChecker;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.telnet.TelnetManager;

@@ -71,7 +71,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -86,9 +86,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

//FOR LOCAL TESTING
@@ -215,24 +214,19 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ .getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject,"port"));
+ prompt =
properties.getProperty(subject,"prompt");
+ username =
properties.getProperty(subject,"username");
+ password =
properties.getProperty(subject,"password");
+ caching =
Integer.parseInt(properties.getProperty(subject,"cache"));

//System.out.println(username);
//System.out.println(password);

manager = new TelnetManager(url, port, false);
((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp."
+ subject + ".prompt"));
+
.getProperty(subject,"prompt"));

}

@@ -303,35 +297,29 @@

logger.debug("[CiscoBgpAdapter] Configuring available
operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands =
properties.getProperties(subject,"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("BGP")) {

BgpCommand command = new
BgpCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+
.getProperty(subject,token, "command"));
try {

//System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject,token,"maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -437,13 +425,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject,"url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);

@@ -468,7 +453,7 @@
try {

((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp." +
subject + ".prompt"));
+ .getProperty(subject, "prompt"));

} catch (PerfSONARException e) {


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoKeyBgpAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.bgp.commands.BgpCommandInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.encryption.PasswordEncryptor;
import
org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands.ParameterChecker;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.ssh.SshKeyManager;

@@ -73,7 +74,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -88,8 +89,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -216,19 +217,13 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- keyUrl =
properties.getProperty("service.r.mp." + subject
- + ".keyUrl");
- passphrase =
properties.getProperty("service.r.mp." + subject
- + ".passphrase");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ .getProperty(subject,"url");
+ port =
Integer.parseInt(properties.getProperty(subject,"port"));
+ prompt =
properties.getProperty(subject,"prompt");
+ username =
properties.getProperty(subject,"username");
+ keyUrl =
properties.getProperty(subject,"keyUrl");
+ passphrase =
properties.getProperty(subject,"passphrase");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username,
keyUrl, false);

@@ -304,34 +299,28 @@
logger
.debug("[CiscoKeyBgpAdapter] Configuring
available operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("BGP")) {

BgpCommand command = new
BgpCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -437,17 +426,12 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- username = properties.getProperty("service.r.mp." +
subject
- + ".username");
- keyUrl = properties.getProperty("service.r.mp." +
subject
- + ".keyUrl");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject,"port"));
+ prompt = properties.getProperty(subject, "prompt");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject, "keyUrl");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username, keyUrl,
false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/CiscoSshBgpAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.bgp.commands.BgpCommandInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.encryption.PasswordEncryptor;
import
org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands.ParameterChecker;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.ssh.SshManager;

@@ -71,7 +72,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -86,9 +87,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

//FOR LOCAL TESTING
@@ -211,17 +211,12 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ .getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ password = properties.getProperty(subject,
"password");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

//System.out.println(username);
//System.out.println(password);
@@ -297,35 +292,29 @@

logger.debug("[CiscoSshBgpAdapter] Configuring available
operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("BGP")) {

BgpCommand command = new
BgpCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {

//System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -429,13 +418,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperBgpAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.bgp.commands.BgpCommandInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.encryption.PasswordEncryptor;
import
org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands.ParameterChecker;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.telnet.TelnetManager;

@@ -71,7 +72,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -86,8 +87,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -214,28 +215,23 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ .getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ password = properties.getProperty(subject,
"password");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);
((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp."
+ subject + ".prompt"));
+ .getProperty(subject,
"prompt"));

}

logger.info("[JuniperBgpAdapter] Trying to connect");

((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp." +
subject + ".prompt"));
+ .getProperty(subject, "prompt"));
manager.connect(username, "login:",
PasswordEncryptor.decryptPassword(password), "Password:");
logger.info("[JuniperBgpAdapter] Login");

@@ -302,35 +298,29 @@
logger
.debug("[JuniperBgpAdapter] Configuring
available operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("BGP")) {

BgpCommand command = new
BgpCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {
//
System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -444,13 +434,10 @@
try {

// TODO::Should be specified on the Adapter Level
- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);

@@ -475,7 +462,7 @@
try {

((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp." +
subject + ".prompt"));
+ .getProperty(subject, "prompt"));

} catch (PerfSONARException e) {


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperKeyBgpAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.bgp.commands.BgpCommandInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.encryption.PasswordEncryptor;
import
org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands.ParameterChecker;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.ssh.SshKeyManager;

@@ -73,7 +74,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -88,9 +89,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

// FOR LOCAL TESTING
@@ -216,19 +216,13 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- keyUrl =
properties.getProperty("service.r.mp." + subject
- + ".keyUrl");
- passphrase =
properties.getProperty("service.r.mp." + subject
- + ".passphrase");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ .getProperty(subject,"url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject,
"keyUrl");
+ passphrase = properties.getProperty(subject,
"passphrase");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username,
keyUrl, false);

@@ -304,34 +298,28 @@
logger
.debug("[JuniperKeyBgpAdapter] Configuring
available operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("BGP")) {

BgpCommand command = new
BgpCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -449,17 +437,12 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- username = properties.getProperty("service.r.mp." +
subject
- + ".username");
- keyUrl = properties.getProperty("service.r.mp." +
subject
- + ".keyUrl");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject, "keyUrl");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username, keyUrl,
false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/bgp/adapters/JuniperSshBgpAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.bgp.commands.BgpCommandInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.encryption.PasswordEncryptor;
import
org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands.ParameterChecker;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.ssh.SshManager;

@@ -71,7 +72,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -86,8 +87,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -211,17 +212,12 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ .getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ password = properties.getProperty(subject,
"password");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

//System.out.println(username);
//System.out.println(password);
@@ -297,35 +293,29 @@

logger.debug("[JuniperSshBgpAdapter] Configuring available
operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("BGP")) {

BgpCommand command = new
BgpCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {

//System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -443,13 +433,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/encryption/PasswordEncryptor.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -127,37 +127,4 @@

return result;
}
-
- public static void main (String[] args) {
- Properties pr = new Properties();
- String encrypted = encryptPassword("thisisasmalltest");
- pr.setProperty("password", encrypted);
-
- try {
- pr.store(new FileOutputStream("test.properties"), "");
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
-
- pr = new Properties();
- try {
- pr.setProperty("test", "testje");
- pr.load(new FileInputStream("test.properties"));
- pr.setProperty("test2", "testje");

- pr.store(new FileOutputStream("test.properties"), "");
-
- pr.load(new FileInputStream("test.properties"));
-
- pr.store(System.out, "");
- String decrypted =
decryptPassword(pr.getProperty("password"));
- System.out.println("decrypted password: " +
decrypted);
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
}

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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -22,13 +22,14 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
import
org.perfsonar.service.measurementPoint.lookingGlassType.bgp.adapters.CiscoBgpAdapter;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.adapters.CiscoIpAdapter;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.adapters.CiscoIpv6Adapter;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.adapters.CiscoStatusAdapter;

/**
@@ -51,7 +52,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

private CiscoIpAdapter ciscoIpAdapter = null;

@@ -70,8 +71,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -132,8 +133,7 @@

String rate;
try {
- rate = properties.getProperty("service.r.mp." +
subjectString
- + ".rate");
+ rate = properties.getProperty(subjectString, "rate");
} catch (PerfSONARException e2) {
e2.printStackTrace();
throw new
PerfSONARException("error.mp.sshtelnet.configuration",

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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoKeyAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -22,13 +22,14 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
import
org.perfsonar.service.measurementPoint.lookingGlassType.bgp.adapters.CiscoKeyBgpAdapter;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.adapters.CiscoKeyIpAdapter;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.adapters.CiscoKeyIpv6Adapter;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.adapters.CiscoKeyStatusAdapter;

/**
@@ -51,7 +52,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

private CiscoKeyIpAdapter ciscoKeyIpAdapter = null;

@@ -70,8 +71,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -131,8 +132,7 @@

String rate;
try {
- rate = properties.getProperty("service.r.mp." +
subjectString
- + ".rate");
+ rate = properties.getProperty(subjectString, "rate");
} catch (PerfSONARException e2) {
e2.printStackTrace();
throw new
PerfSONARException("error.mp.sshtelnet.configuration",

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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/CiscoSshAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -22,13 +22,14 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
import
org.perfsonar.service.measurementPoint.lookingGlassType.bgp.adapters.CiscoSshBgpAdapter;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.adapters.CiscoSshIpAdapter;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.adapters.CiscoSshIpv6Adapter;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.adapters.CiscoSshStatusAdapter;

/**
@@ -51,7 +52,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

private CiscoSshIpAdapter ciscoSshIpAdapter = null;

@@ -70,8 +71,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -132,8 +133,7 @@

String rate;
try {
- rate = properties.getProperty("service.r.mp." +
subjectString
- + ".rate");
+ rate = properties.getProperty(subjectString, "rate");
} catch (PerfSONARException e2) {
e2.printStackTrace();
throw new
PerfSONARException("error.mp.sshtelnet.configuration",

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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -22,13 +22,14 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
import
org.perfsonar.service.measurementPoint.lookingGlassType.bgp.adapters.JuniperBgpAdapter;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.adapters.JuniperIpAdapter;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.adapters.JuniperIpv6Adapter;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.adapters.JuniperStatusAdapter;

/**
@@ -51,7 +52,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

private JuniperIpAdapter juniperIpAdapter = null;

@@ -70,8 +71,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -132,8 +133,7 @@

String rate;
try {
- rate = properties.getProperty("service.r.mp." +
subjectString
- + ".rate");
+ rate = properties.getProperty(subjectString, "rate");
} catch (PerfSONARException e2) {
e2.printStackTrace();
throw new
PerfSONARException("error.mp.sshtelnet.configuration",

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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperKeyAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -22,13 +22,14 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
import
org.perfsonar.service.measurementPoint.lookingGlassType.bgp.adapters.JuniperKeyBgpAdapter;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.adapters.JuniperKeyIpAdapter;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.adapters.JuniperKeyIpv6Adapter;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.adapters.JuniperKeyStatusAdapter;

/**
@@ -51,7 +52,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

private JuniperKeyIpAdapter juniperKeyIpAdapter = null;

@@ -70,8 +71,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -132,8 +133,7 @@

String rate;
try {
- rate = properties.getProperty("service.r.mp." +
subjectString
- + ".rate");
+ rate = properties.getProperty(subjectString, "rate");
} catch (PerfSONARException e2) {
e2.printStackTrace();
throw new
PerfSONARException("error.mp.sshtelnet.configuration",

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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/JuniperSshAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -22,13 +22,14 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
import
org.perfsonar.service.measurementPoint.lookingGlassType.bgp.adapters.JuniperSshBgpAdapter;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.adapters.JuniperSshIpAdapter;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.adapters.JuniperSshIpv6Adapter;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.adapters.JuniperSshStatusAdapter;

/**
@@ -51,7 +52,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

private JuniperSshIpAdapter juniperSshIpAdapter = null;

@@ -70,8 +71,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -132,8 +133,7 @@

String rate;
try {
- rate = properties.getProperty("service.r.mp." +
subjectString
- + ".rate");
+ rate = properties.getProperty(subjectString, "rate");
} catch (PerfSONARException e2) {
e2.printStackTrace();
throw new
PerfSONARException("error.mp.sshtelnet.configuration",

Deleted:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/QuaggaAdapter.java

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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters/WebserviceEngineAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -9,7 +9,6 @@
package
org.perfsonar.service.measurementPoint.lookingGlassType.engine.adapters;

import java.awt.Toolkit;
-import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
@@ -25,11 +24,12 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ActionType;
import org.perfsonar.service.base.engine.ServiceEngine;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;

/**
* Implementation class that filters and forwards request based upon the
@@ -55,8 +55,9 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration configuration = null;

+
// List of all supported devices, populated from the
service.properties
// files
private List devices = null;
@@ -68,23 +69,17 @@
try {

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";
- StringTokenizer devicesTokenizer = null;
- devices = new ArrayList();
+
+ this.logger = (LoggerComponent)
+ AuxiliaryComponentManager.
+ getInstance().
+ getComponent(ComponentNames.LOGGER);

- logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
- .getComponent(ComponentNames.LOGGER);
-
- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
- devicesTokenizer = new StringTokenizer(properties
- .getProperty("service.mp.devices"),
",");
- while (devicesTokenizer.hasMoreTokens()) {
-
- devices.add(devicesTokenizer.nextToken());
-
- }
-
+ this.configuration = new DbMetadataConfiguration();
+ configuration.initStorage();
+
+ devices =
configuration.getProperties(MetadataConfiguration.DEVICE_NAMES);
+
registerServiceWithLS();

} catch (PerfSONARException e) {
@@ -114,11 +109,8 @@
public Message takeAction(String actionType, Message request)
throws PerfSONARException {

- logger
- .info("[WebserviceEngineAdapter] Webservice
takeAction call received");
- // System.out.println("[WebserviceEngineAdapter] Webservice
takeAction
- // call received");
-
+ logger.info("[WebserviceEngineAdapter] Webservice takeAction
call received");
+
logger.info("COUNT: " + count++);

Metadata[] requestMetadata = request.getMetadataArray();
@@ -162,8 +154,8 @@

metadataIdRef))

message.setData(requestData[j]);

- String serviceEngineString =
properties
-
.getProperty("service.mp." + value + ".class_name");
+ String serviceEngineString =
configuration
+
.getProperty(value,"class_name");

RequestExecutingThread
requestExecutingThread = new RequestExecutingThread(
i, actionType,
serviceEngineString, message,
@@ -171,102 +163,6 @@

requestExecutingThread.start();

- /**
- * try { Message message = new
Message();
- *
message.setMetadata(requestMetadata[i]); String
- * metadataIdRef =
requestMetadata[i].getId();
- *
- * for (int j = 0; j <
requestData.length; j++) if
- * (requestData[j].getMetadataIdRef()
- * .equalsIgnoreCase(metadataIdRef))
- * message.setData(requestData[j]);
- *
- * ServiceEngine serviceEngine =
ServiceEngineFactory
- * .getServiceEngine(properties
.getProperty("service.mp." +
- * value + ".class_name"));
messages[i] =
- *
serviceEngine.takeAction(actionType, message);
- * // Inclusion of the result code
tags Metadata
- * resultCodeMetadata = new
Metadata();
- *
resultCodeMetadata.setId("resultCodeMeta_" +
- * requestMetadata[i].getId());
- *
- * Subject resultCodeSubject = new
Subject();
- *
resultCodeSubject.setId("resultCodeSubj_" +
- * requestMetadata[i].getId());
- *
resultCodeSubject.setMetadataIdRef(requestMetadata[i]
- * .getId());
- *
- * EventType resultCodeEventType =
new EventType();
- *
resultCodeEventType.setId("resultCodeEventType_" +
- * requestMetadata[i].getId());
resultCodeEventType
- *
.setEventType("success.mp.sshtelnet");
- *
- *
resultCodeMetadata.addChild(resultCodeSubject);
- *
resultCodeMetadata.addChild(resultCodeEventType);
- *
- * Data resultCodeData = new Data();
- *
resultCodeData.setId("resultCodeData_" +
- * requestMetadata[i].getId());
- *
resultCodeData.setMetadataIdRef("resultCodeMeta_" +
- * requestMetadata[i].getId());
- *
- * Datum resultCodeDatum = new
Datum();
- *
resultCodeDatum.setId("resultCodeDatum_" +
- * requestMetadata[i].getId());
resultCodeDatum
- * .setValue("Successfully executed
request");
- *
- *
resultCodeData.addChild(resultCodeDatum);
- *
- *
messages[i].setMetadata(resultCodeMetadata);
- *
messages[i].setData(resultCodeData);
- * } catch (PerfSONARException e) {
- *
- * messages[i] = new Message();
- *
messages[i].setMetadata(requestMetadata[i]); String
- * metadataIdRef =
requestMetadata[i].getId();
- *
- * for (int j = 0; j <
requestData.length; j++) if
- * (requestData[j].getMetadataIdRef()
- * .equalsIgnoreCase(metadataIdRef))
- *
messages[i].setData(requestData[j]);
- *
- * Metadata resultCodeMetadata = new
Metadata();
- *
resultCodeMetadata.setId("resultCodeMeta_" +
- * requestMetadata[i].getId());
- *
- * Subject resultCodeSubject = new
Subject();
- *
resultCodeSubject.setId("resultCodeSubj_" +
- * requestMetadata[i].getId());
- *
resultCodeSubject.setMetadataIdRef(requestMetadata[i]
- * .getId());
- *
- * EventType resultCodeEventType =
new EventType();
- *
resultCodeEventType.setId("resultCodeEventType_" +
- * requestMetadata[i].getId());
- *
resultCodeEventType.setEventType(e.getResultCode());
- *
- *
resultCodeMetadata.addChild(resultCodeSubject);
- *
resultCodeMetadata.addChild(resultCodeEventType);
- *
- * Data resultCodeData = new Data();
- *
resultCodeData.setId("resultCodeData_" +
- * requestMetadata[i].getId());
- *
resultCodeData.setMetadataIdRef("resultCodeMeta_" +
- * requestMetadata[i].getId());
- *
- * Datum resultCodeDatum = new
Datum();
- *
resultCodeDatum.setId("resultCodeDatum_" +
- * requestMetadata[i].getId());
- *
resultCodeDatum.setValue(e.getResultDescription());
- *
- *
resultCodeData.addChild(resultCodeDatum);
- *
- *
messages[i].setMetadata(resultCodeMetadata);
- *
messages[i].setData(resultCodeData);
- *
- *
logger.error(e.getResultDescription()); }
- */
-
} else {

messages[i] = new Message();
@@ -406,8 +302,8 @@
Parameter metaparam = new Parameter();
metaparam.setParameterName("url");
try {
- metaparam.setParameterValue(properties
- .getProperty("service.r.mp."
+ token + ".url"));
+ metaparam.setParameterValue(configuration
+ .getProperty(token, "url"));
} catch (PerfSONARException e1) {
e1.printStackTrace();
}
@@ -419,16 +315,17 @@

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." +
token + ".commands"), ",");
+ //re-write this to ArrayList
+
+ Iterator commands =
configuration.getProperties(token,"commands").iterator();
respData[tokencounter] = new Data();
respData[tokencounter].setId("data" +
tokencounter);
respData[tokencounter]

.setMetadataIdRef(respMetaData[tokencounter].getId());

- while (tokenizer.hasMoreTokens()) {
+ while (commands.hasNext()) {

- innerToken = tokenizer.nextToken();
+ innerToken = (String) commands.next();

datum = new Datum();

@@ -443,10 +340,8 @@
try {
param1.setId("param1-" +
tokencounter);

param1.setParameterName("description");
-
param1.setParameterValue(properties
-
.getProperty("service.mp." + token
-
+ ".commands." + innerToken
-
+ ".description"));
+
param1.setParameterValue(configuration
+
.getProperty(token, innerToken, "description"));
} catch (PerfSONARException e) {
}

@@ -455,10 +350,8 @@
param2.setId("param2-" +
tokencounter);

param2.setParameterName("syntax");
param2
-
.setParameterValue(properties
-
.getProperty("service.mp." + token
-
+ ".commands." + innerToken
-
+ ".syntax"));
+
.setParameterValue(configuration
+
.getProperty(token, innerToken, "syntax"));
} catch (PerfSONARException e) {
}

@@ -466,9 +359,8 @@
try {
param3.setId("param3-" +
tokencounter);

param3.setParameterName("command");
-
param3.setParameterValue(properties
-
.getProperty("service.mp." + token
-
+ ".commands." + innerToken));
+
param3.setParameterValue(configuration
+
.getProperty(token, innerToken, "command"));
} catch (PerfSONARException e) {
}


Modified:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/commands/ParameterChecker.java
===================================================================
---
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/commands/ParameterChecker.java
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/engine/commands/ParameterChecker.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -10,10 +10,9 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

-import org.perfsonar.base.auxiliary.AuxiliaryComponentManager;
-import org.perfsonar.base.auxiliary.ComponentNames;
-import
org.perfsonar.base.auxiliary.components.configuration.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;

/**
* Provides functionality for basic paramter input checking
@@ -23,7 +22,7 @@
*/
public class ParameterChecker implements ParameterCheckerInterface {

- private PropertiesConfigurationComponent properties = new
PropertiesConfigurationComponent();
+ private MetadataConfiguration properties;

/**
* Global method for checking the validity of the of inputted
parameters,
@@ -54,10 +53,10 @@

boolean ok = false;
try {
- properties =
(PropertiesConfigurationComponent)AuxiliaryComponentManager.
- getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

- String regularExpressions =
properties.getProperty("service.mp."+subject+".commands."+eventTypeString+".regex");
+ String regularExpressions =
properties.getProperty(subject, eventTypeString, "regex");
System.out.println("Regular Expressions for command "
+ eventTypeString + ": "+regularExpressions);
StringTokenizer disjunct = new
StringTokenizer(regularExpressions, "#");


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoIpAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.IpAdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.commands.IpCommand;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.commands.IpCommandInterface;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.telnet.TelnetManager;

@@ -71,7 +72,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -86,8 +87,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

// FOR LOCAL TESTING
availableSpecificCommands = new ArrayList();
@@ -215,16 +216,12 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
+ .getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
try {
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
+ username =
properties.getProperty(subject, "username");
+ password =
properties.getProperty(subject, "password");
if (username.equals("") ||
password.equals(""))
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
"Username or
password not set");
@@ -233,12 +230,11 @@

logger.error(e.getStackTrace().toString());
throw e;
}
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);
((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp."
+ subject + ".prompt"));
+ .getProperty(subject,
"prompt"));

}

@@ -307,35 +303,29 @@

logger.debug("[CiscoIpAdapter] Configuring available
operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("IP_")) {

IpCommand command = new
IpCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {
//
System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -449,13 +439,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);

@@ -480,7 +467,7 @@
try {

((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp." +
subject + ".prompt"));
+ .getProperty(subject,"prompt"));

} catch (PerfSONARException e) {


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoKeyIpAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.IpAdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.commands.IpCommand;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.commands.IpCommandInterface;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.ssh.SshKeyManager;

@@ -75,7 +76,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -90,8 +91,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -218,18 +219,13 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
+ .getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
try {
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- keyUrl =
properties.getProperty("service.r.mp." + subject
- + ".keyUrl");
- passphrase =
properties.getProperty("service.r.mp." + subject
- + ".passphrase");
+ username =
properties.getProperty(subject, "username");
+ keyUrl =
properties.getProperty(subject, "keyUrl");
+ passphrase =
properties.getProperty(subject, "passphrase");
if (username.equals("") ||
keyUrl.equals(""))
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
"Username or
KeyURL not set");
@@ -238,8 +234,7 @@

logger.error(e.getStackTrace().toString());
throw e;
}
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username,
keyUrl, false);

@@ -313,34 +308,28 @@
logger
.debug("[CiscoKeyIpAdapter] Configuring
available operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("IP_")) {

IpCommand command = new
IpCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -444,16 +433,12 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
try {
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- keyUrl =
properties.getProperty("service.r.mp." + subject
- + ".keyUrl");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject,
"keyUrl");
if (username.equals("") || keyUrl.equals(""))
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
"Username or KeyURL
not set");
@@ -462,8 +447,7 @@
logger.error(e.getStackTrace().toString());
throw e;
}
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username, keyUrl,
false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/CiscoSshIpAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.IpAdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.commands.IpCommand;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.commands.IpCommandInterface;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.ssh.SshManager;

@@ -71,7 +72,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -86,8 +87,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -211,16 +212,12 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
+ .getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
try {
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
+ username =
properties.getProperty(subject, "username");
+ password =
properties.getProperty(subject, "password");
if (username.equals("") ||
password.equals(""))
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
"Username or
password not set");
@@ -229,8 +226,7 @@

logger.error(e.getStackTrace().toString());
throw e;
}
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

//System.out.println(username);
//System.out.println(password);
@@ -306,35 +302,29 @@

logger.debug("[CiscoSshIpAdapter] Configuring available
operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("IP")) {

IpCommand command = new
IpCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {

//System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -438,13 +428,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperIpAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.IpAdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.commands.IpCommand;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.commands.IpCommandInterface;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.telnet.TelnetManager;

@@ -71,7 +72,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -86,8 +87,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

//FOR LOCAL TESTING
availableSpecificCommands = new ArrayList();
@@ -213,17 +214,12 @@

if (manager == null) {

- url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
try {
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
+ username =
properties.getProperty(subject, "username");
+ password =
properties.getProperty(subject, "password");
if (username.equals("") ||
password.equals(""))
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
"Username or
password not set");
@@ -232,12 +228,11 @@

logger.error(e.getStackTrace().toString());
throw e;
}
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);
((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp."
+ subject + ".prompt"));
+ .getProperty(subject,
"prompt"));

}

@@ -306,35 +301,29 @@

logger.debug("[JuniperIpAdapter] Configuring available
operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("IP_")) {

IpCommand command = new
IpCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {

//System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -448,13 +437,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);

@@ -479,7 +465,7 @@
try {

((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp." +
subject + ".prompt"));
+ .getProperty(subject, "prompt"));

} catch (PerfSONARException e) {


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperKeyIpAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.IpAdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.commands.IpCommand;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.commands.IpCommandInterface;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.ssh.SshKeyManager;

@@ -75,7 +76,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -90,8 +91,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -217,19 +218,13 @@

if (manager == null) {

- url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
+ url = properties.getProperty(subject,"url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
try {
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- keyUrl =
properties.getProperty("service.r.mp." + subject
- + ".keyUrl");
- passphrase =
properties.getProperty("service.r.mp." + subject
- + ".passphrase");
+ username =
properties.getProperty(subject, "username");
+ keyUrl =
properties.getProperty(subject, "keyUrl");
+ passphrase =
properties.getProperty(subject, "passphrase");
if (username.equals("") ||
keyUrl.equals(""))
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
"Username or
KeyURL not set");
@@ -238,8 +233,7 @@

logger.error(e.getStackTrace().toString());
throw e;
}
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username,
keyUrl, false);

@@ -313,34 +307,28 @@
logger
.debug("[JuniperKeyIpAdapter] Configuring
available operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("IP_")) {

IpCommand command = new
IpCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -456,16 +444,12 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
try {
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- keyUrl =
properties.getProperty("service.r.mp." + subject
- + ".keyUrl");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject,
"keyUrl");
if (username.equals("") || keyUrl.equals(""))
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
"Username or KeyURL
not set");
@@ -474,8 +458,7 @@
logger.error(e.getStackTrace().toString());
throw e;
}
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username, keyUrl,
false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ip/adapters/JuniperSshIpAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.IpAdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.commands.IpCommand;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ip.commands.IpCommandInterface;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.ssh.SshManager;

@@ -60,7 +61,7 @@
private String username = "";

private String password = "";
-
+
private int caching = 0;

// ---------------------- class-fields
@@ -71,8 +72,8 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
-
+ private MetadataConfiguration properties = null;
+
// ---------------------- caching attributes

private static List cachedResults = new ArrayList();
@@ -84,10 +85,10 @@
try {

logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
- .getComponent(ComponentNames.LOGGER);
+ .getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -98,7 +99,7 @@

e.printStackTrace();
throw new
PerfSONARException("error.mp.sshYE.configuration",
- "Failed to obtain reference to the
properties and/or logger instances.");
+ "Failed to obtain reference to the properties and/or
logger instances.");

}

@@ -147,7 +148,7 @@
* @see
org.perfsonar.service.measurementPoint.lookingGlassType.ip.IpAdapterInterface
*/
public IpCommandInterface getCommand(String description)
- throws PerfSONARException {
+ throws PerfSONARException {

logger.debug("[JuniperSshIpAdapter] getCommand called");

@@ -169,7 +170,7 @@

logger.error("[JuniperSshIpAdapter] Command NOT found");
throw new
PerfSONARException("error.mp.sshtelnet.nosuchcommand",
- "Requested command not found");
+ "Requested command not found");

}// getCommand

@@ -210,27 +211,21 @@

if (manager == null) {

- url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
try {
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
+ username =
properties.getProperty(subject, "username");
+ password =
properties.getProperty(subject, "password");
if (username.equals("") ||
password.equals(""))
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
- "Username or
password not set");
+ "Username or password not
set");
} catch (Exception e) {
logger.error("[JuniperSshIpAdapter]
Error in configuration");

logger.error(e.getStackTrace().toString());
throw e;
}
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

//System.out.println(username);
//System.out.println(password);
@@ -252,7 +247,7 @@
logger.error(e.getStackTrace().toString());
//System.err.println(e.getStackTrace().toString());
throw new
PerfSONARException("error.mp.sshtelnet.connect",
- "Could not connect to underlying
device");
+ "Could not connect to underlying device");

}

@@ -306,39 +301,33 @@

logger.debug("[JuniperSshIpAdapter] Configuring available
operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("IP_")) {

IpCommand command = new
IpCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {

//System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
-
+
command.setDeviceName(subject);

this.addAvailableSpecificCommand(command);

@@ -350,7 +339,7 @@

//e.printStackTrace();
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
- "Unable to retrieve commands");
+ "Unable to retrieve commands");

}

@@ -426,7 +415,7 @@
* @see ServiceEngine.java
*/
public Message takeAction(String actionType, Message request)
- throws PerfSONARException {
+ throws PerfSONARException {

logger.info("[JuniperSshIpAdapter] Webservice takeAction call
received");

@@ -452,13 +441,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);

@@ -467,13 +453,13 @@
e1.printStackTrace();
throw new PerfSONARException(
"error.mp.sshtelnet.configuration",
- "Invalid port number in
configuration");
+ "Invalid port number in configuration");

} catch (PerfSONARException e1) {

e1.printStackTrace();
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
- "Unable to retrieve connection
details");
+ "Unable to retrieve connection details");

}

@@ -508,7 +494,7 @@
valid = false;
throw new PerfSONARException(

"error.mp.sshtelnet.parameter",
- "Malicious parameters
detected.");
+ "Malicious parameters detected.");
}

}
@@ -516,35 +502,35 @@
if (ipCommand.getParameters().size() >= ipCommand
.getMinParamCount()
&& ipCommand.getParameters().size()
<= ipCommand
- .getMaxParamCount()
&& valid) {
-
+ .getMaxParamCount() && valid) {
+
Iterator it = cachedResults.iterator();
while (it.hasNext()) {
-
+
IpCommandInterface cachedCommand =
(IpCommandInterface)it.next();
-
+
if
(cachedCommand.getCommand().equalsIgnoreCase(ipCommand.getCommand())
&&
cachedCommand.getParameterString().equalsIgnoreCase(ipCommand.getParameterString())
&&
cachedCommand.getDeviceName().equalsIgnoreCase(ipCommand.getDeviceName())
&&
cachedCommand.getTimestamp()+(caching*1000) > System.currentTimeMillis()) {
-
+
logger.info("CACHED RESULT
RETURNED");
temp =
cachedCommand.getResult();
-
+
} else if
(cachedCommand.getTimestamp()+(caching*1000) <= System.currentTimeMillis()) {

logger.info("CACHED RESULT
REMOVED");
it.remove();
-
+
}
-
+
}
-
+
if (temp.equalsIgnoreCase("")) {
-
+
adapter.connect(subject);
temp =
adapter.executeCommand(ipCommand).getResult();
-
+
}

}
@@ -553,45 +539,45 @@
temp = " Wrong number of
parameters detected.";
throw new PerfSONARException(

"error.mp.sshtelnet.parameter",
- "Wrong number of parameters
detected.");
+ "Wrong number of parameters detected.");
}

} else if (ipCommand.getMinParamCount() == 0) {

Iterator it = cachedResults.iterator();
while (it.hasNext()) {
-
+
IpCommandInterface cachedCommand =
(IpCommandInterface)it.next();
-
+
if
(cachedCommand.getCommand().equalsIgnoreCase(ipCommand.getCommand())
&&
cachedCommand.getParameterString().equalsIgnoreCase(ipCommand.getParameterString())
&&
cachedCommand.getDeviceName().equalsIgnoreCase(ipCommand.getDeviceName())
&&
cachedCommand.getTimestamp()+(caching*1000) > System.currentTimeMillis()) {
-
+
logger.info("CACHED RESULT RETURNED");
temp = cachedCommand.getResult();
-
+
} else if
(cachedCommand.getTimestamp()+(caching*1000) <= System.currentTimeMillis()) {

logger.info("CACHED RESULT REMOVED");
it.remove();
-
+
}
-
+
}
-
+
if (temp.equalsIgnoreCase("")) {
-
+
adapter.connect(subject);
temp =
adapter.executeCommand(ipCommand).getResult();
-
+
}

} else {

temp = " Wrong number of parameters
detected.";
throw new
PerfSONARException("error.mp.sshtelnet.parameter",
- "Wrong number of parameters
detected.");
+ "Wrong number of parameters detected.");

}


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoIpv6Adapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -8,7 +8,6 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.util.StringTokenizer;

import org.ggf.ns.nmwg.base.v2_0.Data;
import org.ggf.ns.nmwg.base.v2_0.Datum;
@@ -21,7 +20,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +28,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.Ipv6AdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.commands.Ipv6Command;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.commands.Ipv6CommandInterface;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.telnet.TelnetManager;

@@ -60,7 +60,7 @@
private String username = "";

private String password = "";
-
+
private int caching = 0;

// ---------------------- class-fields
@@ -71,8 +71,8 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
-
+ private MetadataConfiguration properties = null;
+
// ---------------------- caching attributes

private static List cachedResults = new ArrayList();
@@ -84,10 +84,10 @@
try {

logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
- .getComponent(ComponentNames.LOGGER);
+ .getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

//FOR LOCAL TESTING
availableSpecificCommands = new ArrayList();
@@ -98,7 +98,7 @@

e.printStackTrace();
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
- "Failed to obtain reference to the
properties and/or logger instances.");
+ "Failed to obtain reference to the properties and/or
logger instances.");

}

@@ -147,7 +147,7 @@
* @see
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.Ipv6AdapterInterface
*/
public Ipv6CommandInterface getCommand(String description)
- throws PerfSONARException {
+ throws PerfSONARException {

logger.debug("[CiscoIpv6Adapter getCommand called");

@@ -169,7 +169,7 @@

logger.error("[CiscoIpv6Adapter Command NOT found");
throw new
PerfSONARException("error.mp.sshtelnet.nosuchcommand",
- "Requested command not found");
+ "Requested command not found");

}// getCommand

@@ -214,22 +214,16 @@

if (manager == null) {

- url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ password = properties.getProperty(subject,
"password");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);
((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp."
+ subject + ".prompt"));
+ .getProperty(subject,
"prompt"));

}

@@ -244,7 +238,7 @@
logger.error("[CiscoIpv6Adapter Error occuring while
connecting");
logger.error(e.getStackTrace().toString());
throw new
PerfSONARException("error.mp.sshtelnet.connect",
- "Could not connect to underlying
device");
+ "Could not connect to underlying device");

}

@@ -298,39 +292,33 @@

logger.debug("[CiscoIpv6Adapter Configuring available
operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("IPv6")) {

Ipv6Command command = new
Ipv6Command(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {

//System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
-
+
command.setDeviceName(subject);

this.addAvailableSpecificCommand(command);

@@ -342,7 +330,7 @@

e.printStackTrace();
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
- "Unable to retrieve commands");
+ "Unable to retrieve commands");

}

@@ -373,8 +361,8 @@
}

String tempResult = temp
- .substring((ipv6Command.getCommand() + " "
+ ipv6Command
-
.getParameterString()).length());
+ .substring((ipv6Command.getCommand() + " " + ipv6Command
+ .getParameterString()).length());

String t1 = tempResult.replaceAll("\\n", "");
// System.err.println(t1);
@@ -409,7 +397,7 @@
* @see ServiceEngine.java
*/
public Message takeAction(String actionType, Message request)
- throws PerfSONARException {
+ throws PerfSONARException {

logger.info("[CiscoIpv6Adapter Webservice takeAction call
received");

@@ -435,13 +423,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);

@@ -450,13 +435,13 @@
e1.printStackTrace();
throw new PerfSONARException(
"error.mp.sshtelnet.configuration",
- "Invalid port number in
configuration");
+ "Invalid port number in configuration");

} catch (PerfSONARException e1) {

e1.printStackTrace();
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
- "Unable to retrieve connection
details");
+ "Unable to retrieve connection details");

}

@@ -466,13 +451,13 @@
try {

((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp." +
subject + ".prompt"));
+ .getProperty(subject, "prompt"));

} catch (PerfSONARException e) {

e.printStackTrace();
throw new
PerfSONARException("error.mp.sshtelnet.configuration",
- "Unable to retrieve prompt");
+ "Unable to retrieve prompt");

}

@@ -507,7 +492,7 @@
valid = false;
throw new PerfSONARException(

"error.mp.sshtelnet.parameter",
- "Malicious parameters
detected.");
+ "Malicious parameters detected.");
}

}
@@ -515,35 +500,35 @@
if (ipv6Command.getParameters().size() >= ipv6Command
.getMinParamCount()
&& ipv6Command.getParameters().size()
<= ipv6Command
- .getMaxParamCount()
&& valid) {
-
+ .getMaxParamCount() && valid) {
+
Iterator it = cachedResults.iterator();
while (it.hasNext()) {
-
+
Ipv6CommandInterface cachedCommand =
(Ipv6CommandInterface)it.next();
-
+
if
(cachedCommand.getCommand().equalsIgnoreCase(ipv6Command.getCommand())
&&
cachedCommand.getParameterString().equalsIgnoreCase(ipv6Command.getParameterString())
&&
cachedCommand.getDeviceName().equalsIgnoreCase(ipv6Command.getDeviceName())
&&
cachedCommand.getTimestamp()+(caching*1000) > System.currentTimeMillis()) {
-
+
logger.info("CACHED RESULT
RETURNED");
temp =
cachedCommand.getResult();
-
+
} else if
(cachedCommand.getTimestamp()+(caching*1000) <= System.currentTimeMillis()) {

logger.info("CACHED RESULT
REMOVED");
it.remove();
-
+
}
-
+
}
-
+
if (temp.equalsIgnoreCase("")) {
-
+
adapter.connect(subject);
temp =
adapter.executeCommand(ipv6Command).getResult();
-
+
}

}
@@ -552,45 +537,45 @@
temp = " Wrong number of
parameters detected.";
throw new PerfSONARException(

"error.mp.sshtelnet.parameter",
- "Wrong number of parameters
detected.");
+ "Wrong number of parameters detected.");
}

} else if (ipv6Command.getMinParamCount() == 0) {

Iterator it = cachedResults.iterator();
while (it.hasNext()) {
-
+
Ipv6CommandInterface cachedCommand =
(Ipv6CommandInterface)it.next();
-
+
if
(cachedCommand.getCommand().equalsIgnoreCase(ipv6Command.getCommand())
&&
cachedCommand.getParameterString().equalsIgnoreCase(ipv6Command.getParameterString())
&&
cachedCommand.getDeviceName().equalsIgnoreCase(ipv6Command.getDeviceName())
&&
cachedCommand.getTimestamp()+(caching*1000) > System.currentTimeMillis()) {
-
+
logger.info("CACHED RESULT RETURNED");
temp = cachedCommand.getResult();
-
+
} else if
(cachedCommand.getTimestamp()+(caching*1000) <= System.currentTimeMillis()) {

logger.info("CACHED RESULT REMOVED");
it.remove();
-
+
}
-
+
}
-
+
if (temp.equalsIgnoreCase("")) {
-
+
adapter.connect(subject);
temp =
adapter.executeCommand(ipv6Command).getResult();
-
+
}

} else {

temp = " Wrong number of parameters
detected.";
throw new
PerfSONARException("error.mp.sshtelnet.parameter",
- "Wrong number of parameters
detected.");
+ "Wrong number of parameters detected.");

}


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoKeyIpv6Adapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.Ipv6AdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.commands.Ipv6Command;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.commands.Ipv6CommandInterface;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.ssh.SshKeyManager;

@@ -76,7 +77,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -91,8 +92,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -218,20 +219,13 @@

if (manager == null) {

- url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- keyUrl =
properties.getProperty("service.r.mp." + subject
- + ".keyUrl");
- passphrase =
properties.getProperty("service.r.mp." + subject
- + ".passphrase");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject,
"keyUrl");
+ passphrase = properties.getProperty(subject,
"passphrase");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username,
keyUrl, false);

@@ -305,34 +299,28 @@
logger
.debug("[CiscoKeyIpv6Adapter] Configuring
available operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("IPv6_")) {

Ipv6Command command = new
Ipv6Command(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token,"command"));
try {
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -438,17 +426,12 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- username = properties.getProperty("service.r.mp." +
subject
- + ".username");
- keyUrl = properties.getProperty("service.r.mp." +
subject
- + ".keyUrl");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject, "keyUrl");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username, keyUrl,
false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/CiscoSshIpv6Adapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.Ipv6AdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.commands.Ipv6Command;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.commands.Ipv6CommandInterface;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.ssh.SshManager;

@@ -71,7 +72,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -86,9 +87,9 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();
+
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

//FOR LOCAL TESTING
@@ -210,18 +211,12 @@

if (manager == null) {

- url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ password = properties.getProperty(subject,
"password");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

//System.out.println(username);
//System.out.println(password);
@@ -297,35 +292,29 @@

logger.debug("[CiscoSshIpv6Adapter] Configuring available
operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("IPv6")) {

Ipv6Command command = new
Ipv6Command(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {

//System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -431,13 +420,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperIpv6Adapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.Ipv6AdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.commands.Ipv6Command;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.commands.Ipv6CommandInterface;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.telnet.TelnetManager;

@@ -71,7 +72,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -86,8 +87,8 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();

// FOR LOCAL TESTING
availableSpecificCommands = new ArrayList();
@@ -213,21 +214,16 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ .getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ password = properties.getProperty(subject,
"password");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);
((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp."
+ subject + ".prompt"));
+ .getProperty(subject,
"prompt"));

}

@@ -297,35 +293,29 @@
logger
.debug("[JuniperIpv6Adapter Configuring
available operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("IPv6")) {

Ipv6Command command = new
Ipv6Command(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {
//
System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -442,13 +432,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);

@@ -473,7 +460,7 @@
try {

((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp." +
subject + ".prompt"));
+ .getProperty(subject, "prompt"));

} catch (PerfSONARException e) {


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperKeyIpv6Adapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.Ipv6AdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.commands.Ipv6Command;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.commands.Ipv6CommandInterface;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.ssh.SshKeyManager;

@@ -76,7 +77,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -91,9 +92,9 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();
+
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

// FOR LOCAL TESTING
@@ -219,19 +220,13 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- keyUrl =
properties.getProperty("service.r.mp." + subject
- + ".keyUrl");
- passphrase =
properties.getProperty("service.r.mp." + subject
- + "passphrase");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ .getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject,
"keyUrl");
+ passphrase = properties.getProperty(subject,
"passphrase");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username,
keyUrl, false);

@@ -305,34 +300,28 @@
logger
.debug("[JuniperKeyIpv6Adapter] Configuring
available operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("IPv6_")) {

Ipv6Command command = new
Ipv6Command(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -450,17 +439,12 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- username = properties.getProperty("service.r.mp." +
subject
- + ".username");
- keyUrl = properties.getProperty("service.r.mp." +
subject
- + ".keyUrl");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject, "keyUrl");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username, keyUrl,
false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/ipv6/adapters/JuniperSshIpv6Adapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,7 +21,6 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
@@ -30,6 +29,8 @@
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.Ipv6AdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.commands.Ipv6Command;
import
org.perfsonar.service.measurementPoint.lookingGlassType.ipv6.commands.Ipv6CommandInterface;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import org.perfsonar.service.measurementPoint.remote.common.RemoteManager;
import org.perfsonar.service.measurementPoint.remote.ssh.SshManager;

@@ -71,7 +72,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -86,9 +87,9 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();
+
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

//FOR LOCAL TESTING
@@ -211,17 +212,12 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ .getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ password = properties.getProperty(subject,
"password");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

//System.out.println(username);
//System.out.println(password);
@@ -297,35 +293,29 @@

logger.debug("[JuniperSshIpv6Adapter] Configuring available
operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("IPv6_")) {

Ipv6Command command = new
Ipv6Command(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {

//System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -443,13 +433,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);


Added:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata/DbMetadataConfiguration.java

Added:
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/metadata/MetadataConfiguration.java

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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoKeyStatusAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,12 +21,13 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
import
org.perfsonar.service.measurementPoint.lookingGlassType.encryption.PasswordEncryptor;
import
org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands.ParameterChecker;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.StatusAdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.commands.StatusCommand;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.commands.StatusCommandInterface;
@@ -76,7 +77,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -91,9 +92,9 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();
+
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

// FOR LOCAL TESTING
@@ -221,19 +222,13 @@
if (manager == null) {

url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- keyUrl =
properties.getProperty("service.r.mp." + subject
- + ".keyUrl");
- passphrase =
properties.getProperty("service.r.mp." + subject
- + ".passphrase");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ .getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject,
"keyUrl");
+ passphrase = properties.getProperty(subject,
"passphrase");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username,
keyUrl, false);

@@ -307,34 +302,28 @@
logger
.debug("[CiscoKeyStatusAdapter] Configuring
available operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("STATUS_")) {

StatusCommand command = new
StatusCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "commands"));
try {
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -442,17 +431,12 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- username = properties.getProperty("service.r.mp." +
subject
- + ".username");
- keyUrl = properties.getProperty("service.r.mp." +
subject
- + ".keyUrl");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject, "keyUrl");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username, keyUrl,
false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoSshStatusAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -24,12 +24,13 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
import
org.perfsonar.service.measurementPoint.lookingGlassType.encryption.PasswordEncryptor;
import
org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands.ParameterChecker;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.StatusAdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.commands.StatusCommand;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.commands.StatusCommandInterface;
@@ -74,7 +75,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -89,16 +90,16 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
- try {
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();
+
+ /*try {
properties.getProperties().store(new
FileOutputStream("eend.properties"), "");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
- }
+ }*/

this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

@@ -221,18 +222,12 @@

if (manager == null) {

- url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ password = properties.getProperty(subject,
"password");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

//System.out.println(username);
//System.out.println(password);
@@ -308,35 +303,29 @@

logger.debug("[CiscoSshStatusAdapter] Configuring available
operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String )commands.next();
if (token.contains("STATUS")) {

StatusCommand command = new
StatusCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {

//System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -442,13 +431,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/CiscoStatusAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,12 +21,13 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
import
org.perfsonar.service.measurementPoint.lookingGlassType.encryption.PasswordEncryptor;
import
org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands.ParameterChecker;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.StatusAdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.commands.StatusCommand;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.commands.StatusCommandInterface;
@@ -72,7 +73,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -87,9 +88,9 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();
+
// FOR LOCAL TESTING
availableSpecificCommands = new ArrayList();

@@ -214,27 +215,21 @@

if (manager == null) {

- url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
+ url = properties.getProperty(subject, "url");
logger.debug("[CiscoStatusAdapter] url: "+
url);
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
logger.debug("[CiscoStatusAdapter] port: "+
port);
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
+ prompt = properties.getProperty(subject,
"prompt");
logger.debug("[CiscoStatusAdapter] prompt: "+
prompt);
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
+ username = properties.getProperty(subject,
"username");
logger.debug("[CiscoStatusAdapter] username:
"+ username);
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ password = properties.getProperty(subject,
"password");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));
logger.debug("[CiscoStatusAdapter] cache: "+
caching);

manager = new TelnetManager(url, port, false);
((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp."
+ subject + ".prompt"));
+ .getProperty(subject,
"prompt"));

}

@@ -305,35 +300,29 @@
logger
.debug("[CiscoStatusAdapter] Configuring
available operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("STATUS_")) {

StatusCommand command = new
StatusCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {
//
System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -459,13 +448,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);

@@ -490,7 +476,7 @@
try {

((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp." +
subject + ".prompt"));
+ .getProperty(subject, "prompt"));

} catch (PerfSONARException e) {


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperKeyStatusAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,12 +21,13 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
import
org.perfsonar.service.measurementPoint.lookingGlassType.encryption.PasswordEncryptor;
import
org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands.ParameterChecker;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.StatusAdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.commands.StatusCommand;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.commands.StatusCommandInterface;
@@ -76,7 +77,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -91,9 +92,9 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();
+
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

// FOR LOCAL TESTING
@@ -220,20 +221,13 @@

if (manager == null) {

- url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- keyUrl =
properties.getProperty("service.r.mp." + subject
- + ".keyUrl");
- passphrase =
properties.getProperty("service.r.mp." + subject
- + ".passphrase");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject,
"keyUrl");
+ passphrase = properties.getProperty(subject,
"passphrase");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username,
keyUrl, false);

@@ -307,34 +301,28 @@
logger
.debug("[JuniperKeyStatusAdapter] Configuring
available operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("STATUS")) {

StatusCommand command = new
StatusCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+
.getProperty(subject,token, "command"));
try {
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -454,17 +442,12 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- username = properties.getProperty("service.r.mp." +
subject
- + ".username");
- keyUrl = properties.getProperty("service.r.mp." +
subject
- + ".keyUrl");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ username = properties.getProperty(subject,
"username");
+ keyUrl = properties.getProperty(subject, "keyUrl");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshKeyManager(url, username, keyUrl,
false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperSshStatusAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,12 +21,13 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
import
org.perfsonar.service.measurementPoint.lookingGlassType.encryption.PasswordEncryptor;
import
org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands.ParameterChecker;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.StatusAdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.commands.StatusCommand;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.commands.StatusCommandInterface;
@@ -71,7 +72,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -86,9 +87,9 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();
+
this.serviceEngineType =
"service.MeasurementPoint.TELNETSSHType";

//FOR LOCAL TESTING
@@ -210,18 +211,12 @@

if (manager == null) {

- url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ password = properties.getProperty(subject,
"password");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

//System.out.println(username);
//System.out.println(password);
@@ -297,35 +292,29 @@

logger.debug("[JuniperSshStatusAdapter] Configuring available
operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("STATUS_")) {

StatusCommand command = new
StatusCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {

//System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -443,13 +432,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new SshManager(url, username,
PasswordEncryptor.decryptPassword(password), false);


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
2007-12-18 19:02:30 UTC (rev 3150)
+++
trunk/geant2_java-sshtelnet-mp/src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters/JuniperStatusAdapter.java
2007-12-19 11:02:01 UTC (rev 3151)
@@ -21,12 +21,13 @@
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.properties.PropertiesConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.base.exceptions.PerfSONARException;
import org.perfsonar.service.base.engine.ServiceEngine;
import
org.perfsonar.service.measurementPoint.lookingGlassType.encryption.PasswordEncryptor;
import
org.perfsonar.service.measurementPoint.lookingGlassType.engine.commands.ParameterChecker;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.DbMetadataConfiguration;
+import
org.perfsonar.service.measurementPoint.lookingGlassType.metadata.MetadataConfiguration;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.StatusAdapterInterface;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.commands.StatusCommand;
import
org.perfsonar.service.measurementPoint.lookingGlassType.status.commands.StatusCommandInterface;
@@ -72,7 +73,7 @@

private LoggerComponent logger = null;

- private PropertiesConfigurationComponent properties = null;
+ private MetadataConfiguration properties = null;

// ---------------------- caching attributes

@@ -87,9 +88,9 @@
logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance()
.getComponent(ComponentNames.LOGGER);

- properties = (PropertiesConfigurationComponent)
AuxiliaryComponentManager
-
.getInstance().getComponent(ComponentNames.CONFIG);
-
+ this.properties = new DbMetadataConfiguration();
+ properties.initStorage();
+
// FOR LOCAL TESTING
availableSpecificCommands = new ArrayList();

@@ -217,22 +218,16 @@

if (manager == null) {

- url = properties
- .getProperty("service.r.mp."
+ subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt =
properties.getProperty("service.r.mp." + subject
- + ".prompt");
- username =
properties.getProperty("service.r.mp." + subject
- + ".username");
- password =
properties.getProperty("service.r.mp." + subject
- + ".password");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject,
"prompt");
+ username = properties.getProperty(subject,
"username");
+ password = properties.getProperty(subject,
"password");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);
((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp."
+ subject + ".prompt"));
+ .getProperty(subject,
"prompt"));

}

@@ -304,36 +299,30 @@
// System.out.println("[JuniperStatusAdapter] Configuring
available
// operations ...");

- StringTokenizer tokenizer = null;
+ Iterator commands = null;
String token = null;

try {

- tokenizer = new StringTokenizer(properties
- .getProperty("service.mp." + subject
+ ".commands"), ",");
- while (tokenizer.hasMoreTokens()) {
+ commands = properties.getProperties(subject,
"commands").iterator();
+ while (commands.hasNext()) {

- token = tokenizer.nextToken();
+ token = (String) commands.next();
if (token.contains("STATUS_")) {

//
System.out.println(properties.getProperty("service.mp."+subject+".commands."+token));
StatusCommand command = new
StatusCommand(token, properties
-
.getProperty("service.mp." + subject + ".commands."
- +
token));
+ .getProperty(subject,
token, "command"));
try {
//
System.out.println("service.mp."+subject+".commands."+token+".minParamCount");
int minParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".minParamCount"));
+
.getProperty(subject, token, "minParamCount"));

command.setMinParamCount(minParamCount);
} catch (PerfSONARException e1) {
}
try {
int maxParamCount =
Integer.parseInt(properties
-
.getProperty("service.mp." + subject
-
+ ".commands." + token
-
+ ".maxParamCount"));
+
.getProperty(subject, token, "maxParamCount"));

command.setMaxParamCount(maxParamCount);
} catch (PerfSONARException e1) {
}
@@ -467,13 +456,10 @@

try {

- url = properties.getProperty("service.r.mp." +
subject + ".url");
- port =
Integer.parseInt(properties.getProperty("service.r.mp."
- + subject + ".port"));
- prompt = properties.getProperty("service.r.mp." +
subject
- + ".prompt");
- caching =
Integer.parseInt(properties.getProperty("service.r.mp." + subject
- + ".cache"));
+ url = properties.getProperty(subject, "url");
+ port =
Integer.parseInt(properties.getProperty(subject, "port"));
+ prompt = properties.getProperty(subject, "prompt");
+ caching =
Integer.parseInt(properties.getProperty(subject, "cache"));

manager = new TelnetManager(url, port, false);

@@ -498,7 +484,7 @@
try {

((TelnetManager) manager).setPrompt(properties
- .getProperty("service.r.mp." +
subject + ".prompt"));
+ .getProperty(subject, "prompt"));

} catch (PerfSONARException e) {




  • perfsonar: r3151 - in trunk/geant2_java-sshtelnet-mp: ant conf conf/org/perfsonar/service/measurementPoint/lookingGlassType/engine/adapters 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/engine/commands 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/metadata src/main/java/org/perfsonar/service/measurementPoint/lookingGlassType/status/adapters, svnlog, 12/19/2007

Archive powered by MHonArc 2.6.16.

Top of Page