Skip to content
Browse files

Rigged REST into ant build and deploy.

  • Loading branch information...
1 parent 04818a7 commit eea732908c05793e8528b87559279c92283bb123 @labisso labisso committed Feb 23, 2010
View
4 messaging/gt4.0/java/gar-builder/build.properties
@@ -18,6 +18,7 @@ nimbus.service.api.basedir=${nimbus.basedir}/service-api/java/source
nimbus.messaging.gt4_0.basedir=${nimbus.basedir}/messaging/gt4.0/java
nimbus.messaging.gt4_0-elastic.basedir=${nimbus.basedir}/messaging/gt4.0-elastic/java
nimbus.messaging.query.basedir=${nimbus.basedir}/messaging/query/java/source
+nimbus.messaging.rest.basedir=${nimbus.basedir}/messaging/rest/java/source
nimbus.metadata-server.basedir=${nimbus.basedir}/metadata/java/source
##########################################
@@ -55,6 +56,7 @@ nimbus.messaging.gt4_0.gar.build.bin.dir=${nimbus.messaging.gt4_0.gar.build.dir}
nimbus.service.main.etc.dir=${nimbus.service.main.basedir}/etc
nimbus.messaging.gt4_0-elastic.etc.dir=${nimbus.messaging.gt4_0-elastic.basedir}/msgbridge/etc
nimbus.messaging.query.etc.dir=${nimbus.messaging.query.basedir}/etc
+nimbus.messaging.rest.etc.dir=${nimbus.messaging.rest.basedir}/etc
nimbus.messaging.gt4_0.gar.etc.dir=etc
@@ -89,6 +91,8 @@ nimbus.messaging.gt4_0-elastic.msgbridge.lib.dir=${nimbus.messaging.gt4_0-elasti
nimbus.messaging.query.dist.dir=${nimbus.messaging.query.basedir}/dist/
nimbus.messaging.query.lib.dir=${nimbus.messaging.query.basedir}/lib/
+nimbus.messaging.rest.dist.dir=${nimbus.messaging.rest.basedir}/dist/
+nimbus.messaging.rest.lib.dir=${nimbus.messaging.rest.basedir}/lib/
##################################################################
# JARs we *might* need to put into GLOBUS_LOCATION at install time
View
11 messaging/gt4.0/java/gar-builder/build.xml
@@ -155,6 +155,14 @@
<include name="*.jar"/>
<include name="*LICENSE*"/>
</fileset>
+ <fileset dir="${nimbus.messaging.rest.dist.dir}">
+ <include name="*.jar"/>
+ <include name="*LICENSE*"/>
+ </fileset>
+ <fileset dir="${nimbus.messaging.rest.lib.dir}">
+ <include name="*.jar"/>
+ <include name="*LICENSE*"/>
+ </fileset>
</copy>
</target>
@@ -175,6 +183,9 @@
<fileset dir="${nimbus.messaging.query.etc.dir}" />
</copy>
<copy todir="${nimbus.messaging.gt4_0.gar.build.etc.dir}">
+ <fileset dir="${nimbus.messaging.rest.etc.dir}" />
+ </copy>
+ <copy todir="${nimbus.messaging.gt4_0.gar.build.etc.dir}">
<fileset dir="${nimbus.messaging.gt4_0.gar.etc.dir}" />
</copy>
</target>
View
40 messaging/gt4.0/java/gar-builder/etc/post-deploy.xml
@@ -24,6 +24,9 @@
<property name="query.conf.dir"
value="${base.conf.dir}/query" />
+
+ <property name="rest.conf.dir"
+ value="${base.conf.dir}/rest" />
<property name="workspace.persistence.dir"
value="${deploy.dir}/var/${base.package.name}" />
@@ -84,6 +87,18 @@
<property name="qproperties2.tmp"
location="${query.conf.dir}/query.conf.tmp"/>
+
+ <property name="rproperties.path"
+ location="${rest.conf.dir}/other/main.conflocator.xml"/>
+
+ <property name="rproperties.tmp"
+ location="${rest.conf.dir}/other/main.conflocator.xml.tmp"/>
+
+ <property name="rproperties2.path"
+ location="${rest.conf.dir}/rest.conf"/>
+
+ <property name="rproperties2.tmp"
+ location="${rest.conf.dir}/rest.conf.tmp"/>
<filterset id="absPathFilter">
<filter token="WORKSPACE_CONFDIR"
@@ -92,6 +107,8 @@
value="${elastic.conf.dir}"/>
<filter token="QUERY_CONFDIR"
value="${query.conf.dir}"/>
+ <filter token="REST_CONFDIR"
+ value="${rest.conf.dir}"/>
<filter token="WORKSPACE_PERSISTENCEDIR"
value="${workspace.persistence.dir}"/>
<filter token="DERBY_DIR"
@@ -135,7 +152,8 @@
<target name="setup"
depends="adjust-wproperties, adjust-eproperties,
adjust-wproperties2, adjust-qproperties,
- adjust-qproperties2, adjust-jndi,
+ adjust-qproperties2, adjust-rproperties,
+ adjust-rproperties2, adjust-jndi,
chmodprivate, chmodexes, setupWorkspacePersistence" />
@@ -263,6 +281,26 @@
<delete file="${qproperties2.tmp}"/>
<echo message="Adjusted query.conf paths"/>
</target>
+
+ <target name="adjust-rproperties">
+ <copy file="${rproperties.path}" toFile="${rproperties.tmp}">
+ <filterset refid="absPathFilter"/>
+ </copy>
+ <copy file="${rproperties.tmp}" toFile="${rproperties.path}"
+ overwrite="true" />
+ <delete file="${rproperties.tmp}"/>
+ <echo message="Adjusted rest conf-locator paths"/>
+ </target>
+
+ <target name="adjust-rproperties2">
+ <copy file="${rproperties2.path}" toFile="${rproperties2.tmp}">
+ <filterset refid="absPathFilter"/>
+ </copy>
+ <copy file="${rproperties2.tmp}" toFile="${rproperties2.path}"
+ overwrite="true" />
+ <delete file="${rproperties2.tmp}"/>
+ <echo message="Adjusted rest.conf paths"/>
+ </target>
</project>
View
2 messaging/rest/java/source/build.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<project default="dist" basedir="." name="GT4.0 elastic messaging bridge">
+<project default="dist" basedir="." name="Nimbus REST interface">
<description>Nimbus CXF REST Admin Interface</description>
View
31 messaging/rest/java/source/etc/rest/other/main.conflocator.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Discover conf files. The conf files hold name/value pairs that are
+ brought into the XML files in this directory via Spring's nice properties
+ mechanism.
+
+ Concentrate all uses of PropertyPlaceholderConfigurer into this bean
+ config so that the install script can do token replacements for absolute
+ paths throughout the entire spring configuration by just running the
+ token replacement on this file.
+
+ Spring wants "//" in front of absolute filesystem paths so that is why
+ "/TOKEN" is used here instead of "TOKEN"
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+ <bean id="restSettings"
+ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+
+ <!-- grab some shared settings from the workspace-service common.conf file,
+ will have to adjust for other deployment scenarios -->
+ <property name="location" value="file://@REST_CONFDIR@/rest.conf" />
+ <property name="placeholderPrefix" value="REST{" />
+ </bean>
+
+</beans>
View
15 messaging/rest/java/source/etc/rest/other/main.xml
@@ -64,14 +64,23 @@ http://cxf.apache.org/schemas/jaxrs.xsd">
</bean>
<bean id="usersResource" class="org.nimbustools.messaging.rest.UsersResource">
- <property name="usersService" ref="fakeUsersService"/>
+ <property name="usersService" ref="usersService"/>
<property name="responseUtil" ref="responseUtil"/>
</bean>
- <bean id="fakeUsersService" class="org.nimbustools.messaging.rest.FakeUsersService"/>
+ <bean id="usersService" class="org.nimbustools.messaging.rest.GridmapUsersService">
+ <property name="gridmapResource" value="$REST{gridmap.path}" />
+ <property name="groupAuthzResource" value="$REST{groupauthz.path}"/>
+ <property name="queryUsersResource" value="$REST{query.usermap.path}" />
+ <property name="localUserName" value="$REST{gridmap.localuser}" />
+ </bean>
<bean id="responseUtil" class="org.nimbustools.messaging.rest.ResponseUtil"/>
-
+
+ <!--
+ property sources are concentrated in this file
+ -->
+ <import resource="main.conflocator.xml"/>
</beans>
View
4 messaging/rest/java/source/etc/rest/rest.conf
@@ -0,0 +1,4 @@
+gridmap.path=/path/to/gridmap
+groupauthz.path=/path/to/groupauthz
+query.usermap.path=/path/to/users.txt
+gridmap.localuser=cloudimages
View
3 scripts/lib/gt4.0/build/build.xml
@@ -64,6 +64,7 @@
<ant dir="${nimbus.messaging.gt4_0-elastic.stubs.builddir}" target="clean" />
<ant dir="${nimbus.messaging.query.service.builddir}" target="clean" />
+ <ant dir="${nimbus.messaging.rest.builddir}" target="clean" />
<ant dir="${nimbus.ctx-broker.gt4_0.builddir}" target="clean" />
@@ -252,10 +253,12 @@
<ant dir="${nimbus.messaging.gt4_0.service.builddir}" target="dist" />
<ant dir="${nimbus.messaging.gt4_0-elastic.service.builddir}" target="dist" />
<ant dir="${nimbus.messaging.query.service.builddir}" target="dist" />
+ <ant dir="${nimbus.messaging.rest.builddir}" target="dist" />
</target>
<target name="run-rest-testserver">
+ <ant dir="${nimbus.autocommon.gt4_0.builddir}" target="dist" /> <!-- dep -->
<ant dir="${nimbus.messaging.rest.builddir}" target="testserver" />
</target>

0 comments on commit eea7329

Please sign in to comment.
Something went wrong with that request. Please try again.