Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
Added derby net support to build system.
Browse files Browse the repository at this point in the history
  • Loading branch information
labisso committed Dec 24, 2009
1 parent dc7d844 commit d197b32
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 5 deletions.
4 changes: 4 additions & 0 deletions messaging/gt4.0/java/gar-builder/etc/post-deploy.xml
Expand Up @@ -118,6 +118,8 @@
value="${base.package.name}" />
<entry key="derby.classpath.dir.prop"
value="${deploy.dir}/lib" />
<entry key="pwGen.path.prop"
value="${workspace.conf.dir}/other/shared-secret-suggestion.py"/>

</propertyfile>
</target>
Expand Down Expand Up @@ -154,6 +156,8 @@
value="${base.package.name}" />
<property name="derby.classpath.dir.prop"
value="${deploy.dir}/lib" />
<property name="pwGen.path.prop"
value="${workspace.conf.dir}/other/shared-secret-suggestion.py"/>

<ant antfile="${dbsetup.antfile}" target="setupWorkspacePersistence" />
</target>
Expand Down
Expand Up @@ -109,4 +109,13 @@
value="$METADATA{" />
</bean>

<bean id="derbySettings"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location"
value="/@DERBY_DIR@/derby.properties" />
<property name="placeholderPrefix"
value="$DERBY{" />

</bean>

</beans>
Expand Up @@ -623,6 +623,8 @@
value="org.apache.derby.jdbc.EmbeddedDriver" />
<property name="url"
value="jdbc:derby:nimbus/WorkspacePersistenceDB" />
<property name="username" value="nimbus"/>
<property name="password" value="$DERBY{derby.user.nimbus}"/>

</bean>

Expand All @@ -637,6 +639,8 @@
value="org.apache.derby.jdbc.EmbeddedDriver" />
<property name="url"
value="jdbc:derby:nimbus/WorkspaceAccountingDB" />
<property name="username" value="nimbus"/>
<property name="password" value="$DERBY{derby.user.nimbus}"/>

</bean>

Expand Down
66 changes: 61 additions & 5 deletions service/service/java/source/share/lib/db-mgmt.xml
Expand Up @@ -14,6 +14,7 @@
derby.system.home.prop - derby home dir to call IJ with
derby.relative.dir.prop - relative path from homedir where our dir is
derby.classpath.dir.prop - path to dir with derby jars
pwGen.path.prop - path to password generation comd
</description>

<property file="../workspace.persistence.conf" />
Expand Down Expand Up @@ -65,7 +66,7 @@
<jvmarg value="-Dderby.system.home=${derby.system.home.prop}"/>
<jvmarg value="-Dderby.infolog.append=true"/>
<jvmarg value="-Dij.protocol=jdbc:derby:directory:${derby.system.home.prop}/"/>
<jvmarg value="-Dij.database=${derby.relative.dir.prop}/WorkspacePersistenceDB;create=true"/>
<jvmarg value="-Dij.database=${derby.relative.dir.prop}/WorkspacePersistenceDB;create=true;user=nimbus;password=${derby.user.pass}"/>
<classpath refid="derby.classpath" />
<arg value="${workspace.sqldir.prop}/workspace_service_derby_schema.sql"/>
</java>
Expand Down Expand Up @@ -107,7 +108,7 @@
<jvmarg value="-Dderby.system.home=${derby.system.home.prop}"/>
<jvmarg value="-Dderby.infolog.append=true"/>
<jvmarg value="-Dij.protocol=jdbc:derby:directory:${derby.system.home.prop}/"/>
<jvmarg value="-Dij.database=${derby.relative.dir.prop}/WorkspacePersistenceDB;create=false"/>
<jvmarg value="-Dij.database=${derby.relative.dir.prop}/WorkspacePersistenceDB;create=false;user=nimbus;password=${derby.user.pass}"/>
<classpath refid="derby.classpath" />
<arg value="${workspace.sqldir.prop}/workspace_service_derby_dump.sql"/>
</java>
Expand All @@ -131,7 +132,7 @@
<jvmarg value="-Dderby.system.home.prop=${derby.system.home.prop}"/>
<jvmarg value="-Dderby.infolog.append=true"/>
<jvmarg value="-Dij.protocol=jdbc:derby:directory:${derby.system.home.prop}/"/>
<jvmarg value="-Dij.database=${derby.relative.dir.prop}/WorkspaceAccountingDB;create=true"/>
<jvmarg value="-Dij.database=${derby.relative.dir.prop}/WorkspaceAccountingDB;create=true;user=nimbus;password=${derby.user.pass}"/>
<classpath refid="derby.classpath" />
<arg value="${workspace.sqldir.prop}/workspace_service_derby_accounting_schema.sql"/>
</java>
Expand Down Expand Up @@ -163,7 +164,7 @@
<jvmarg value="-Dderby.system.home.prop=${derby.system.home.prop}"/>
<jvmarg value="-Dderby.infolog.append=true"/>
<jvmarg value="-Dij.protocol=jdbc:derby:directory:${derby.system.home.prop}/"/>
<jvmarg value="-Dij.database=${derby.relative.dir.prop}/WorkspaceAccountingDB;create=false"/>
<jvmarg value="-Dij.database=${derby.relative.dir.prop}/WorkspaceAccountingDB;create=false;user=nimbus;password=${derby.user.pass}"/>
<classpath refid="derby.classpath" />
<arg value="${workspace.sqldir.prop}/workspace_service_derby_accounting_dump.sql"/>
</java>
Expand All @@ -174,7 +175,59 @@
"SUBROUTINES"
******************************************************************* -->

