Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r3809 - in trunk/rnp_java-cl-mp: ant conf conf/axis-1.4 doc doc/schema src/main/java/perfSONARWebAdmin/admin/wizard/services

Subject: perfsonar development work

List archive

perfsonar: r3809 - in trunk/rnp_java-cl-mp: ant conf conf/axis-1.4 doc doc/schema src/main/java/perfSONARWebAdmin/admin/wizard/services


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r3809 - in trunk/rnp_java-cl-mp: ant conf conf/axis-1.4 doc doc/schema src/main/java/perfSONARWebAdmin/admin/wizard/services
  • Date: Sun, 4 May 2008 17:29:26 -0400

Author: fernandes
Date: 2008-05-04 17:29:26 -0400 (Sun, 04 May 2008)
New Revision: 3809

Added:
trunk/rnp_java-cl-mp/doc/schema/errorResponse.rnc
Modified:
trunk/rnp_java-cl-mp/ant/axis-deploy-targets.xml
trunk/rnp_java-cl-mp/ant/libs-download-targets.xml
trunk/rnp_java-cl-mp/conf/axis-1.4/index.html
trunk/rnp_java-cl-mp/conf/service.properties.template
trunk/rnp_java-cl-mp/conf/service.properties.template-2
trunk/rnp_java-cl-mp/conf/wizard.properties
trunk/rnp_java-cl-mp/doc/CLMP Interface Specification.doc
trunk/rnp_java-cl-mp/doc/Changelog.txt

trunk/rnp_java-cl-mp/src/main/java/perfSONARWebAdmin/admin/wizard/services/CLMPHandler.java
Log:
Changed the properties for the new structure of WebAdmin
Changed the Handler for handling Authentication and these changes
Updated Documentation
This is most likely the final version for 3.0

Modified: trunk/rnp_java-cl-mp/ant/axis-deploy-targets.xml
===================================================================
--- trunk/rnp_java-cl-mp/ant/axis-deploy-targets.xml 2008-05-02 13:25:40
UTC (rev 3808)
+++ trunk/rnp_java-cl-mp/ant/axis-deploy-targets.xml 2008-05-04 21:29:26
UTC (rev 3809)
@@ -49,8 +49,8 @@
depends="copy-dep-base-service-jars">

<copy
file="${basedir}/lib/repository/nmwg/nmwg/1.0.20080124/nmwg-1.0.20080124.jar"
todir="${service.home}/${deploy.root}/WEB-INF/lib"/>
- <copy
file="${basedir}/lib/repository/perfsonar/perfsonar-base/1.0.20080310/perfsonar-base-1.0.20080310.jar"
todir="${service.home}/${deploy.root}/WEB-INF/lib"/>
- <copy
file="${basedir}/lib/repository/perfsonar/perfsonar-web-admin/0.8.1b/perfsonar-web-admin-0.8.1b.jar"
todir="${service.home}/${deploy.root}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/perfsonar/perfsonar-base/1.0.20080422/perfsonar-base-1.0.20080422.jar"
todir="${service.home}/${deploy.root}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/perfsonar/perfsonar-web-admin/0.8.5b/perfsonar-web-admin-0.8.5b.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"/>

@@ -221,8 +221,8 @@
<copy file="${basedir}/${build}/${jarfilename}-${version}.jar"
todir="${tmpdir}/WEB-INF/lib"/>

<copy
file="${basedir}/lib/repository/nmwg/nmwg/1.0.20080124/nmwg-1.0.20080124.jar"
todir="${tmpdir}/WEB-INF/lib"/>
- <copy
file="${basedir}/lib/repository/perfsonar/perfsonar-base/1.0.20080310/perfsonar-base-1.0.20080310.jar"
todir="${tmpdir}/WEB-INF/lib"/>
- <copy
file="${basedir}/lib/repository/perfsonar/perfsonar-web-admin/0.8.1b/perfsonar-web-admin-0.8.1b.jar"
todir="${tmpdir}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/perfsonar/perfsonar-base/1.0.20080422/perfsonar-base-1.0.20080422.jar"
todir="${tmpdir}/WEB-INF/lib"/>
+ <copy
file="${basedir}/lib/repository/perfsonar/perfsonar-web-admin/0.8.5b/perfsonar-web-admin-0.8.5b.jar"
todir="${tmpdir}/WEB-INF/lib"/>

<copy file="${basedir}/conf/eventType-map.xml"
todir="${tmpdir}/WEB-INF/classes/perfsonar/conf"/>

@@ -236,28 +236,13 @@

<replace
file="${tmpdir}/WEB-INF/classes/perfsonar/conf/wizard.properties"
token="__BASEPATH__"
-
value="/home/perfsonar/webapps/${service.name}-${version}/WEB-INF" />
+ value="/opt/perfsonar/services/perfsonar-clmp/WEB-INF" />

