perfsonar-dev - r1692 - in branches/yi-udel/perfsonar: ant/xmlls conf conf/template lib/repository lib/repository/saxon schema/example-instances/sonar/LS schema/example-instances/sonar/LS/test schema/example-instances/sonar/LS/xslt src/org/perfsonar src/org/perfsonar/client/axis src/org/perfsonar/commons/auxiliary/components/simplescheduler src/org/perfsonar/commons/messages src/org/perfsonar/commons/util src/org/perfsonar/service/commons/engine src/org/perfsonar/service/commons/storage src/org/perfsonar/service/commons/storage/xmldb/exist/rest src/org/perfsonar/service/commons/storage/xmldb/exist/xmlrpc src/org/perfsonar/service/commons/storage/xmlfile src/org/perfsonar/service/lookupService/xmlType
Subject: perfsonar development work
List archive
r1692 - in branches/yi-udel/perfsonar: ant/xmlls conf conf/template lib/repository lib/repository/saxon schema/example-instances/sonar/LS schema/example-instances/sonar/LS/test schema/example-instances/sonar/LS/xslt src/org/perfsonar src/org/perfsonar/client/axis src/org/perfsonar/commons/auxiliary/components/simplescheduler src/org/perfsonar/commons/messages src/org/perfsonar/commons/util src/org/perfsonar/service/commons/engine src/org/perfsonar/service/commons/storage src/org/perfsonar/service/commons/storage/xmldb/exist/rest src/org/perfsonar/service/commons/storage/xmldb/exist/xmlrpc src/org/perfsonar/service/commons/storage/xmlfile src/org/perfsonar/service/lookupService/xmlType
Chronological Thread
- From:
- To:
- Subject: r1692 - in branches/yi-udel/perfsonar: ant/xmlls conf conf/template lib/repository lib/repository/saxon schema/example-instances/sonar/LS schema/example-instances/sonar/LS/test schema/example-instances/sonar/LS/xslt src/org/perfsonar src/org/perfsonar/client/axis src/org/perfsonar/commons/auxiliary/components/simplescheduler src/org/perfsonar/commons/messages src/org/perfsonar/commons/util src/org/perfsonar/service/commons/engine src/org/perfsonar/service/commons/storage src/org/perfsonar/service/commons/storage/xmldb/exist/rest src/org/perfsonar/service/commons/storage/xmldb/exist/xmlrpc src/org/perfsonar/service/commons/storage/xmlfile src/org/perfsonar/service/lookupService/xmlType
- Date: Thu, 19 Oct 2006 00:56:51 -0400
Author: zurawski
Date: 2006-10-19 00:56:50 -0400 (Thu, 19 Oct 2006)
New Revision: 1692
Added:
branches/yi-udel/perfsonar/lib/repository/saxon/
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-dom.jar
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-dom4j.jar
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-jdom.jar
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-sql.jar
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-xom.jar
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-xpath.jar
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-xqj.jar
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8.jar
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSCache.xml
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSGlobalPeers.xml
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSLocalPeers.xml
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSRegisterSummaryRequest.xml
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSTokenLocalRequest.xml
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/QueryScratch.txt
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/Stuff.class
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/Stuff.java
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/cache.xml
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/ext-summary.xml
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/initial.xml
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/local-summary.xml
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/local-summary.xsl
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/local-summary.xsl.back
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/summary.xsl
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/summary2.xsl
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/test.xml
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/test.xsl
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/test2.xml
branches/yi-udel/perfsonar/src/org/perfsonar/commons/messages/LSTokenRequest.java
branches/yi-udel/perfsonar/src/org/perfsonar/files.txt
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSGlobalTokenAction.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSGlobalTokenLoader.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSLocalTokenAction.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSLocalTokenLoader.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSSummary.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSSummaryLoader.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSTokenUtilities.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSUtilities.java
Modified:
branches/yi-udel/perfsonar/ant/xmlls/xmlls-axis-deploy-targets.xml
branches/yi-udel/perfsonar/ant/xmlls/xmlls-client-run-targets.xml
branches/yi-udel/perfsonar/ant/xmlls/xmlls-configure-targets.xml
branches/yi-udel/perfsonar/conf/log4j.properties
branches/yi-udel/perfsonar/conf/template/log4j.properties.ls-template
branches/yi-udel/perfsonar/conf/template/service.properties.ls-template
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSQueryRequest.xml
branches/yi-udel/perfsonar/src/org/perfsonar/client/axis/AxisClient.java
branches/yi-udel/perfsonar/src/org/perfsonar/commons/auxiliary/components/simplescheduler/Scheduler.java
branches/yi-udel/perfsonar/src/org/perfsonar/commons/auxiliary/components/simplescheduler/SchedulerTask.java
branches/yi-udel/perfsonar/src/org/perfsonar/commons/messages/Request.java
branches/yi-udel/perfsonar/src/org/perfsonar/commons/util/MathUtil.java
branches/yi-udel/perfsonar/src/org/perfsonar/commons/util/XMLUtils.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/engine/ActionType.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/GenericXmlStorageManager.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/StorageManager.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/xmldb/exist/rest/ExistDbHttpXmlStorageManager.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/xmldb/exist/xmlrpc/ExistDbXmlrpcXmlStorageManager.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/xmlfile/XmlFileStorageManager.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSAction.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSCleanup.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSCleanupLoader.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSDeregisterAction.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSGenericRegisterAction.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSLookupAction.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSRegisterAction.java
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/XmlTypeLSServiceEngine.java
Log:
Multi-LS update. This is missing the ant questions to generate the
config files, so there will be some directives missing. Also the jar
repository may not work properly.
-jason
Modified: branches/yi-udel/perfsonar/ant/xmlls/xmlls-axis-deploy-targets.xml
===================================================================
--- branches/yi-udel/perfsonar/ant/xmlls/xmlls-axis-deploy-targets.xml
2006-10-18 19:36:06 UTC (rev 1691)
+++ branches/yi-udel/perfsonar/ant/xmlls/xmlls-axis-deploy-targets.xml
2006-10-19 04:56:50 UTC (rev 1692)
@@ -32,12 +32,27 @@
<target name="copy-jars-for-xmlls">
+
+
+ <copy file="./lib/repository/saxon/saxon8-dom4j.jar"
todir="${axis.home}/WEB-INF/lib"/>
+ <copy file="./lib/repository/saxon/saxon8.jar"
todir="${axis.home}/WEB-INF/lib"/>
+ <copy file="./lib/repository/saxon/saxon8-sql.jar"
todir="${axis.home}/WEB-INF/lib"/>
+ <copy file="./lib/repository/saxon/saxon8-xpath.jar"
todir="${axis.home}/WEB-INF/lib"/>
+ <copy file="./lib/repository/saxon/saxon8-dom.jar"
todir="${axis.home}/WEB-INF/lib"/>
+ <copy file="./lib/repository/saxon/saxon8-jdom.jar"
todir="${axis.home}/WEB-INF/lib"/>
+ <copy file="./lib/repository/saxon/saxon8-xom.jar"
todir="${axis.home}/WEB-INF/lib"/>
+ <copy file="./lib/repository/saxon/saxon8-xqj.jar"
todir="${axis.home}/WEB-INF/lib"/>
+
+
+
<!-- copy file="./lib/repository/xml/resolver.jar"
todir="${axis.home}/WEB-INF/lib"/ -->
<copy file="./lib/repository/xalan/xalan/2.7.0/xalan-2.7.0.jar"
todir="${axis.home}/WEB-INF/lib"/>
<copy
file="./lib/repository/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar"
todir="${axis.home}/WEB-INF/lib"/>
<copy
file="./lib/repository/xml-apis/xml-apis/1.3.02/xml-apis-1.3.02.jar"
todir="${axis.home}/WEB-INF/lib"/>
<copy
file="./lib/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar"
todir="${axis.home}/WEB-INF/lib"/>
+
+
<copy
file="./lib/repository/commons-pool/commons-pool/1.1/commons-pool-1.1.jar"
todir="${axis.home}/WEB-INF/lib"/>
<copy
file="./lib/repository/exist/exist-db/1.0rc/exist-db-1.0rc.jar"
todir="${axis.home}/WEB-INF/lib"/>
<copy
file="./lib/repository/exist/exist-xmldb/1.0rc/exist-xmldb-1.0rc.jar"
todir="${axis.home}/WEB-INF/lib"/>
@@ -52,6 +67,15 @@
<target name="delete-jars-for-xmlls">
+ <delete file="${axis.home}/WEB-INF/lib/saxon8-dom4j.jar"/>
+ <delete file="${axis.home}/WEB-INF/lib/saxon8.jar"/>
+ <delete file="${axis.home}/WEB-INF/lib/saxon8-sql.jar"/>
+ <delete file="${axis.home}/WEB-INF/lib/saxon8-xpath.jar"/>
+ <delete file="${axis.home}/WEB-INF/lib/saxon8-dom.jar"/>
+ <delete file="${axis.home}/WEB-INF/lib/saxon8-jdom.jar"/>
+ <delete file="${axis.home}/WEB-INF/lib/saxon8-xom.jar"/>
+ <delete file="${axis.home}/WEB-INF/lib/saxon8-xqj.jar"/>
+
<delete file="${axis.home}/WEB-INF/lib/xalan-2.7.0.jar"/>
<delete file="${axis.home}/WEB-INF/lib/xercesImpl-2.6.2.jar"/>
<delete file="${axis.home}/WEB-INF/lib/xml-apis-1.3.02.jar"/>
Modified: branches/yi-udel/perfsonar/ant/xmlls/xmlls-client-run-targets.xml
===================================================================
--- branches/yi-udel/perfsonar/ant/xmlls/xmlls-client-run-targets.xml
2006-10-18 19:36:06 UTC (rev 1691)
+++ branches/yi-udel/perfsonar/ant/xmlls/xmlls-client-run-targets.xml
2006-10-19 04:56:50 UTC (rev 1692)
@@ -75,6 +75,43 @@
</target>
+
+
+
+ <!-- token test (local) -->
+ <target name="ls-run-token-local"
+ description="Sends request to Tomcat: TOKEN">
+ <java classname="org.perfsonar.client.testHarness.SOAPClient"
+ classpathref="classpath" fork="true">
+ <arg value="${ls.test.server}"/>
+ <arg
value="${basedir}/schema/example-instances/sonar/LS/test/LSTokenLocalRequest.xml"/>
+ <arg
value="${basedir}/schema/example-instances/sonar/LS/test/LSTokenLocalResponse.xml"/>
+ </java>
+ </target>
+
+ <!-- token test (global) -->
+ <target name="ls-run-token-global"
+ description="Sends request to Tomcat: TOKEN">
+ <java classname="org.perfsonar.client.testHarness.SOAPClient"
+ classpathref="classpath" fork="true">
+ <arg value="${ls.test.server}"/>
+ <arg
value="${basedir}/schema/example-instances/sonar/LS/test/LSTokenGlobalRequest.xml"/>
+ <arg
value="${basedir}/schema/example-instances/sonar/LS/test/LSTokenGlobalResponse.xml"/>
+ </java>
+ </target>
+
+ <!-- summary test -->
+ <target name="ls-run-summary"
+ description="Sends request to Tomcat: REGISTER">
+ <java classname="org.perfsonar.client.testHarness.SOAPClient"
+ classpathref="classpath" fork="true">
+ <arg value="${ls.test.server}"/>
+ <arg
value="${basedir}/schema/example-instances/sonar/LS/test/LSRegisterSummaryRequest.xml"/>
+ <arg
value="${basedir}/schema/example-instances/sonar/LS/test/LSRegisterSummaryResponse.xml"/>
+ </java>
+ </target>
+
+
</project>
Modified: branches/yi-udel/perfsonar/ant/xmlls/xmlls-configure-targets.xml
===================================================================
--- branches/yi-udel/perfsonar/ant/xmlls/xmlls-configure-targets.xml
2006-10-18 19:36:06 UTC (rev 1691)
+++ branches/yi-udel/perfsonar/ant/xmlls/xmlls-configure-targets.xml
2006-10-19 04:56:50 UTC (rev 1692)
@@ -43,6 +43,8 @@
value="LS"/>
<property name="default_in.r_description"
value="Test Lookup Service, perfSONAR"/>
+ <property name="default_in.r_rating"
+ value="1"/>
<property name="default_in.ls_storage_username"
value="lookupservice"/>
<property name="default_in.ls_storage_password"
@@ -122,6 +124,9 @@
token="%R_DESCRIPTION%"
value="${in.r_description}"/>
<replace file="${template_file_service}"
+ token="%R_RATING%"
+ value="${in.r_rating}"/>
+ <replace file="${template_file_service}"
token="%R_LOOKUP_SERVICE%"
value="${in.r_lookup_service}"/>
@@ -249,6 +254,10 @@
<input message="Lookup Information of service -- service description
[${default_in.r_description}]"
addproperty="in.r_description"
defaultvalue="${default_in.r_description}" />
+
+ <input message="Lookup Information of service -- service rating
[${default_in.r_rating}]"
+ addproperty="in.r_rating"
+ defaultvalue="${default_in.r_rating}" />
<input message="Lookup Service to register Lookup Information
[http://${hostname}:8080/axis/services/LookupService] - this functionality
will be disabled. To enable it uncomment the proper section in
service.properties file."
addproperty="in.r_lookup_service"
@@ -329,6 +338,7 @@
<echo message="LI-service name [${in.r_service_name}]" />
<echo message="LI-service type [${in.r_service_type}]" />
<echo message="LI-service description [${in.r_description}]" />
+ <echo message="LI-service rating [${in.r_rating}]" />
<echo message="LS to register with [${in.r_lookup_service}]" />
<echo message="XML database type [${in.ls_storage_type}]" />
<echo message="XML database collection [${in.ls_storage_uri}]" />
Modified: branches/yi-udel/perfsonar/conf/log4j.properties
===================================================================
--- branches/yi-udel/perfsonar/conf/log4j.properties 2006-10-18 19:36:06
UTC (rev 1691)
+++ branches/yi-udel/perfsonar/conf/log4j.properties 2006-10-19 04:56:50
UTC (rev 1692)
@@ -1,20 +1,13 @@
## $Id$
-## project: perfSONAR
-## author: romradz
+## Project: perfSONAR
+# needs to be adjusted by service deployer
+logDir=/home/jason/Desktop/perfSONAR/svn/YI/perfsonar/log
-# point the property to the directory where log files should be created.
Suggested directory is
-# $PERFSONAR/log
-# example path for log files
-logDir=/opt/perfsonar/log
-
-
-## --------------- The properties below do not need any changes -----------
-
log4j.rootLogger=INFO, rootAppender
log4j.logger.sonar-debug=DEBUG, debugAppender
log4j.logger.sonar-info=INFO, infoAppender
@@ -35,6 +28,7 @@
log4j.appender.debugAppender.MaxFileSize=500KB
log4j.appender.debugAppender.MaxBackupIndex=100
log4j.appender.debugAppender.layout=org.apache.log4j.PatternLayout
+## log4j.appender.debugAppender.layout.ConversionPattern=%d %5p - %m%n
log4j.appender.debugAppender.layout.ConversionPattern=%d %5p - %m%n
log4j.appender.infoAppender=org.apache.log4j.RollingFileAppender
Modified:
branches/yi-udel/perfsonar/conf/template/log4j.properties.ls-template
===================================================================
--- branches/yi-udel/perfsonar/conf/template/log4j.properties.ls-template
2006-10-18 19:36:06 UTC (rev 1691)
+++ branches/yi-udel/perfsonar/conf/template/log4j.properties.ls-template
2006-10-19 04:56:50 UTC (rev 1692)
@@ -21,43 +21,43 @@
log4j.appender.rootAppender.MaxFileSize=500KB
log4j.appender.rootAppender.MaxBackupIndex=1000
log4j.appender.rootAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.rootAppender.layout.ConversionPattern=%p:
%m%n----------------------\n
+log4j.appender.rootAppender.layout.ConversionPattern=%d %5p - %m%n
log4j.appender.debugAppender=org.apache.log4j.RollingFileAppender
log4j.appender.debugAppender.File=${logDir}/sonar_debug.log
log4j.appender.debugAppender.MaxFileSize=500KB
log4j.appender.debugAppender.MaxBackupIndex=100
log4j.appender.debugAppender.layout=org.apache.log4j.PatternLayout
-## log4j.appender.debugAppender.layout.ConversionPattern=%p:
%m%n----------------------\n
-log4j.appender.debugAppender.layout.ConversionPattern=%p:
%m%n----------------------\n
+## log4j.appender.debugAppender.layout.ConversionPattern=%d %5p - %m%n
+log4j.appender.debugAppender.layout.ConversionPattern=%d %5p - %m%n
log4j.appender.infoAppender=org.apache.log4j.RollingFileAppender
log4j.appender.infoAppender.File=${logDir}/sonar_info.log
log4j.appender.infoAppender.MaxFileSize=500KB
log4j.appender.infoAppender.MaxBackupIndex=100
log4j.appender.infoAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.infoAppender.layout.ConversionPattern=%p:
%m%n----------------------\n
+log4j.appender.infoAppender.layout.ConversionPattern=%d %5p - %m%n
log4j.appender.warnAppender=org.apache.log4j.RollingFileAppender
log4j.appender.warnAppender.File=${logDir}/sonar_warn.log
log4j.appender.warnAppender.MaxFileSize=500KB
log4j.appender.warnAppender.MaxBackupIndex=100
log4j.appender.warnAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.warnAppender.layout.ConversionPattern=%p:
%m%n----------------------\n
+log4j.appender.warnAppender.layout.ConversionPattern=%d %5p - %m%n
log4j.appender.errorAppender=org.apache.log4j.RollingFileAppender
log4j.appender.errorAppender.File=${logDir}/sonar_error.log
log4j.appender.errorAppender.MaxFileSize=500KB
log4j.appender.errorAppender.MaxBackupIndex=100
log4j.appender.errorAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.errorAppender.layout.ConversionPattern=%p:
%m%n----------------------\n
+log4j.appender.errorAppender.layout.ConversionPattern=%d %5p - %m%n
log4j.appender.fatalAppender=org.apache.log4j.RollingFileAppender
log4j.appender.fatalAppender.File=${logDir}/sonar_fatal.log
log4j.appender.fatalAppender.MaxFileSize=500KB
log4j.appender.fatalAppender.MaxBackupIndex=100
log4j.appender.fatalAppender.layout=org.apache.log4j.PatternLayout
-log4j.appender.fatalAppender.layout.ConversionPattern=%p:
%m%n----------------------\n
+log4j.appender.fatalAppender.layout.ConversionPattern=%d %5p - %m%n
Modified:
branches/yi-udel/perfsonar/conf/template/service.properties.ls-template
===================================================================
--- branches/yi-udel/perfsonar/conf/template/service.properties.ls-template
2006-10-18 19:36:06 UTC (rev 1691)
+++ branches/yi-udel/perfsonar/conf/template/service.properties.ls-template
2006-10-19 04:56:50 UTC (rev 1692)
@@ -31,6 +31,7 @@
service.r.service_name=%R_SERVICE_NAME%
service.r.service_type=%R_SERVICE_TYPE%
service.r.service_description=%R_DESCRIPTION%
+service.r.service_rating=%R_RATING%
# Lookup Service to register to - only for Registration to LS
#service.r.ls_url=%R_LOOKUP_SERVICE%
@@ -64,6 +65,6 @@
# --- Service properties
---------------------------------------------------------------
service.ls.class_name=org.perfsonar.service.lookupService.xmlType.XmlTypeLSServiceEngine
-service.ls.message_types=LSQueryRequest,LSRegisterRequest,LSDeregisterRequest,LSKeepaliveRequest
+service.ls.message_types=LSQueryRequest,LSRegisterRequest,LSDeregisterRequest,LSKeepaliveRequest,LSTokenRequest
-# ------- END
--------------------------------------------------------------------------
\ No newline at end of file
+# ------- END
--------------------------------------------------------------------------
Added: branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-dom.jar
Property changes on:
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-dom.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-dom4j.jar
Property changes on:
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-dom4j.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-jdom.jar
Property changes on:
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-jdom.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-sql.jar
Property changes on:
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-sql.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-xom.jar
Property changes on:
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-xom.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-xpath.jar
Property changes on:
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-xpath.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-xqj.jar
Property changes on:
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8-xqj.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/yi-udel/perfsonar/lib/repository/saxon/saxon8.jar
Property changes on:
branches/yi-udel/perfsonar/lib/repository/saxon/saxon8.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSCache.xml
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSGlobalPeers.xml
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSLocalPeers.xml
Modified:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSQueryRequest.xml
===================================================================
---
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSQueryRequest.xml
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSQueryRequest.xml
2006-10-19 04:56:50 UTC (rev 1692)
@@ -21,15 +21,15 @@
xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/"
xmlns:xquery="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/xquery/1.0/">
- <nmwg:metadata id="meta1">
-
+ <nmwg:metadata id="meta1">
<xquery:subject id="sub1">
+
declare namespace nmwg="http://ggf.org/ns/nmwg/base/2.0/";
- declare namespace
perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/";
- declare namespace
psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/";
- declare namespace
xquery="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/xquery/1.0/";
-
- /nmwg:store/nmwg:metadata
+ declare namespace nmwgt="http://ggf.org/ns/nmwg/topology/2.0/";
+ for $m in
/nmwg:store[@type='LSStore'
or @type='LSCache']/nmwg:metadata
+ for $d in
/nmwg:store[@type='LSStore'
or @type='LSCache']/nmwg:data
+ where $m/@id=$d/@metadataIdRef and
$d//nmwgt:hostName/text()[fn:matches(.,'.*.abilene.ucaid.edu')]
+ return $m
</xquery:subject>
<nmwg:eventType>service.lookup.xquery</nmwg:eventType>
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSRegisterSummaryRequest.xml
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/LSTokenLocalRequest.xml
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/test/QueryScratch.txt
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/Stuff.class
Property changes on:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/Stuff.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/Stuff.java
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/cache.xml
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/ext-summary.xml
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/initial.xml
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/local-summary.xml
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/local-summary.xsl
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/local-summary.xsl.back
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/summary.xsl
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/summary2.xsl
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/test.xml
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/test.xsl
Added:
branches/yi-udel/perfsonar/schema/example-instances/sonar/LS/xslt/test2.xml
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/client/axis/AxisClient.java
===================================================================
--- branches/yi-udel/perfsonar/src/org/perfsonar/client/axis/AxisClient.java
2006-10-18 19:36:06 UTC (rev 1691)
+++ branches/yi-udel/perfsonar/src/org/perfsonar/client/axis/AxisClient.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -15,60 +15,38 @@
* Just pass Document and address as arguments
*
* @author Maciej Glowiak
+ * @author Jason Zurawski
*
*/
public class AxisClient implements Client {
- /* (non-Javadoc)
- * @see org.perfsonar.client.axis.Client#sendRequest(java.lang.String,
org.w3c.dom.Document)
- */
+ public AxisClient() {
+ }
+
public Document sendRequest(String endPoint, Document requestDocument)
throws Exception {
+ // prepare to call - set service elements
+ Service service = new Service();
+ Call call = (Call)service.createCall();
+ call.setTargetEndpointAddress(new URL(endPoint));
+ call.setOperationName(new QName("http://soapinterop.org/","submit"));
+
// build a SOAPBodyElement from the document
SOAPBodyElement requestMessage =
- new SOAPBodyElement(requestDocument.getDocumentElement());
+ new SOAPBodyElement(requestDocument.getDocumentElement());
+
+ // call on the end point
+ Object resultObject = call.invoke(new Object[] {requestMessage});
- // get a timestamp.
-// double startTime =
-// new Long(System.currentTimeMillis()).doubleValue();
+ // result object is a vector - strange!!! But this is how the world
works :-D
+ // we will now extract the result from the vector
+ SOAPBodyElement resultSBE;
+ Document resultDocument = null;
+ resultSBE= (SOAPBodyElement)((Vector)resultObject).get(0);
+ resultDocument = resultSBE.getAsDocument();
-// try {
- // prepare to call - set service elements
- Service service = new Service();
- Call call = (Call)service.createCall();
- call.setTargetEndpointAddress(new URL(endPoint));
- call.setOperationName(new
QName("http://soapinterop.org/","submit"));
-
- // call on the end point
- Object resultObject = call.invoke(new Object[] {requestMessage});
-
- // get another timestamp
-// double endTime =
-// new Long(System.currentTimeMillis()).doubleValue();
-
- // result object is a vector - strange!!! But this is how the
world works :-D
- // we will now extract the result from the vector
- SOAPBodyElement resultSBE;
-
- Document resultDocument = null;
-
- resultSBE= (SOAPBodyElement)((Vector)resultObject).get(0);
-
- // change it to document - here is where validity
- // can be checked..
- resultDocument = resultSBE.getAsDocument();
-
- // DOMBuilder factory1 = new DOMBuilder();
- // org.jdom.Document domResult = factory1.build(result);
- // XMLOutputter outputter = new XMLOutputter();
- // outputter.output(domResult,outWriter);
-
- return resultDocument;
-// } catch (Exception ex) {
-//
-// }
-
+ return resultDocument;
}
}
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/commons/auxiliary/components/simplescheduler/Scheduler.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/commons/auxiliary/components/simplescheduler/Scheduler.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/commons/auxiliary/components/simplescheduler/Scheduler.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -7,6 +7,7 @@
import java.util.HashSet;
import java.util.Set;
+import java.util.Iterator;
import org.perfsonar.commons.auxiliary.AuxiliaryComponent;
import org.perfsonar.commons.auxiliary.AuxiliaryComponentManager;
@@ -173,7 +174,84 @@
}
+
+ /**
+ * Jason - 10/1/06
+ *
+ * This function makes the (correct?) assumption that at any given time
+ * a specific scheduler has only one task (if this ever changes this
+ * should of course be modified). Given this assumption we can say that
+ * the first task is the only task, and we can then reset this task to
+ * '0' to force the scheduler to evaluate it immediatly.
+ */
+ public void restartScheduler() {
+ if(!(isEmpty())) {
+ SchedulerTask t = null;
+ Iterator it = tasks.iterator();
+ if(it.hasNext()) {
+ t = (SchedulerTask) it.next();
+ t.resetTimestamp();
+ }
+ }
+ }
+ /**
+ * Jason - 10/1/06
+ *
+ * This function makes the (correct?) assumption that at any given time
+ * a specific scheduler has only one task (if this ever changes this
+ * should of course be modified). Given this assumption we can say that
+ * the first task is the only task, and we can then 'add' some extra time
+ * to the timestamp to force the scheduler into evaluating the task that
+ * much further into the future.
+ *
+ * ex:
+ *
+ * Last Run 20, Interval = 5, Current Time = 22
+ * Next Run Should be in 3 (20+5-22=3), Time 25
+ *
+ * We can 'advance' the Last run time (timestamp) by some value, lets
say 5:
+ *
+ * Last Run 20+5, Interval = 5, Current Time = 22
+ * Next Run Should be in 8 (25+5-22=8), Time 30
+ *
+ */
+ public void advanceScheduler(long timestamp) {
+ if(!(isEmpty())) {
+ SchedulerTask t = null;
+ Iterator it = tasks.iterator();
+ if(it.hasNext()) {
+ t = (SchedulerTask) it.next();
+ t.increaseTimestamp(timestamp);
+ }
+ }
+ }
+
+ /**
+ * Jason - 10/1/06
+ *
+ * This function makes the (correct?) assumption that at any given time
+ * a specific scheduler has only one task (if this ever changes this
+ * should of course be modified). Given this assumption we can say that
+ * the first task is the only task, and we can then reset this task to
+ * some future (or past, but that defeats the purpose of this exercise
of
+ * course) value to force the scheduler to evaluate it sometime in the
+ * future, essentually 'skipping' some other slots that a periodic action
+ * may need to occur. This is a more dangerous function than the
'advance'
+ * because to work properly we must provide some math dealing with the
+ * current time instead of dealing with relative time.
+ */
+ public void setScheduler(long timestamp) {
+ if(!(isEmpty())) {
+ SchedulerTask t = null;
+ Iterator it = tasks.iterator();
+ if(it.hasNext()) {
+ t = (SchedulerTask) it.next();
+ t.setTimestamp(timestamp);
+ }
+ }
+ }
+
// ---------------------------- Private Methods
@@ -194,6 +272,14 @@
/**
+ * Checks if scheduler has any tasks
+ * @return
+ */
+ public boolean isEmpty() {
+ return tasks.isEmpty();
+ }
+
+ /**
* Set scheduler paused. It'll be still working but won't be
* scheduling and running tasks
* @param paused
@@ -205,4 +291,4 @@
}
-} //Scheduler
\ No newline at end of file
+} //Scheduler
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/commons/auxiliary/components/simplescheduler/SchedulerTask.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/commons/auxiliary/components/simplescheduler/SchedulerTask.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/commons/auxiliary/components/simplescheduler/SchedulerTask.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -107,6 +107,27 @@
}
+
+ /**
+ * Set timestamp to a new value to facilitate 'stalling'
+ * @param interval
+ */
+ public void setTimestamp(long timestamp) {
+
+ this.timestamp = timestamp;
+
+ }
+
+
+ /**
+ * Increase timestamp to a new value to facilitate 'stalling'
+ * @param interval
+ */
+ public void increaseTimestamp(long timestamp) {
+
+ this.timestamp = this.timestamp + timestamp;
+
+ }
/**
* Set timestamp of recent run of action on the beginning of epoch
Added:
branches/yi-udel/perfsonar/src/org/perfsonar/commons/messages/LSTokenRequest.java
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/commons/messages/Request.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/commons/messages/Request.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/commons/messages/Request.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -286,7 +286,8 @@
}
- message.setId(reqMessage.getId());
+ message.setId(reqMessage.getId());
+ message.setParameters(reqMessage.getParameters());
message.setType(reqMessage.getType());
message.setData(data);
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/commons/util/MathUtil.java
===================================================================
--- branches/yi-udel/perfsonar/src/org/perfsonar/commons/util/MathUtil.java
2006-10-18 19:36:06 UTC (rev 1691)
+++ branches/yi-udel/perfsonar/src/org/perfsonar/commons/util/MathUtil.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -8,17 +8,60 @@
import org.perfsonar.service.commons.exceptions.DataFormatException;
import org.perfsonar.service.commons.exceptions.SystemException;
+import java.lang.String;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
/**
* Class providing Mathematical functions
*
* @author loukik
+ * @author Jason Zurawski
*
*/
public class MathUtil {
public MathUtil() {
}
+
+ /**
+ * Method to take an access point (with markup) and a rank and convert
this
+ * into a usable ID. We start by extracting the hostname, coverting
this to
+ * to the IP address, then calculating the bitwise 'value' of the
address
+ * (the long way of course). The final result is then concatinated with
the
+ * sent rank.
+ *
+ * @throws SystemException
+ * @throws UnknownHostException
+ */
+ public static String calculateId(String accessPoint, String rank) throws
SystemException {
+ int idValue = 0;
+ String[] slashSplit = accessPoint.split("\\/");
+ String[] colonSplit = slashSplit[2].split(":");
+ String hostName = colonSplit[0];
+
+ try {
+ InetAddress addr = InetAddress.getByName(hostName);
+ byte[] ipAddr = addr.getAddress();
+
+ for (int i=0,j=3; i<ipAddr.length; i++,j--) {
+ idValue = idValue + (int)((int)(ipAddr[i]&255) *
java.lang.Math.pow(256,j));
+ }
+ }
+ catch (UnknownHostException uhe) {
+ throw new SystemException("MathUtil: calculateID can't find the host
in question: " +
+ uhe.getMessage(), uhe);
+ }
+ catch (Exception e) {
+ throw new SystemException("MathUtil: calculateID exception: " +
+ e.getMessage(), e);
+ }
+
+ java.lang.Long l = new java.lang.Long(((long)(idValue & 0xffffffffL)));
+
+ return (rank + l.toString());
+ }
/**
* Operation which converts array of double values representing octet
values into
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/commons/util/XMLUtils.java
===================================================================
--- branches/yi-udel/perfsonar/src/org/perfsonar/commons/util/XMLUtils.java
2006-10-18 19:36:06 UTC (rev 1691)
+++ branches/yi-udel/perfsonar/src/org/perfsonar/commons/util/XMLUtils.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -24,6 +24,9 @@
import org.ggf.ns.nmwg.base.v2_0.Element;
import org.ggf.ns.nmwg.base.v2_0.Handler;
import org.ggf.ns.nmwg.base.v2_0.Message;
+import org.ggf.ns.nmwg.base.v2_0.Store;
+import org.ggf.ns.nmwg.base.v2_0.MessageHandler;
+import org.ggf.ns.nmwg.base.v2_0.GenericHandler;
import org.perfsonar.service.commons.exceptions.PerfSONARException;
import org.perfsonar.service.commons.exceptions.RequestException;
@@ -290,7 +293,62 @@
}
+ public static Element stringToElement(String elementString,
+ String parserFile,
+ String element) {
+ String DEFAULT_PARSER_NAME = "org.apache.xerces.parsers.SAXParser";
+ String NAMESPACES_FEATURE_ID =
"http://xml.org/sax/features/namespaces";
+ String NAMESPACE_PREFIXES_FEATURE_ID =
"http://xml.org/sax/features/namespace-prefixes";
+
+ StringReader stringReader = new StringReader(elementString);
+ InputSource inputSource = new InputSource(stringReader);
+
+ GenericHandler handler = new GenericHandler();
+ handler.setConfigFile(parserFile);
+
+ XMLReader parser = null;
+
+ boolean namespaces = true;
+ boolean namespacePrefixes = true;
+
+ if (parser == null) {
+ try {
+ parser =
XMLReaderFactory.createXMLReader(DEFAULT_PARSER_NAME);
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ try {
+ parser.setFeature(NAMESPACES_FEATURE_ID, namespaces);
+ } catch (SAXException e) {
+ e.printStackTrace();
+ }
+
+ try {
+ parser.setFeature(NAMESPACE_PREFIXES_FEATURE_ID,
namespacePrefixes);
+ } catch (SAXException e) {
+ e.printStackTrace();
+ }
+
+ parser.setContentHandler(handler);
+ parser.setErrorHandler(handler);
+
+ try {
+ parser.parse(inputSource);
+ } catch (SAXParseException e) {
+ // ignore
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return ((Element)handler.getElement(element));
+ }
+
+
+
// --------------------------------------------------------- private
methods
Added: branches/yi-udel/perfsonar/src/org/perfsonar/files.txt
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/engine/ActionType.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/engine/ActionType.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/engine/ActionType.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -11,6 +11,7 @@
* @author loukik
* @author Maciej Glowiak
* @author romradz
+ * @author Jason Zurawski
*
*/
public class ActionType {
@@ -45,28 +46,40 @@
/**
- * Action type to request a measurement
+ * Action type to register
*/
public static final String LS_REGISTER = "LS_REGISTER";
/**
- * Action type to request a measurement
+ * Action type to lookup
*/
public static final String LS_LOOKUP = "LS_LOOKUP";
/**
- * Action type to request a measurement
+ * Action type to de-register
*/
public static final String LS_DEREGISTER = "LS_DEREGISTER";
+
/**
- * Action type to request a measurement
+ * Action type to keepalive
*/
public static final String LS_KEEPALIVE = "LS_KEEPALIVE";
+
/**
+ * Action type to pass a token
+ */
+ public static final String LS_TOKEN = "LS_TOKEN";
+
+
+ // --------------------------------------------- TOPO Service Actions
+
+
+
+ /**
* Action type to request a full topology database download
*/
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/GenericXmlStorageManager.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/GenericXmlStorageManager.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/GenericXmlStorageManager.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -31,13 +31,13 @@
/**
* Stores data in a data repository.
*/
+
/*
-
Do we still need this w/ no XUpdate?
-
+*/
public Object store(Object dataSet)
throws SystemException, RequestException, DataFormatException;
-*/
+
} //StorageManager
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/StorageManager.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/StorageManager.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/StorageManager.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -37,12 +37,11 @@
* Stores data in a data repository.
*/
/*
-
Do we still need this w/ no XUpdate?
-
+*/
public Object store(Object dataSet)
throws SystemException, RequestException, DataFormatException;
-*/
+
} //StorageManager
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/xmldb/exist/rest/ExistDbHttpXmlStorageManager.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/xmldb/exist/rest/ExistDbHttpXmlStorageManager.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/xmldb/exist/rest/ExistDbHttpXmlStorageManager.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -117,16 +117,15 @@
* @return depends on getResultType()
*/
/*
-
Do we still need this w/ no XUpdate?
-
+*/
public Object store(Object dataSet)
throws SystemException, RequestException, DataFormatException {
return xupdateHttp(dataSet);
}
-*/
+
// -------------------------------------- protected methods
@@ -162,8 +161,8 @@
/*
-
Do we still need this w/ no XUpdate?
+*/
protected Object xupdateHttp(Object xml)
throws SystemException {
@@ -193,8 +192,8 @@
return results; // String, String[] or XmlDbResult
// - depends on getResultType()
}
-*/
+
} //ExistDbXmlrpcXmlStorageManager
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/xmldb/exist/xmlrpc/ExistDbXmlrpcXmlStorageManager.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/xmldb/exist/xmlrpc/ExistDbXmlrpcXmlStorageManager.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/xmldb/exist/xmlrpc/ExistDbXmlrpcXmlStorageManager.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -193,9 +193,8 @@
* @return null
*/
/*
-
Do we still need this with no XUpdate?
-
+*/
public Object store(Object dataSet) throws SystemException,
RequestException, DataFormatException {
@@ -238,10 +237,10 @@
return null;
}
-*/
+
/**
* Check if keepConnection flag is set.
* @return true if the connection is persistent (common for all DB
requests),
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/xmlfile/XmlFileStorageManager.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/xmlfile/XmlFileStorageManager.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/commons/storage/xmlfile/XmlFileStorageManager.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -160,8 +160,8 @@
* UNIMPLEMENTED
*/
/*
-
Do we still need this w/ no XUpdate?
+*/
public Object store(Object dataSet) throws SystemException,
RequestException, DataFormatException {
@@ -169,7 +169,7 @@
throw new SystemException("not implemented");
}
-*/
+
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSAction.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSAction.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSAction.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -41,15 +41,33 @@
* The name of the store collection (containing LS data/metadata
*/
protected static final String LS_STORE_COLLECTION_TYPE = "LSStore";
+
+
+ /**
+ * The name of the cache collection (containing summarized LS
data/metadata)
+ */
+ protected static final String LS_CACHE_COLLECTION_TYPE = "LSCache";
+
-
/**
* The name of the control collection of LS
*/
protected static final String LS_STORE_CONTROL_COLLECTION_TYPE =
"LSStore-control";
+
+ /**
+ * The name of the cache collection (containing summarized LS
data/metadata)
+ */
+ protected static final String LS_LOCAL_PEER_COLLECTION_TYPE =
"LSLocalPeers";
+
/**
+ * The name of the cache collection (containing summarized LS
data/metadata)
+ */
+ protected static final String LS_GLOBAL_PEER_COLLECTION_TYPE =
"LSGlobalPeers";
+
+
+ /**
* LS Key name
*/
protected static final String LS_KEY = "lsKey";
@@ -57,6 +75,10 @@
/**
* Header for all XUpdates used in LS modifications
*/
+
+/*
+do we still need this with no XUpdate?
+*/
protected static final String XUPDATE_HEADER =
"<xu:modifications version=\'1.0\'" +
" xmlns:xu=\'http://www.xmldb.org/xupdate\'" +
@@ -70,6 +92,9 @@
/**
* Footer for all XUpdates used in LS register
*/
+/*
+do we still need this with no XUpdate?
+*/
protected static final String XUPDATE_FOOTER = "</xu:modifications>";
/**
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSCleanup.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSCleanup.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSCleanup.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -133,19 +133,25 @@
"REMOVING metadata for key ["+
keys[i]+"] and related data");
+
//generate XQuery that removes data
- //removes data from ALL schemas (LSStore,
LSStore-control)
-
+ //removes data from THESE schemas (LSStore,
LSStore-control, LSCache)
+
String query = "";
query = XQUERY_UPDATE_DECLARE +
- "for $md in
/nmwg:store/nmwg:metadata[@id='"
+
- keys[i] + "'] return " + XQUERY_UPDATE_DELETE +
"$md";
+ "for $md in
/nmwg:store[@type='"
+ LS_STORE_COLLECTION_TYPE + "' or @type='" +
+ LS_CACHE_COLLECTION_TYPE + "' or @type='" +
LS_STORE_CONTROL_COLLECTION_TYPE +
+
"']/nmwg:metadata[@id='"
+ keys[i] + "'] return " +
+ XQUERY_UPDATE_DELETE + "$md";
+
xmlStorageManager.fetch(query); //XQuery
query = "";
query = XQUERY_UPDATE_DECLARE +
- "for $d in
/nmwg:store/nmwg:data[@metadataIdRef='"
+
- keys[i] + "'] return " + XQUERY_UPDATE_DELETE +
"$d";
+ "for $d in
/nmwg:store[@type='"
+ LS_STORE_COLLECTION_TYPE + "' or @type='" +
+ LS_CACHE_COLLECTION_TYPE + "' or @type='" +
LS_STORE_CONTROL_COLLECTION_TYPE +
+
"']/nmwg:data[@metadataIdRef='"
+ keys[i] + "'] return " +
+ XQUERY_UPDATE_DELETE + "$d";
xmlStorageManager.fetch(query); //XQuery
} //if
@@ -180,8 +186,9 @@
String query =
"declare namespace nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\"; " +
-
"data(/nmwg:store[@type='"+LS_STORE_COLLECTION_TYPE+"']/nmwg:metadata/@id)";
-
+
"data(/nmwg:store[@type='"
+ LS_STORE_COLLECTION_TYPE + "' or @type='" +
+ LS_CACHE_COLLECTION_TYPE + "']/nmwg:metadata/@id)";
+
XmlDbResult edbres = (XmlDbResult)xmlStorageManager.fetch(query);
String[] res = (String[])edbres.getResultAsStringArray();
@@ -200,9 +207,9 @@
String query =
"declare namespace nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\"; " +
-
"/nmwg:store[@type='"+LS_STORE_CONTROL_COLLECTION_TYPE+
-
"']/nmwg:metadata[@id='"+key+
-
"']/nmwg:parameters/nmwg:parameter[@name='"+
+
"/nmwg:store[@type='"
+ LS_STORE_CONTROL_COLLECTION_TYPE +
+
"']/nmwg:metadata[@id='"
+ key +
+
"']/nmwg:parameters/nmwg:parameter[@name='"
+
parameterName+"']/text()";
XmlDbResult edbres = (XmlDbResult)xmlStorageManager.fetch(query);
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSCleanupLoader.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSCleanupLoader.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSCleanupLoader.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -138,8 +138,7 @@
// in seconds and scheduler needs time in millis
scheduler.addSchedulerTask(interval * 1000, new LSCleanup(storage));
- //done.
-
+ //done.
}
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSDeregisterAction.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSDeregisterAction.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSDeregisterAction.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -157,7 +157,7 @@
if (countDataRemoved>0) {
//generate XQuery that removes data
- //removes data from ALL schemas (LSStore, LSStore-control)
+ //removes data from ALL schemas (LSStore, LSStore-control,
LSCache, LSGlobalPeers, LSLocalPeers)
if (xmlStorageManager instanceof ExistDbXmlrpcXmlStorageManager)
{
String remove2 = "";
@@ -177,17 +177,71 @@
logger.debug("XmlTypeLSServiceEngine: Removed
data="+countDataRemoved+
", metadata="+countMetadataRemoved);
- //Prepare result code (put it into the response)
- Message response = new Message();
-
- // XXX: Should there be a different type for response?
- response.setType("LSDeregisterResponse");
-
+
+
+
+ /*
throw new SystemException("result.success", "Removed ["+
countMetadataRemoved+"] metadata and ["+
countDataRemoved+"] data blocks for key ["+keyValue+"]");
+ */
+
+
+
+ Message response = new Message();
+ response.setType("LSDeregisterResponse");
+
+ ResultCode rc = createResultCode("result.success",
+ "Removed [" + countMetadataRemoved
+
+ "] metadata and [" +
countDataRemoved +
+ "] data blocks for key
["+keyValue+"]");
+ rc.getMetadata().setKey( createLSKey(keyValue) );
+ Metadata[] responseMetadata = { rc.getMetadata() };
+
+ Data[] responseData = null;
+ if(rc.getData() !=null) {
+ responseData = new Data[1];
+ responseData[0] = rc.getData();
+ }
+
+ response.addChild(responseData[0]);
+ for(int j=0; j<responseMetadata.length; j++){
+ response.addChild(responseMetadata[j]);
+ }
+ return response;
+
+
+
}
+ /**
+ * Create element containing lsKey.
+ *
xpath:////nmwg:key/nmwg:parameters/nmwg:parameter[@id='lsKey']
+ * @param keyValue
+ * @return Key element
+ */
+ private org.ggf.ns.nmwg.base.v2_0.Key createLSKey(String keyValue) {
+
+ org.ggf.ns.nmwg.base.v2_0.Key key =
+ new org.ggf.ns.nmwg.base.v2_0.Key();
+
+ org.ggf.ns.nmwg.base.v2_0.Parameters parameters =
+ new org.ggf.ns.nmwg.base.v2_0.Parameters();
+
+ org.ggf.ns.nmwg.base.v2_0.Parameter parameter =
+ new org.ggf.ns.nmwg.base.v2_0.Parameter();
+
+ parameter.setParameterName(LS_KEY);
+
+ parameter.setParameterValue(keyValue);
+ parameters.addParameter(parameter);
+ key.setParameters(parameters);
+
+ return key;
+
+ }
+
+
} //LSLookupAction
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSGenericRegisterAction.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSGenericRegisterAction.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSGenericRegisterAction.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -90,7 +90,7 @@
//check if metadata empty
String query = "declare namespace
nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\"; " +
-
"data(/nmwg:store[@type='"+LS_STORE_CONTROL_COLLECTION_TYPE+"']/nmwg:metadata[@id='"+key+"']/@id)";
+
"data(/nmwg:store[@type='"
+ LS_STORE_CONTROL_COLLECTION_TYPE +
"']/nmwg:metadata[@id='"+key+"']/@id)";
XmlDbResult res = (XmlDbResult)xmlStorageManager.fetch(query);
int resnum = res.getCount();
@@ -139,7 +139,7 @@
//check if there is control metadata for such key
query = "declare namespace
nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\"; " +
-
"data(/nmwg:store[@type='"+LS_STORE_CONTROL_COLLECTION_TYPE+"']/nmwg:metadata[@id='"+key+"']/@id)";
+
"data(/nmwg:store[@type='"
+ LS_STORE_CONTROL_COLLECTION_TYPE +
"']/nmwg:metadata[@id='"+key+"']/@id)";
XmlDbResult res = (XmlDbResult)xmlStorageManager.fetch(query);
resnum = res.getCount();
@@ -161,7 +161,7 @@
//if there is the metadata, check if it has a parameters block
query = "declare namespace
nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\"; " +
-
"data(/nmwg:store[@type='"+LS_STORE_CONTROL_COLLECTION_TYPE+"']/nmwg:metadata[@id='"+
+
"data(/nmwg:store[@type='"
+ LS_STORE_CONTROL_COLLECTION_TYPE +
"']/nmwg:metadata[@id='"+
key+"']/nmwg:parameters/@id)";
res = (XmlDbResult)xmlStorageManager.fetch(query);
@@ -187,7 +187,7 @@
//check if there is parameter inside metadata
query = "declare namespace
nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\"; " +
-
"/nmwg:store[@type='"+LS_STORE_CONTROL_COLLECTION_TYPE+"']/nmwg:metadata[@id='"+key+
+
"/nmwg:store[@type='"
+ LS_STORE_CONTROL_COLLECTION_TYPE +
"']/nmwg:metadata[@id='"+key+
"']/nmwg:parameters/nmwg:parameter[@name='"+parameterName+"']";
res = (XmlDbResult)xmlStorageManager.fetch(query);
@@ -228,7 +228,7 @@
/**
- * Checks if there is any metadata for given key (in LSStore schema)
+ * Checks if there is any metadata for given key (in LSStore,LSCache
schemas)
*/
protected boolean checkIfKeyIsRegistered(String key, StorageManager
xmlStorageManager) throws SystemException, RequestException,
DataFormatException {
@@ -249,7 +249,12 @@
}
else
query = "";
-
+
+ String query =
+ "declare namespace
nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\"; " +
+
"data(/nmwg:store[@type='"+
LS_STORE_COLLECTION_TYPE + "' or @type='" +
+ LS_CACHE_COLLECTION_TYPE +
"']/nmwg:metadata[@id='"+key+"']/@id)";
+
XmlDbResult res = (XmlDbResult)xmlStorageManager.fetch(query);
int resnum = res.getCount();
Added:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSGlobalTokenAction.java
Added:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSGlobalTokenLoader.java
Added:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSLocalTokenAction.java
Added:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSLocalTokenLoader.java
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSLookupAction.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSLookupAction.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSLookupAction.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -86,7 +86,7 @@
throw new SystemException("error.ls.no_querytype", m);
}
- logger.debug("XmlTypeLSServiceEngine: Query type (EventType) is ["+
+ logger.debug("LSLookupAction: Query type (EventType) is ["+
queryType +"]");
// check if the query type can be satisfied
@@ -104,7 +104,7 @@
logger.fatal(m);
throw new SystemException("error.ls.querytype_not_suported", m);
}
- logger.debug("XmlTypeLSServiceEngine: Query type [" + queryType
+ logger.debug("LSLookupAction: Query type [" + queryType
+ "] is supported");
//If query type is supported
@@ -121,7 +121,7 @@
logger.info(requestSubject.toString());
query = requestSubject.getSubject();
- logger.debug("XmlTypeLSServiceEngine: query="+query);
+ logger.debug("LSLookupAction: query="+query);
} catch (NullPointerException e) {
String m =
@@ -129,15 +129,16 @@
logger.fatal(m);
throw new SystemException("error.ls.no_query", m);
}
-
+
+
//convert query, change > = ">", < = "<".
query = XMLUtils.convertEntitiesToCharacters(query);
//Performing XQuery operation on the database
- logger.debug("XmlTypeLSServiceEngine: perform query");
+ logger.debug("LSLookupAction: perform query");
String[] results;
+
-
System.out.println(" LSq0,"+System.currentTimeMillis());
///////////////////////////////////////////////////////////////
@@ -150,7 +151,7 @@
System.out.println(" LSq1,"+System.currentTimeMillis());
- logger.debug("XmlTypeLSServiceEngine: Got [["+
+ logger.debug("LSLookupAction: Got [["+
results.length+"]] results from DB");
//TODO: if results.length==0 --> return error code or not?
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSRegisterAction.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSRegisterAction.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSRegisterAction.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -30,8 +30,18 @@
private boolean allowReplaceIfAlreadyRegistered = DEFAULT_ALLOW_REPLACE;
+
+ /**
+ * lsUtil
+ */
+ private LSUtilities lsUtil;
+
+ /**
+ * lsTokenUtil
+ */
+ private LSTokenUtilities lsTokenUtil;
+
-
// -----------------------------------------------------------
Constructor
@@ -59,6 +69,10 @@
logger.debug("LSRegisterAction: service.ls.lookup_info_timeout="+
allowReplaceIfAlreadyRegistered);
+
+ lsUtil = new LSUtilities();
+
+ lsTokenUtil = new LSTokenUtilities(logger, configuration, lsUtil,
"null");
}
@@ -71,79 +85,81 @@
logger.debug(
"LSRegisterAction: LS register - action REGISTER started");
- //Get Metadata from request
-
+
+//is this a summary message?
+ org.ggf.ns.nmwg.base.v2_0.Parameter summaryParam = null;
+ if(request.getParameters() != null) {
+ summaryParam =
request.getParameters().getParameterByName("summary");
+ }
+ if(summaryParam == null) {
+ logger.debug("LSRegisterAction: LS register - this is not a
summary registration ...");
+ }
+ else {
+ logger.debug("LSRegisterAction: LS register - summary registration
...");
+ }
+
+
+ //Get Metadata from request
Metadata requestMetadata = getMetadataFromRequest(request);
- if (requestMetadata==null) {
- String m="LSRegisterAction: No metadata in request";
- logger.error(m);
- throw new SystemException("error.ls.no_metadata", m);
+ if(requestMetadata==null) {
+ String m="LSRegisterAction: No metadata in request in summary";
+ logger.error(m);
+ throw new SystemException("error.ls.no_metadata", m);
}
//get accessPoint from Metadata - obligatory element
String accessPoint = null;
try {
- accessPoint = ((org.ggf.ns.nmwg.tools.org.perfsonar.v1_0.Subject)
- requestMetadata.getSubject()).getService().
- getAccessPoint().getAccessPoint();
+ accessPoint = ((org.ggf.ns.nmwg.tools.org.perfsonar.v1_0.Subject)
+ requestMetadata.getSubject()).getService().
+ getAccessPoint().getAccessPoint();
} catch (RuntimeException e) {
- logger.debug("LSRegisterAction: no accessPoint");
+ logger.debug("LSRegisterAction: no accessPoint in summary");
}
-
+
//Try to get Key from Metadata
String keyValue = getKeyFromMetadata(requestMetadata, LS_KEY);
logger.debug("LSRegisterAction: LS key=["+keyValue+"]");
-
-
-
+
//========check metadata========
-
-
-
+
//check keyValue
- if (keyValue == null) { //REGISTER
+ if(keyValue == null) { //REGISTER
- //let the key value be accesspoint
-
- logger.debug("LSRegisterAction: key = accessPoint");
-
- keyValue = accessPoint;
+ //let the key value be accesspoint
+ logger.debug("LSRegisterAction: key = accessPoint");
+ keyValue = accessPoint;
} else { //UPDATE
-
- //always enable register especially if data is registered!
- allowReplaceIfAlreadyRegistered = true;
+ //always enable register especially if data is registered!
+ allowReplaceIfAlreadyRegistered = true;
- //but check the key if it's already been in the DB
- if (checkIfKeyIsRegistered(keyValue, xmlStorageManager)) {
+ //but check the key if it's already been in the DB
+ if(checkIfKeyIsRegistered(keyValue, xmlStorageManager)) {
- String m = "LSRegisterAction: key from request [" + keyValue
+
- "] not found in the storage. " +
- "Can't UPDATE such data, because can't determine what data
should be updated";
- logger.debug(m);
- throw new
DataFormatException("error.ls.update.key_not_found", m);
+ String m = "LSRegisterAction: key from request [" + keyValue +
+ "] not found in the storage. " +
+ "Can't UPDATE such data, because can't determine what data
should be updated";
+ logger.debug(m);
+ throw new DataFormatException("error.ls.update.key_not_found",
m);
- }
-
+ }
}
// check keyValue again, it may be accessPoint now
- if (keyValue==null) {
- String m = "LSRegisterAction: Cannot register " +
- "Lookup Info without Metadata/accessPoint or Key";
- logger.error(m);
- throw new SystemException("error.ls.no_key", m);
+ if(keyValue==null) {
+ String m = "LSRegisterAction: Cannot register " +
+ "Lookup Info without Metadata/accessPoint or Key";
+ logger.error(m);
+ throw new SystemException("error.ls.no_key", m);
}
-
-
+
//========check data========
-
-
//Get all Data elements, suppose they all belong to metadata
//(data map is created in the constructor of Message, so Null Ptr
Exc
//won't be thrown!)
@@ -151,60 +167,232 @@
//if there is no data! -- to be discussed
//there should be at least ONE trigger -- to be discussed
- if (reqDataArr.size() < 1) {
- String m = "LSRegisterAction: " +
- "Request must have at least one data element - trigger)
";
- logger.error(m);
- throw new SystemException("error.ls.no_data_trigger", m);
+ if(reqDataArr.size() < 1) {
+ String m = "LSRegisterAction: " +
+ "Request must have at least one data element - trigger)
";
+ logger.error(m);
+ throw new SystemException("error.ls.no_data_trigger", m);
}
-
-
- //=========process with register/update===========
+
+
+
+
+
+// update peer list (local vs global check) ...
+ if(summaryParam != null) {
+ logger.debug("LSRegisterAction: LS register - we need to update
the '" +
+ summaryParam.getParameterValue() + "' peers list
...");
+ org.ggf.ns.nmwg.base.v2_0.Parameter sumParam = null;
+ if(request.getParameters() != null) {
+ sumParam = request.getParameters().getParameterByName("summary");
+ if(sumParam != null) {
+ if(sumParam.getParameterValue().equals("local")) {
+ lsTokenUtil.addToPeerList(xmlStorageManager,
requestMetadata, "local");
+ }
+ else if(sumParam.getParameterValue().equals("global")) {
+ lsTokenUtil.addToPeerList(xmlStorageManager,
requestMetadata, "global");
+
+//we need to 'back up' the stuff from global guys
+
+ //get the contents of LSLocalPeers
+ String query = XQUERY_UPDATE_DECLARE +
"//nmwg:store[@type='"
+ LS_LOCAL_PEER_COLLECTION_TYPE + "']";
+ String[] results = lsUtil.getDBContents(xmlStorageManager,
query);
+
+ if(results[0].equals("")) {
+ String m = "LSLocalTokenAction: " +
+ "Peer List is empty; please populate it with at
least one peer.";
+ logger.error(m);
+ throw new SystemException("error.ls.peer_list_empty", m);
+ }
+
+ Store result = (Store)XMLUtils.stringToElement(results[0],
lsUtil.getParserFile(), "store");
+
+ Collection metadataCol = null;
+ metadataCol = result.getMetadataMap().values();
+ if(metadataCol.size() < 1) {
+ String m = "LSLocalTokenAction: " +
+ "Peer List is empty; please populate it with at
least one peer.";
+ logger.error(m);
+ throw new SystemException("error.ls.peer_list_empty", m);
+ }
+ String[][] sortedList = null;
+ sortedList = lsTokenUtil.formPeerArray(metadataCol);
+
+//create a 'special' global summary message (one that won't be
+// propagated by the other peers
+
+ //setup the parameters for the message (indicating it is a
summary)
+ org.ggf.ns.nmwg.base.v2_0.Parameters reqParams = new
org.ggf.ns.nmwg.base.v2_0.Parameters();
+ reqParams = lsUtil.createSummaryParameters(reqParams,
"summary", "global-backup");
+
+ //put them in a message, then insert
+ org.ggf.ns.nmwg.base.v2_0.Message registerMessage = new
Message();
+ registerMessage.setType("LSRegisterRequest");
+ registerMessage.addChild(requestMetadata);
+ Iterator reqDataArrIterator = reqDataArr.iterator();
+ while (reqDataArrIterator.hasNext()) {
+ registerMessage.addChild((Data)reqDataArrIterator.next());
+ }
+ registerMessage.addChild(reqParams);
+
+
+ //now try to send the message to people
+ int counter = 0;
+ for(int b = 0; b < metadataCol.size(); b++) {
+
+ logger.debug("LSRegisterAction: Sending message to: " +
sortedList[b][0] + " - " + sortedList[b][1]);
+ try {
+ org.ggf.ns.nmwg.base.v2_0.Message response =
lsTokenUtil.sendRequest(sortedList[b][0], registerMessage);
+ if(response != null) {
+ //check to see if we succeeded:
+ org.ggf.ns.nmwg.base.v2_0.Metadata requestMetadata2[]
= response.getMetadataArray();
+ if(requestMetadata2.length > 0){
+
+ logger.debug("LSRegisterAction: response: " +
requestMetadata2[0].toString());
+
if((requestMetadata2[0].getEventType().getEventType()).equals("result.success"))
{
+ if(Integer.parseInt(sortedList[b][1]) < 3) {
+ //update the peers list
+ String update = XQUERY_UPDATE_DECLARE +
XQUERY_UPDATE_VALUE;
+
+ update = update +
"/nmwg:store[@type='"
+ LS_LOCAL_PEER_COLLECTION_TYPE +
+
"']//nmwg:parameters[@id='"
+ sortedList[b][0] + "']/nmwg:parameter" +
+
"[@name='familiar']
with '" + (int)((Integer.parseInt(sortedList[b][1]))+1) + "'";
+
+ xmlStorageManager.fetch(update);
+ sortedList[b][1] =
Integer.toString(Integer.parseInt(sortedList[b][1]) + 1);
+ counter++;
+ }
+ }
+ else {
+ logger.debug("LSRegisterAction: Success Code from
peer not found");
+ }
+ }
+ else {
+ logger.debug("LSRegisterAction: No metadata in peer
response");
+ }
+ }
+ else {
+ logger.debug("LSRegisterAction: Null response when
talking to peer");
+ if(Integer.parseInt(sortedList[b][1]) > 0) {
+ //update the peers list
+ String update = XQUERY_UPDATE_DECLARE +
XQUERY_UPDATE_VALUE;
+
+ update = update +
"/nmwg:store[@type='"
+ LS_LOCAL_PEER_COLLECTION_TYPE +
+
"']//nmwg:parameters[@id='"
+ sortedList[b][0] + "']/nmwg:parameter" +
+
"[@name='familiar']
with '" + (int)(Integer.parseInt(sortedList[b][1])-1) + "'";
+
+ xmlStorageManager.fetch(update);
+ sortedList[b][1] =
Integer.toString(Integer.parseInt(sortedList[b][1])-1);
+ }
+ }
+ }
+ catch(Exception e) {
+ logger.debug("LSRegisterAction: Exception: " +
e.toString());
+ throw new SystemException("error.ls.client_error",
+ "Error sending to client LS " +
+ e.getMessage());
+ }
+ if(counter >= 2) {
+ b = metadataCol.size() + 1;
+ }
+ }
+
+
+
+
+
+ }
+ else if(sumParam.getParameterValue().equals("global-backup")) {
+ lsTokenUtil.addToPeerList(xmlStorageManager,
requestMetadata, "global");
+ }
+ }
+ }
+ }
+
+
+
+
+
+
+
+
+ //=========process with register/update===========
+
String removeUpdate = null;
//check if there is metadata with the same key:
//if so, check if you're allowed to update data (to remove them)
//throw exception if you're not allowed
- if (checkIfKeyIsRegistered(keyValue,xmlStorageManager)) {
+ if(checkIfKeyIsRegistered(keyValue,xmlStorageManager)) {
- logger.debug("LSRegisterAction: Key is already " +
- "registered in DB (metadata), allow_update="+
- allowReplaceIfAlreadyRegistered);
-
+ logger.debug("LSRegisterAction: Key is already " +
+ "registered in DB (metadata), allow_update="+
+ allowReplaceIfAlreadyRegistered);
+ if(summaryParam == null) {
if (allowReplaceIfAlreadyRegistered) {
- logger.debug("LSRegisterAction: old data will be replaced by
new set of data");
+ logger.debug("LSRegisterAction: old data will be replaced by
new set of data");
- String remove = XQUERY_UPDATE_DECLARE +
- "for $md in
/nmwg:store[@type='"
+ LS_STORE_COLLECTION_TYPE +
-
"']/nmwg:metadata[@id='"
+ keyValue + "'] return " +
- XQUERY_UPDATE_DELETE + "$md";
- xmlStorageManager.fetch(remove); //XQuery
-
-
- remove = "";
- remove = XQUERY_UPDATE_DECLARE +
- "for $d in
/nmwg:store[@type='"
+ LS_STORE_COLLECTION_TYPE +
-
"']/nmwg:data[@metadataIdRef='"
+ keyValue + "'] return " +
- XQUERY_UPDATE_DELETE + "$d";
- xmlStorageManager.fetch(remove); //XQuery
+ String remove = XQUERY_UPDATE_DECLARE +
+ "for $md in
/nmwg:store[@type='"
+ LS_STORE_COLLECTION_TYPE +
+
"']/nmwg:metadata[@id='"
+ keyValue + "'] return " +
+ XQUERY_UPDATE_DELETE + "$md";
+ xmlStorageManager.fetch(remove); //XQuery
+
+ remove = "";
+ remove = XQUERY_UPDATE_DECLARE +
+ "for $d in
/nmwg:store[@type='"
+ LS_STORE_COLLECTION_TYPE +
+
"']/nmwg:data[@metadataIdRef='"
+ keyValue + "'] return " +
+ XQUERY_UPDATE_DELETE + "$d";
+ xmlStorageManager.fetch(remove); //XQuery
+ } else {
+ String m = "LSRegisterAction: Can't replace data";
+ logger.error(m);
+ //TODO: what to do? Remove everything?
+ throw new SystemException("error.ls.cant_replace_data", m);
+ }
+ }
+ else {
- } else {
-
- String m = "LSRegisterAction: Can't replace data";
- logger.error(m);
- //TODO: what to do? Remove everything?
- throw new SystemException("error.ls.cant_replace_data", m);
-
- }
-
+
+//summary data always gets updated (don't look at the conf file info)
+
+ logger.debug("LSRegisterAction: old data summary data is always
replaced");
+
+ String remove = XQUERY_UPDATE_DECLARE +
+ "for $md in
/nmwg:store[@type='"
+ LS_CACHE_COLLECTION_TYPE +
+
"']/nmwg:metadata[@id='"
+ keyValue + "'] return " +
+ XQUERY_UPDATE_DELETE + "$md";
+ xmlStorageManager.fetch(remove); //XQuery
+
+ remove = "";
+ remove = XQUERY_UPDATE_DECLARE +
+ "for $d in
/nmwg:store[@type='"
+ LS_CACHE_COLLECTION_TYPE +
+
"']/nmwg:data[@metadataIdRef='"
+ keyValue + "'] return " +
+ XQUERY_UPDATE_DELETE + "$d";
+ xmlStorageManager.fetch(remove); //XQuery
+ }
+
}
//change metadata id
requestMetadata.setId(accessPoint);
+<<<<<<< .mine
+
+//make sure we update the store vs the cache
+ String insert = XQUERY_UPDATE_DECLARE + XQUERY_UPDATE_INSERT;
+ insert = insert + XMLUtils.serializeXML(requestMetadata) + " into
/nmwg:store[@type='";
+ if(summaryParam == null) {
+ insert = insert + LS_STORE_COLLECTION_TYPE + "']";
+ }
+ else {
+ insert = insert + LS_CACHE_COLLECTION_TYPE + "']";
+ }
+ xmlStorageManager.fetch(insert);
+=======
if (xmlStorageManager instanceof ExistDbXmlrpcXmlStorageManager)
{
String insert = XQUERY_UPDATE_DECLARE + XQUERY_UPDATE_INSERT;
@@ -216,6 +404,7 @@
{
((BerkeleyDbXmlStorageManager)xmlStorageManager).insertElement(XQUERY_UPDATE_DECLARE,
LS_STORE_COLLECTION_TYPE, "/nmwg:store",
XMLUtils.serializeXML(requestMetadata));
}
+>>>>>>> .r1691
//Prepare XQuery data
@@ -227,9 +416,8 @@
Iterator reqDataArrIterator = reqDataArr.iterator();
- while (reqDataArrIterator.hasNext()) {
-
- Data requestData = (Data)reqDataArrIterator.next();
+ while (reqDataArrIterator.hasNext()) {
+ Data requestData = (Data)reqDataArrIterator.next();
// //TODO: what to check?
// if (requestData==null) {
@@ -239,14 +427,16 @@
// throw new SystemException(m);
// }
- //change data references
+ //change data references
- requestData.setId(accessPoint+"/"+currTime+"/"+datanum);
- requestData.setMetadataIdRef(accessPoint);
+ requestData.setId(accessPoint+"/"+currTime+"/"+datanum);
+ requestData.setMetadataIdRef(accessPoint);
- //Prepare XQuery for Data
- //fill updateData structure
+ //Prepare XQuery for Data
+ //fill updateData structure
+<<<<<<< .mine
+=======
if (xmlStorageManager instanceof ExistDbXmlrpcXmlStorageManager)
{
String insert2 = XQUERY_UPDATE_DECLARE + XQUERY_UPDATE_INSERT;
@@ -258,8 +448,20 @@
{
((BerkeleyDbXmlStorageManager)xmlStorageManager).insertElement(XQUERY_UPDATE_DECLARE,
LS_STORE_COLLECTION_TYPE, "/nmwg:store", XMLUtils.serializeXML(requestData));
}
+>>>>>>> .r1691
- datanum++;
+//make sure we update the store vs the cache
+ String insert2 = XQUERY_UPDATE_DECLARE + XQUERY_UPDATE_INSERT;
+ insert2 = insert2 + XMLUtils.serializeXML(requestData) + " into
/nmwg:store[@type='";
+ if(summaryParam == null) {
+ insert2 = insert2 + LS_STORE_COLLECTION_TYPE + "']";
+ }
+ else {
+ insert2 = insert2 + LS_CACHE_COLLECTION_TYPE + "']";
+ }
+ xmlStorageManager.fetch(insert2);
+
+ datanum++;
}
//if no errors and exceptions reported/thrown, put metadata and
data into DB
@@ -274,15 +476,15 @@
//
nmwg:parameters:/nmwg:parameter[@id="lsKey"]
ResultCode rc = createResultCode("result.success",
- "Data has been registered with key ["+keyValue+"]");
+ "Data has been registered with key
["+keyValue+"]");
rc.getMetadata().setKey( createLSKey(keyValue) );
Metadata[] responseMetadata = { rc.getMetadata() };
Data[] responseData = null;
- if (rc.getData() !=null) {
- responseData = new Data[1];
- responseData[0] = rc.getData();
+ if(rc.getData() !=null) {
+ responseData = new Data[1];
+ responseData[0] = rc.getData();
}
Message response = new Message();
@@ -292,11 +494,9 @@
response.addChild(responseData[0]);
for(int j=0; j<responseMetadata.length; j++){
- response.addChild(responseMetadata[j]);
+ response.addChild(responseMetadata[j]);
}
-
- return response;
-
+ return response;
}
Added:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSSummary.java
Added:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSSummaryLoader.java
Added:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSTokenUtilities.java
Added:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/LSUtilities.java
Modified:
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/XmlTypeLSServiceEngine.java
===================================================================
---
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/XmlTypeLSServiceEngine.java
2006-10-18 19:36:06 UTC (rev 1691)
+++
branches/yi-udel/perfsonar/src/org/perfsonar/service/lookupService/xmlType/XmlTypeLSServiceEngine.java
2006-10-19 04:56:50 UTC (rev 1692)
@@ -97,7 +97,8 @@
ActionType.LS_REGISTER,
ActionType.LS_LOOKUP,
ActionType.LS_DEREGISTER,
- ActionType.LS_KEEPALIVE
+ ActionType.LS_KEEPALIVE,
+ ActionType.LS_TOKEN
};
smType = config.getProperty("service.ls.db_type");
@@ -178,7 +179,6 @@
//Take an action
if (actionType.equals(ActionType.LS_REGISTER)) {
-
XmlDbStorageManager xmlDbStorageManager =
getStorageManager(smType);
@@ -206,8 +206,43 @@
LSAction action = new LSKeepaliveAction(xmlDbStorageManager);
response = action.performAction(request);
+ } else if (actionType.equals(ActionType.LS_TOKEN)) {
+
+ org.ggf.ns.nmwg.base.v2_0.Parameter summaryParam = null;
+ if(request.getParameters() != null) {
+ summaryParam =
request.getParameters().getParameterByName("token");
+ if(summaryParam != null) {
+ if(summaryParam.getParameterValue().equals("local")) {
+ XmlDbStorageManager xmlDbStorageManager =
+ getStorageManager(smType);
+ LSAction action = new
LSLocalTokenAction(xmlDbStorageManager);
+ response = action.performAction(request);
+ }
+ else if(summaryParam.getParameterValue().equals("global")) {
+ XmlDbStorageManager xmlDbStorageManager =
+ getStorageManager(smType);
+ LSAction action = new
LSGlobalTokenAction(xmlDbStorageManager);
+ response = action.performAction(request);
+ }
+ else {
+ throw new
SystemException("error.ls.action_parameters_wrong",
+ "XmlTypeLSServiceEngine: Action ["
+ +actionType+"] is missing (local|global) summary
parameters");
+ }
+ }
+ else {
+ throw new
SystemException("error.ls.action_parameters_wrong",
+ "XmlTypeLSServiceEngine: Action ["
+ +actionType+"] is missing summary parameters");
+ }
+ }
+ else {
+ throw new
SystemException("error.ls.action_parameters_missing",
+ "XmlTypeLSServiceEngine: Action ["
+ +actionType+"] is missing parameter block");
+ }
+
} else {
-
throw new SystemException("error.ls.action_not_suported",
"XmlTypeLSServiceEngine: Action ["
+actionType+"] not supported");
- r1692 - in branches/yi-udel/perfsonar: ant/xmlls conf conf/template lib/repository lib/repository/saxon schema/example-instances/sonar/LS schema/example-instances/sonar/LS/test schema/example-instances/sonar/LS/xslt src/org/perfsonar src/org/perfsonar/client/axis src/org/perfsonar/commons/auxiliary/components/simplescheduler src/org/perfsonar/commons/messages src/org/perfsonar/commons/util src/org/perfsonar/service/commons/engine src/org/perfsonar/service/commons/storage src/org/perfsonar/service/commons/storage/xmldb/exist/rest src/org/perfsonar/service/commons/storage/xmldb/exist/xmlrpc src/org/perfsonar/service/commons/storage/xmlfile src/org/perfsonar/service/lookupService/xmlType, svnlog, 10/19/2006
Archive powered by MHonArc 2.6.16.