<target name="allparamscheck">
<target name="assureDerbyProps"
depends="checkDerbyProps, createDerbyProps, readDerbyProps" />
<target name="checkDerbyProps">
<available file="${derby.system.home.prop}/derby.properties"
property="derbyProps.exist"/>
<antcall target="createDerbyProps"/>
<antcall target="readDerbyProps"/>
</target>

<target name="readDerbyProps" if="derbyProps.exist">
<loadproperties srcfile="${derby.system.home.prop}/derby.properties">
<filterchain>
<linecontains>
<contains value="derby.user.nimbus"/>
</linecontains>
</filterchain>
</loadproperties>
<property name="derby.user.pass" value="${derby.user.nimbus}" />
</target>

<target name="createDerbyProps" unless="derbyProps.exist">

<fail message="must specify 'pwGen.path.prop' (path to password generation command)"
unless="pwGen.path.prop"/>

<exec executable="${pwGen.path.prop}" outputproperty="derby.user.pass"/>
<exec executable="${pwGen.path.prop}" outputproperty="derby.guest.pass"/>

<propertyfile file="${derby.system.home.prop}/derby.properties"
comment="Generated by db-mgmt.xml script">
<entry key="derby.user.nimbus" value="${derby.user.pass}"/>
<entry key="derby.user.guest" value="${derby.guest.pass}"/>

<entry key="derby.authentication.provider" value="BUILTIN"/>
<entry key="derby.connection.requireAuthentication" value="true"/>
<entry key="derby.database.propertiesOnly" value="true"/>
<entry key="derby.database.defaultConnectionMode" value="noAccess"/>
<entry key="derby.database.fullAccessUsers" value="nimbus"/>
<entry key="derby.database.readOnlyAccessUsers" value="guest"/>

<entry key="derby.drda.startNetworkServer" value="false"/>
<entry key="derby.drda.keepAlive" value="true"/>
<entry key="derby.drda.securityMechanism"
value="STRONG_PASSWORD_SUBSTITUTE_SECURITY"/>

</propertyfile>

<chmod file="${derby.system.home.prop}/derby.properties" perm="600" />

</target>


<target name="allparamscheck" depends="assureDerbyProps">

<fail message="Must specify 'workspace.dbdir.prop' for this"
unless="workspace.dbdir.prop"/>
Expand All @@ -193,6 +246,9 @@

<fail message="Must specify 'derby.classpath.dir.prop' for this"
unless="derby.classpath.dir.prop"/>

<fail message="Must specify 'derby.user.pass' for this"
unless="derby.user.pass"/>

</target>

Expand Down

0 comments on commit d197b32

Please sign in to comment.