<replace
file="${tmpdir}/WEB-INF/classes/perfsonar/conf/log4j.properties"
token="_LOGPATH_"
-
value="/home/perfsonar/webapps/${service.name}-${version}/WEB-INF/logs"/>
+
value="/opt/perfsonar/services/perfsonar-clmp/WEB-INF/logs"/>

- <echo
file="${tmpdir}/WEB-INF/classes/perfsonar/conf/service.properties"
-
message="service.sax_parser.config=/home/perfsonar/webapps/${service.name}-${version}/WEB-INF/classes/perfsonar/conf/objects.config${line.separator}"
- append="true" />
-
- <echo
file="${tmpdir}/WEB-INF/classes/perfsonar/conf/service.properties"
-
message="service.log.log4j.config=/home/perfsonar/webapps/${service.name}-${version}/WEB-INF/classes/perfsonar/conf/log4j.properties${line.separator}"
- append="true" />
-
- <echo
file="${tmpdir}/WEB-INF/classes/perfsonar/conf/service.properties"
-
message="service.clmp.cron_dir=/home/perfsonar/webapps/${service.name}-${version}/WEB-INF/classes/perfsonar/cron${line.separator}"
- append="true" />

- <echo
file="${tmpdir}/WEB-INF/classes/perfsonar/conf/service.properties"
-
message="service.clmp.tools_map=/home/perfsonar/webapps/${service.name}-${version}/WEB-INF/classes/perfsonar/conf/eventType-map.xml${line.separator}"
- append="true" />
-
<mkdir dir="${tmpdir}/WEB-INF/logs"/>

<mkdir dir="${tmpdir}/WEB-INF/classes/perfsonar/cron"/>

Modified: trunk/rnp_java-cl-mp/ant/libs-download-targets.xml
===================================================================
--- trunk/rnp_java-cl-mp/ant/libs-download-targets.xml 2008-05-02 13:25:40
UTC (rev 3808)
+++ trunk/rnp_java-cl-mp/ant/libs-download-targets.xml 2008-05-04 21:29:26
UTC (rev 3809)
@@ -54,9 +54,9 @@

<artifact:dependencies>

- <dependency groupId="perfsonar" artifactId="perfsonar-base"
version="1.0.20080310"/>
+ <dependency groupId="perfsonar" artifactId="perfsonar-base"
version="1.0.20080422"/>
<dependency groupId="nmwg" artifactId="nmwg"
version="1.0.20080124"/>
- <dependency groupId="perfsonar" artifactId="perfsonar-web-admin"
version="0.8.1b"/>
+ <dependency groupId="perfsonar" artifactId="perfsonar-web-admin"
version="0.8.5b"/>

<localRepository refid="local.repository"/>
<remoteRepository refid="remote.repository"/>

Modified: trunk/rnp_java-cl-mp/conf/axis-1.4/index.html
===================================================================
--- trunk/rnp_java-cl-mp/conf/axis-1.4/index.html 2008-05-02 13:25:40
UTC (rev 3808)
+++ trunk/rnp_java-cl-mp/conf/axis-1.4/index.html 2008-05-04 21:29:26
UTC (rev 3809)
@@ -76,7 +76,6 @@
<p>
<span class="navtex"><a href="Wizard"
target="main">Service</a></span>
</p>
- </p>
</td>
</tr>
<tr>

Modified: trunk/rnp_java-cl-mp/conf/service.properties.template
===================================================================
--- trunk/rnp_java-cl-mp/conf/service.properties.template 2008-05-02
13:25:40 UTC (rev 3808)
+++ trunk/rnp_java-cl-mp/conf/service.properties.template 2008-05-04
21:29:26 UTC (rev 3809)
@@ -15,6 +15,6 @@
service.clmp.rp.maxthreads.traceroute=99999
service.clmp.rp.maxthreads.ping=99999

-service.ls.registration_file
+service.ls.registration_file=


service.as.point=http://homer.rediris.es:8080/perfSONAR-AS/services/AuthService

Modified: trunk/rnp_java-cl-mp/conf/service.properties.template-2
===================================================================
--- trunk/rnp_java-cl-mp/conf/service.properties.template-2 2008-05-02
13:25:40 UTC (rev 3808)
+++ trunk/rnp_java-cl-mp/conf/service.properties.template-2 2008-05-04
21:29:26 UTC (rev 3809)
@@ -1,28 +1,127 @@
+#
-----------------------------------------------------------------------------------------------
+# Configuration of the internal implementation structures
+
+
+# Group=Internal
+# Description=The type of service used to select the correct message handler
implementation.
service.r.type=mp

-service.mp.message_types=MeasurementRequest,EchoRequest
+# Group=Internal
+# Description=The java class file which implements the ServiceEngine
interface.

service.mp.class_name=org.perfsonar.service.measurementPoint.commandLine.CommandLineMPServiceEngine

-component.registrator.interval=86400000
-component.registrator.scheduler_component=scheduler
+# Group=Internal
+# Description=A CSV of request message types supported by the service.
+service.mp.message_types=MeasurementRequest,EchoRequest

-component.mp.scheduler_component=scheduler
+# Group=Internal
+# Description=File which contains the mapping information for parsing the
messages.
+service.sax_parser.config=/opt/perfsonar/services/perfsonar-clmp/WEB-INF/classes/perfsonar/conf/objects.config

+# Group=Internal
+# Description=File with configuration for the logger component.
+service.log.log4j.config=/opt/perfsonar/services/perfsonar-clmp/WEB-INF/classes/perfsonar/conf/log4j.properties
+
+# Group=Internal
+# Description=File with tools mapping and authentication information.
+service.clmp.tools_map=/opt/perfsonar/services/perfsonar-clmp/WEB-INF/classes/perfsonar/conf/eventType-map.xml
+
+
+#
-----------------------------------------------------------------------------------------------
+# Configuration of the scheduling functionality
+
+
+# Group=Cron-Like Scheduler
+# Description=Determines if the results of scheduled measurements which
don't have a MA configured should be stored locally or sent to a default MA.
For local storage, set 'local'. For a MA, give the full URL of the service.
service.clmp.default_ma=local
-service.clmp.cron_dir=/home/perfsonar/webapps/perfSONAR-CLMP/WEB-INF/classes/perfsonar/cron
-service.clmp.cron.local_storage_dir=/home/perfsonar/webapps/perfSONAR-CLMP/WEB-INF/classes/perfsonar/cron

+# Group=Cron-Like Scheduler
+# Description=Determines where to place locally stored results from the
scheduled measurements. Only used if the default_ma option is 'local'.
+service.clmp.cron.local_storage_dir=/opt/perfsonar/services/perfsonar-clmp/WEB-INF/classes/perfsonar/cron/local
+
+# Group=Cron-Like Scheduler
+# Description=Determines where the scheduler database and related files will
be stored.
+service.clmp.cron_dir=/opt/perfsonar/services/perfsonar-clmp/WEB-INF/classes/perfsonar/cron
+
+# Group=Cron-Like Scheduler
+# Description=General purpose scheduler component used by the cron-like
scheduler. Must exist in components.properties.
+component.mp.scheduler_component=scheduler
+
+
+#
-----------------------------------------------------------------------------------------------
+# Configuration of the internal resource protector
+
+
+# Group=Resource Protector
+# Description=Determines max concurrent threads for ping.
+service.clmp.rp.maxthreads.ping=99999
+
+# Group=Resource Protector
+# Description=Determines max concurrent threads for traceroute.
+service.clmp.rp.maxthreads.traceroute=99999
+
+# Group=Resource Protector
+# Description=Determines max concurrent threads for OWAMP.
service.clmp.rp.maxthreads.owping=99999
+
+# Group=Resource Protector
+# Description=Determines max concurrent threads for BWCTL.
service.clmp.rp.maxthreads.bwctl=99999
-service.clmp.rp.maxthreads.traceroute=99999
-service.clmp.rp.maxthreads.ping=99999

-service.r.organization_name=default_organization
-service.r.service_description=perfSONAR Command Line MP 2.0 Service
+
+#
-----------------------------------------------------------------------------------------------
+# Configuration of LS functionality
+
+# Group=LS
+# Description=The service type.
+service.r.service_type=mp
+
+# Group=LS
+# Description=The URL address of the LS service.
+service.r.ls_url=http://somewhere
+
+# Group=LS
+# Description=The URL address of the service configured by this
configuration file.
+service.r.access_point=http://somewhere
+
+# Group=LS
+# Description=The name of the organisation who is deploying the service.
+service.r.organization_name=X
+
+# Group=LS
+# Description=The name of the service (can contain multiple words).
service.r.service_name=perfSONAR-CLMP
+
+# Group=LS
+# Description=The version number of the service.
service.r.service_version=2.0
-service.r.contact_email=default@email

+# Group=LS
+# Description=The email address of the person who manages the service.
+service.r.contact_email=user@domain
+
+# Group=LS
+# Description=The description of the service.
+service.r.service_description=perfSONAR Command Line MP 2.0 Service
+
+# Group=LS
+# Description=(Optional) Absolute path to a file with more information to
register at the LS.
service.ls.registration_file=

-service.as.point=http://homer.rediris.es:8080/perfSONAR-AS/services/AuthService
+# Group=LS
+# Description=The time (miliseconds) between register requests to the LS
service (default value is 43200000 ms; 12 hours).
+component.registrator.interval=43200000
+
+# Group=LS
+# Description=The name of the scheduler component (the implementation of
this component must also be declared in the components.properties file).
+component.registrator.scheduler_component=scheduler
+
+
+#
-----------------------------------------------------------------------------------------------
+# Configuration of AuthN functionality
+
+
+# Group=Authentication
+# Description=The URL address of the Authentication Service.
+service.as.point=http\://homer.rediris.es\:8080/perfSONAR-AS/services/AuthService
+

Modified: trunk/rnp_java-cl-mp/conf/wizard.properties
===================================================================
--- trunk/rnp_java-cl-mp/conf/wizard.properties 2008-05-02 13:25:40 UTC (rev
3808)
+++ trunk/rnp_java-cl-mp/conf/wizard.properties 2008-05-04 21:29:26 UTC (rev
3809)
@@ -7,8 +7,8 @@
<!ELEMENT entry (#PCDATA) >
<!ATTLIST entry
key CDATA #REQUIRED
- password (true|false) #IMPLIED
- required (true|false) #IMPLIED >
+ password (true|false) #IMPLIED
+ required (true|false) #IMPLIED >
<!ELEMENT Comment (#PCDATA) >
<!ELEMENT ProposedValue (#PCDATA) >
<!ELEMENT Group (#PCDATA) >
@@ -18,10 +18,15 @@
>
<!ELEMENT AcceptedValue (#PCDATA) >
]>
+
+
<properties>
- <comment>Last Modification Thu Dec 13 16:10:40 EET 2007</comment>
-
- <!-- Internal RP -->
+
+
+ <comment>$Id$</comment>
+
+
+
<property>
<entry key="service.clmp.rp.maxthreads.ping"
required="true">99999</entry>
<Comment>Enter the quantity of threads for tool ping</Comment>
@@ -47,7 +52,6 @@
<Group order="4">Resource Protector</Group>
</property>

- <!-- Cron-Like Scheduler -->
<property>
<entry key="service.clmp.default_ma" required="true">local</entry>
<Comment>Specify default MA (e.g. http://address:8080/SQL-MA/services/MA
or local)</Comment>
@@ -55,14 +59,74 @@
<Group order="1">Cron-Like Scheduler</Group>
</property>
<property>
- <entry key="service.clmp.cron.local_storage_dir"
required="true">/home/perfsonar/webapps/perfSONAR-CLMP/classes/perfsonar/cron/local</entry>
+ <entry key="service.clmp.cron.local_storage_dir"
required="true">/opt/perfsonar/services/perfsonar-clmp/WEB-INF/classes/perfsonar/cron/local</entry>
<Comment>Enter directory for local storage</Comment>
-
<ProposedValue>/home/perfsonar/webapps/perfSONAR-CLMP/classes/perfsonar/cron/local</ProposedValue>
+
<ProposedValue>/opt/perfsonar/services/perfsonar-clmp/WEB-INF/classes/perfsonar/cron/local</ProposedValue>
<Group order="2">Cron-Like Scheduler</Group>
</property>

- <!-- Administration -->
+ <property>
+ <entry key="authentication.enable" required="true">no</entry>
+ <Comment>Do you wish to enable authentication?</Comment>
+ <ProposedValue>yes</ProposedValue>
+ <Group order="1" check="true">Authentication</Group>
+ <AcceptedValue>yes</AcceptedValue>
+ <AcceptedValue>no</AcceptedValue>
+ </property>
+
<property>
+ <entry key="service.as.point"
required="true">http://homer.rediris.es:8081</entry>
+ <Comment>Enter the URL address of the Authentication Service:</Comment>
+
<ProposedValue>http://homer.rediris.es:8080/perfSONAR-AS/services/AuthService</ProposedValue>
+ <Group order="2">Authentication</Group>
+ </property>
+
+ <property>
+ <entry key="authentication.ping" required="true">no</entry>
+ <Comment>Enable authentication for tool ping?:</Comment>
+ <ProposedValue>yes</ProposedValue>
+ <Group order="3" check="true">Authentication</Group>
+ <AcceptedValue>yes</AcceptedValue>
+ <AcceptedValue>no</AcceptedValue>
+ </property>
+
+ <property>
+ <entry key="authentication.traceroute" required="true">no</entry>
+ <Comment>Enable authentication for tool traceroute?:</Comment>
+ <ProposedValue>yes</ProposedValue>
+ <Group order="4" check="true">Authentication</Group>
+ <AcceptedValue>yes</AcceptedValue>
+ <AcceptedValue>no</AcceptedValue>
+ </property>
+
+ <property>
+ <entry key="authentication.owamp" required="true">no</entry>
+ <Comment>Enable authentication for tool OWAMP?:</Comment>
+ <ProposedValue>yes</ProposedValue>
+ <Group order="5" check="true">Authentication</Group>
+ <AcceptedValue>yes</AcceptedValue>
+ <AcceptedValue>no</AcceptedValue>
+ </property>
+
+ <property>
+ <entry key="authentication.bwctl" required="true">no</entry>
+ <Comment>Enable authentication for tool BWCTL?:</Comment>
+ <ProposedValue>yes</ProposedValue>
+ <Group order="6" check="true">Authentication</Group>
+ <AcceptedValue>yes</AcceptedValue>
+ <AcceptedValue>no</AcceptedValue>
+ </property>
+
+ <property>
+ <entry key="authentication.cron" required="true">no</entry>
+ <Comment>Enable authentication for scheduling functionality?:</Comment>
+ <ProposedValue>yes</ProposedValue>
+ <Group order="7" check="true">Authentication</Group>
+ <AcceptedValue>yes</AcceptedValue>
+ <AcceptedValue>no</AcceptedValue>
+ </property>
+
+ <property>
<entry key="servlet.username" required="true">perfsonaruser</entry>
<Comment>Give the username to use for logging in to the admin
pages</Comment>
<ProposedValue>perfsonaruser</ProposedValue>
@@ -75,7 +139,6 @@
<Group order="2">Administration</Group>
</property>

- <!-- LS -->
<property>
<entry key="service.r.service_name" required="true">CL-MP</entry>
<Comment>Enter the service name</Comment>
@@ -113,9 +176,12 @@
<Group order="6">LS</Group>
</property>
<property>
- <entry key="service.r.access_point"
required="true">http://mpaddress:8080/perfSONAR-CLMP/services/CommandLineService</entry>
+ <entry key="service.r.access_point"
required="true">http://mpaddress:8080/perfsonar-clmp/services/CommandLineService</entry>
<Comment>Give the service access point</Comment>
-
<ProposedValue>http://mpaddress:8080/perfSONAR-CLMP/services/CommandLineService</ProposedValue>
+
<ProposedValue>http://mpaddress:8080/perfsonar-clmp/services/CommandLineService</ProposedValue>
<Group order="7">LS</Group>
</property>
-</properties>
\ No newline at end of file
+
+
+
+</properties>

Modified: trunk/rnp_java-cl-mp/doc/CLMP Interface Specification.doc
===================================================================
(Binary files differ)

Modified: trunk/rnp_java-cl-mp/doc/Changelog.txt
===================================================================
--- trunk/rnp_java-cl-mp/doc/Changelog.txt 2008-05-02 13:25:40 UTC (rev
3808)
+++ trunk/rnp_java-cl-mp/doc/Changelog.txt 2008-05-04 21:29:26 UTC (rev
3809)
@@ -1,3 +1,7 @@
+v2.0:
+
+- New: Authentication Functionality added.
+- New: Configuration via a Servlet (WebAdmin).
- New: Scheduling of measurements through a Cron-Like Scheduler Component
(new eventType: cron/2.0).
- New: Inter-Service communication with SQL-MA to store scheduled
measurement results.
- Change: Improved Internal Resource Protector, better implementation using
Java Semaphores.
@@ -4,4 +8,7 @@
- Change: EventType to Tools Classes mapping via structured xml file
instead of hardcoded.
- Change: Smarter definition for tools exec timeouts, specially BWCTL.
- Change: Old simple eventTypes no longer supported (i.e. bwctl), fully
qualified eventTypes must now be used (i.e.
http://ggf.org/ns/nmwg/tools/bwctl/2.0)
-- Bug fix: When a ping request is made with packets of size smaller than 8
bytes, the ping command-line tool doesn't gives the RTT value. CL-MP will now
have datums without the value and valueUnits attributes for this case.
\ No newline at end of file
+- Bug fix: When a ping request is made with packets of size smaller than 8
bytes, the ping command-line tool doesn't gives the RTT value. CL-MP will now
have datums without the value and valueUnits attributes for this case.
+- Bug Fix: Traceroute's parameter displayTtl is now being ignored due to
differences in implementations of some linux distributions.
+
+Using perfsonar-base-1.0.20080422, nmwg-1.0.20080124,
perfsonar-web-admin-0.8.5b.jar.
\ No newline at end of file

Added: trunk/rnp_java-cl-mp/doc/schema/errorResponse.rnc

Modified:
trunk/rnp_java-cl-mp/src/main/java/perfSONARWebAdmin/admin/wizard/services/CLMPHandler.java
===================================================================
---
trunk/rnp_java-cl-mp/src/main/java/perfSONARWebAdmin/admin/wizard/services/CLMPHandler.java
2008-05-02 13:25:40 UTC (rev 3808)
+++
trunk/rnp_java-cl-mp/src/main/java/perfSONARWebAdmin/admin/wizard/services/CLMPHandler.java
2008-05-04 21:29:26 UTC (rev 3809)
@@ -3,16 +3,21 @@
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
+import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Calendar;
import java.util.Hashtable;
import java.util.Iterator;

import javax.servlet.http.HttpServletRequest;

+import perfSONARWebAdmin.auxiliary.PerfsonarProperties;
+import perfSONARWebAdmin.auxiliary.PerfsonarPropertiesImpl;
+import perfSONARWebAdmin.auxiliary.PerfsonarProperty;
import perfSONARWebAdmin.auxiliary.ServiceProperties;
import perfSONARWebAdmin.auxiliary.ServicePropertiesImpl;
import perfSONARWebAdmin.auxiliary.wizard.ConfigurationHandler;
@@ -59,6 +64,10 @@
private static final String ComponentsPropertiesPath = confPath
+ "components.properties";

+ // The path to the eventType-map file
+ private static final String EventTypeMapPath = confPath
+ + "eventType-map.xml";
+
// The path to the objects properties file
private static final String ObjectsConfigPath = confPath +
"objects.config";

@@ -72,7 +81,7 @@

// The path to the directory under the webapps folder in which the
service
// is installed
- private static String ServicePath;
+ private static String ServicePath = "";

// Bollean that states if the configuration process is finished
private static boolean configured = false;
@@ -102,7 +111,9 @@
// Also definining some more booleans for every different
group to be
// configured
boolean LSDone = false;
- // Other is every other group besides LS.
+ // Authentication group.
+ boolean authDone = false;
+ // Other is every other group besides LS and Auth.
boolean otherDone = false;

// Each group is independent from each other and can be
configured
@@ -119,6 +130,16 @@
try {
// Handling other groups configuration
// True if all is done properly
+ authDone = handleAuthentication(request);
+ } catch (Exception e) {
+
+ throw new Exception(
+ "Problem with Authentication
configuration!Please check your input.\n"
+ + getFault(e));
+ }
+ try {
+ // Handling other groups configuration
+ // True if all is done properly
otherDone = handleOther(request);
} catch (Exception e) {

@@ -128,7 +149,7 @@
}
// if every group has configured successfully then the final
// configuration procedures are called
- if (LSDone && otherDone) {
+ if (LSDone && otherDone && authDone) {
try {
configured = finishConfiguration();
// if everything has gone OK then true is
returned
@@ -219,7 +240,7 @@
while (groupIt.hasNext()) {
String group = (String) groupIt.next();
// Every other group should be handled except for LS
- if (!group.equals("LS")) {
+ if (!(group.equals("LS") ||
group.equals("Authentication"))) {

// Retrieving the properties belonging to the
group
WizardProperties groupProperties =
groupedProperties.get(group);
@@ -319,10 +340,110 @@
}
}

+ /**
+ * Method used for handling CL-MP authentication configuration
+ *
+ * @param request
+ * The HttpServletRequest containing input from the user
+ * @return True if authentication is configured successfully
+ * @throws Exception
+ */
+ private boolean handleAuthentication(HttpServletRequest request)
throws Exception {

+ WizardProperties groupProperties =
groupedProperties.get("Authentication");
+
+ if(groupProperties == null)
+ throw new Exception("There must a group
Authentication in wizard.properties.\n");
+
+
if("yes".equals(request.getParameter("authentication.enable").trim())){
+ groupProperties.remove("authentication.enable");
+
+ ArrayList<String> keys = new ArrayList<String>();
+
+ Iterator it = groupProperties.orderedKeys();
+ while (it.hasNext()) {
+ String key = (String) it.next();
+ if(key.startsWith("authentication"))
+
keys.add(key.substring(key.indexOf('.')+1));
+ }
+
+ FileReader fr = new FileReader(ServicePath +
EventTypeMapPath);
+ BufferedReader br = new BufferedReader(fr);
+ StringBuffer contents = new StringBuffer();
+
+ for(String line = br.readLine(); line != null; line =
br.readLine()){
+ if(line.contains("<name>")){
+ for(String key : keys)
+ if(line.contains(key)){
+ contents.append(line
+ "\n");
+
contents.append(br.readLine()+"\n"); /* read <class> */
+ line = br.readLine();
+
if(!line.contains("<authentication>"))
+ throw new
Exception("Malformed eventyType-map.xml file.\n");
+
+ String value =
request.getParameter("authentication."+key).trim();
+ if("no".equals(value))
+ line =
line.replace("yes", "no");
+ else
if("yes".equals(value))
+ line =
line.replace("no", "yes");
+ else
+ throw new
Exception("Unrecognized option '"+value+"' for authentication configuration
of tools.\n");
+
+
groupProperties.remove("authentication."+key);
+ break;
+ }
+ }
+ contents.append(line+"\n");
+ }
+
+ br.close();
+ fr.close();
+
+ FileWriter fw = new FileWriter(ServicePath +
EventTypeMapPath);
+ BufferedWriter bw = new BufferedWriter(fw);
+ bw.write(contents.toString().trim());
+ bw.close();
+ fw.close();
+
+
+ it = groupProperties.orderedKeys();
+ while (it.hasNext()) {
+ String key = (String) it.next();
+ // get the value from the request
+ String value =
request.getParameter(key).trim();
+ WizardProperty pr =
groupProperties.getWizardProperty(key);
+ // Set the property value
+ pr.setPropertyValue(value);
+ // if the property does not the check field
set, the also
+ // put the user input as the proposed value
also
+ // This happens, because properties that have
the check
+ // property set, are usually important for
the rest of the
+ // group properties since their value would
determine if the
+ // rest need to be configured. So their
proposed value is
+ // left to thr developer
+ if (!pr.getCheck()) {
+ pr.setProposedValue(value);
+ }
+ // Updating the property inside the group
propereties
+ groupProperties.setWizardProperty(key, pr);
+ }
+ // Updating the grouped properties
+ groupedProperties.put("Authentication",
groupProperties);
+ // Applying the configuration input from the user to
the service
+ try {
+ otherActions("Authentication",
groupProperties);
+ } catch (Exception e) {
+ // If actions had a problem then exception is
thrown
+ throw new Exception(getFault(e));
+ }
+ }
+
+ return true;
+ }
+
/**
* Method for handling all configuration actions regarding any other
group
- * besides LS
+ * besides LS and Authentication
*
* @param group
* The group
@@ -332,37 +453,86 @@
*/
private void otherActions(String group, WizardProperties
functionProperties)
throws IOException {
- // A class that makes modifying service properties a little
bit easier
- ServiceProperties serviceProperties = null;
- // The only other group for rrd ma is the Store group
- if (group.equals("Store")) {
- serviceProperties = new
ServicePropertiesImpl(ServicePath
- + ServicePropertiesPath);
+
+ // In this case changes go into the service.properties file
that uses
+ // groupig and description
+ // In order to keep that functionality we need in this case
to use the
+ // PerfsonarProperties class
+ if (!group.equals("Administration")) {
+
+ // Using PerfsonarProperties in order to keep the
grouping and
+ // description
+ PerfsonarProperties serviceProperties = null;
+ serviceProperties = new PerfsonarPropertiesImpl();
+ serviceProperties.loadProperties(new
FileInputStream(ServicePath
+ + ServicePropertiesPath));
+ // Getting the names for every property of the group
+ Iterator it = functionProperties.orderedKeys();
+ // Setting the value of each property
+
+ // An object that holds the property
group,description,value and key
+ PerfsonarProperty property = new PerfsonarProperty();
+ while (it.hasNext()) {
+ String key = (String) it.next();
+ // Setting service properties and wizard
properties
+
+ // Get the property
+ property = serviceProperties.getProperty(key);
+ // If key property does not exist the throw
an exception
+ if (property == null) {
+ throw new IOException("Key is invalid
" + key + " ");
+ } else {
+ // Change the value of the property
+
if(functionProperties.getProperty(key).equals("yes"))
+ property.setValue("on");
+ else if
(functionProperties.getProperty(key).equals("no"))
+ property.setValue("off");
+ else
+
property.setValue(functionProperties.getProperty(key));
+
+ serviceProperties.setProperty(key,
property);
+ }
+ properties.setWizardProperty(key,
functionProperties
+ .getWizardProperty(key));
+ }
+ // Storing all changes
+ serviceProperties.storeProperties(new
FileOutputStream(ServicePath
+ + ServicePropertiesPath));
}
// We don't really have any other groups just the ones for
the servlet
- // administration
+ // administration, that does not use grouping and description
so we can
+ // use
+ // the ServiceProperties class as usual
else {
- serviceProperties = new
ServicePropertiesImpl(ServicePath
- + ServletPropertiesPath);
+ // A class that makes modifying service properties a
little bit
+ // easier
+ ServiceProperties serviceProperties = new
ServicePropertiesImpl(
+ ServicePath + ServletPropertiesPath);
+ // Getting the names for every property of the group
+ Iterator it = functionProperties.orderedKeys();
+ // Setting the value of each property
+ String value = null;
+ while (it.hasNext()) {
+ String key = (String) it.next();
+ // Setting service properties and wizard
properties
+ value = functionProperties.getProperty(key);
+ if (value == null) {
+ throw new IOException("Key is invalid
" + key + " ");
+ } else {
+ serviceProperties.setProperty(key,
value);
+ }
+ properties.setWizardProperty(key,
functionProperties
+ .getWizardProperty(key));
+ }
+ serviceProperties.storeProperties();
+
}
- // Getting the names for every property of the group
- Iterator it = functionProperties.orderedKeys();
- // Setting the value of each property
- while (it.hasNext()) {
- String key = (String) it.next();
- // Setting service properties and wizard properties
- serviceProperties.setProperty(key, functionProperties
- .getProperty(key));
- properties.setWizardProperty(key, functionProperties
- .getWizardProperty(key));
- }
- // Storing all changes
- serviceProperties.storeProperties();
properties.storeToXML(new FileOutputStream(new
File(ServicePath
+ WizardPropertiesPath)), " Last Modification
"
+
Calendar.getInstance().getTime().toString());
}

+
/**
* Method for handling all configuration actions regarding the LS
* registration
@@ -372,23 +542,41 @@
* @throws IOException
*/
private void lsActions(WizardProperties finalProperties) throws
IOException {
- // Using the ServiceProperties class to acces the
service.properties
- // file
- ServiceProperties serviceProperties = new
ServicePropertiesImpl(
- ServicePath + ServicePropertiesPath);
+ // Changes happen into the service.property file that uses
groupig and
+ // description
+ // In order to keep that functionality we need in this case
to use the
+ // PerfsonarProperties class
+ PerfsonarProperties serviceProperties = new
PerfsonarPropertiesImpl();
+ serviceProperties.loadProperties(new
FileInputStream(ServicePath
+ + ServicePropertiesPath));
Iterator it = finalProperties.orderedKeys();
// Iterating through the LS registration properties properties
+
+ // Initializing the PerfsonarProperty object that holds
information
+ // about grouping and description
+ PerfsonarProperty property = new PerfsonarProperty();
while (it.hasNext()) {
String key = (String) it.next();
// Set the service properties
- serviceProperties
- .setProperty(key,
finalProperties.getProperty(key));
+
+ // Get the PerfsonarProperty object
+ property = serviceProperties.getProperty(key);
+
+ // If property key does not exist throw an exceptrion
+ if (property == null) {
+ throw new IOException("Key is invalid " + key
+ " ");
+ } else {
+ // Else set the value right
+
property.setValue(finalProperties.getProperty(key));
+ serviceProperties.setProperty(key, property);
+ }
// Set the wizard properties
properties.setWizardProperty(key, finalProperties
.getWizardProperty(key));
}
// Storing service properties
- serviceProperties.storeProperties();
+ serviceProperties.storeProperties(new
FileOutputStream(ServicePath
+ + ServicePropertiesPath));
// Setting the LS registration componenets in components
properties file
addRegistrationComponents();
// Storing the wizard properties
@@ -463,13 +651,23 @@
*/
public boolean finishConfiguration() throws Exception {

- ServiceProperties serviceProperties = new
ServicePropertiesImpl(
- ServicePath + ServicePropertiesPath);
- serviceProperties.setProperty("service.sax_parser.config",
ServicePath
- + ObjectsConfigPath);
- serviceProperties.setProperty("service.log.log4j.config",
ServicePath
- + LoggingPropertiesPath);
- serviceProperties.storeProperties();
+ PerfsonarProperties serviceProperties = new
PerfsonarPropertiesImpl();
+ serviceProperties.loadProperties(new
FileInputStream(ServicePath
+ + ServicePropertiesPath));
+ PerfsonarProperty property = new PerfsonarProperty();
+ property.setKey("service.sax_parser.config");
+ property.setValue(ServicePath + ObjectsConfigPath);
+ property.setGroup("Internals");
+ property.setDescription("Sax parser configuration paramater");
+ serviceProperties.setProperty(property.getKey(), property);
+ property = new PerfsonarProperty();
+ property.setKey("service.log.log4j.config");
+ property.setValue(ServicePath + LoggingPropertiesPath);
+ property.setGroup("Internals");
+ property.setDescription("Logging Properties path");
+ serviceProperties.setProperty(property.getKey(), property);
+ serviceProperties.storeProperties(new
FileOutputStream(ServicePath
+ + ServicePropertiesPath));

return true;




  • perfsonar: r3809 - in trunk/rnp_java-cl-mp: ant conf conf/axis-1.4 doc doc/schema src/main/java/perfSONARWebAdmin/admin/wizard/services, svnlog, 05/04/2008

Archive powered by MHonArc 2.6.16.

Top of Page