Issue #734 - moved the wes2bridge utilities and rpm specification into their own WA repository.

Former-commit-id: 0d0ba75a14 [formerly 944a1ce201] [formerly 5aabc3bba1] [formerly dff89c83e4 [formerly 5aabc3bba1 [formerly 03e09af0cae74d0510a86ff07a31bbffbe3c4aac]]]
Former-commit-id: dff89c83e4
Former-commit-id: 6bc21555bbadb2d4481dfe124a5ad7b3415643e6 [formerly 5435963041]
Former-commit-id: 11ea72acf0
This commit is contained in:
Bryan Kowal 2012-06-19 13:33:01 -05:00
parent dcb8a248f9
commit 1cb8279ac7
55 changed files with 0 additions and 2466 deletions

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>build.wes2bridge.utility</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

View file

@ -1,32 +0,0 @@
<project basedir=".">
<taskdef resource="net/sf/antcontrib/antlib.xml"
classpath="${basedir}/../build.wes2bridge.utility/lib/ant/ant-contrib-1.0b3.jar" />
<!-- The directory that the jar file will be placed in when it is finished. -->
<property name="destination.directory"
value="" />
<!-- The location of uframe-eclipse. -->
<property name="eclipse.directory" value="/opt/uframe-eclipse" />
<!-- Used to indicate if this is part of an rpm build. -->
<property name="rpm.build" value="false" />
<!-- Verify the a destination directory has been provided. -->
<if>
<equals arg1="${destination.directory}" arg2="" />
<then>
<fail message="Error: a destination directory has not been specified." />
</then>
</if>
<if>
<equals arg1="${rpm.build}" arg2="true" />
<then>
<var name="baseline.directory" value="${basedir}/../build.wes2bridge.utility/wes2bridge/tmp/plugins" />
<var name="bin.dir" value="@dot" />
</then>
<else>
<var name="baseline.directory" value="${basedir}/../" />
<var name="bin.dir" value="bin" />
</else>
</if>
</project>

View file

@ -1,60 +0,0 @@
<project default="build" basedir=".">
<property name="eclipse.dir"
value="/opt/uframe-eclipse" />
<target name="init">
<antcall target="clean" />
<exec executable="/usr/bin/find"
outputproperty="launcher.jar">
<arg value="${eclipse.dir}/plugins" />
<arg value="-name" />
<arg value="org.eclipse.equinox.launcher_*.jar" />
</exec>
<exec executable="/usr/bin/find"
outputproperty="pde.dir">
<arg value="${eclipse.dir}/plugins" />
<arg value="-name" />
<arg value="org.eclipse.pde.build_*" />
</exec>
</target>
<target name="clean">
<if>
<available file="${basedir}/wes2bridge/tmp"
type="dir" />
<then>
<delete includeemptydirs="true">
<fileset dir="${basedir}/wes2bridge/tmp" />
</delete>
</then>
</if>
</target>
<target name="build" depends="init">
<java
classname="org.eclipse.core.launcher.Main"
fork="true"
failonerror="true">
<arg value="-application" />
<arg value="org.eclipse.ant.core.antRunner" />
<arg value="-buildfile" />
<arg value="${pde.dir}/scripts/productBuild/productBuild.xml" />
<arg value="-DbaseLocation=${eclipse.dir}" />
<arg value="-Dbuilder=${basedir}/wes2bridge" />
<arg value="-DbuildDirectory=${basedir}/wes2bridge/tmp" />
<arg value="-Dbase=${basedir}/wes2bridge" />
<arg value="-Dconfigs=linux,gtk,x86" />
<classpath>
<pathelement
location="${launcher.jar}" />
</classpath>
</java>
</target>
<taskdef resource="net/sf/antcontrib/antlib.xml"
classpath="${basedir}/lib/ant/ant-contrib-1.0b3.jar" />
</project>

View file

@ -1,28 +0,0 @@
# Wes2Bridge Utility pde build properties.
product=/com.raytheon.wes2bridge.utility.product/wes2bridge.utility.product
topLevelElementType=feature
buildType=I
buildId=Wes2Bridge
buildLabel=${buildType}.${buildId}
timestamp=007
archivePrefix=wes2bridge
archivesFormat=linux, gtk, x86 - folder
collectingFolder=${archivePrefix}
runPackager=false
skipBase=true
skipFetch=true
skipMaps=true
baseos=linux
basews=gtk
basearch=x86
logExtension=.log
javacDebugInfo=false
javacFailOnError=true
javacVerbose=true
javacSource=1.6
javacTarget=1.6
compilerArg=-g:lines,source

View file

@ -1,191 +0,0 @@
<project name="Build specific targets and properties" default="noDefault">
<!-- ===================================================================== -->
<!-- Run a given ${target} on all elements being built -->
<!-- Add on <ant> task for each top level element being built. -->
<!-- ===================================================================== -->
<property name="allElementsFile" value="${builder}/allElements.xml"/>
<import file="${allElementsFile}" />
<target name="allElements">
<antcall target="allElementsDelegator" />
</target>
<!-- ===================================================================== -->
<!-- ===================================================================== -->
<target name="getBaseComponents" depends="checkLocalBase" unless="skipBase">
<get src="${eclipseBaseURL}" dest="${buildDirectory}/../temp-base.zip" />
<unzip dest="${base}" overwrite="true" src="${buildDirectory}/../temp-base.zip" />
</target>
<target name="checkLocalBase">
<available file="${base}" property="skipBase" />
</target>
<!-- ===================================================================== -->
<!-- Check out map files from correct repository -->
<!-- Replace values for mapsCheckoutTag as desired. -->
<!-- ===================================================================== -->
<target name="getMapFiles" depends="checkLocalMaps" unless="skipMaps">
</target>
<target name="checkLocalMaps">
</target>
<target name="tagMapFiles" if="tagMaps">
</target>
<!-- ===================================================================== -->
<target name="clean" unless="noclean">
<antcall target="allElements">
<param name="target" value="cleanElement" />
</antcall>
</target>
<target name="gatherLogs">
<mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" />
<antcall target="allElements">
<param name="target" value="gatherLogs" />
</antcall>
<unzip dest="${buildDirectory}/${buildLabel}/compilelogs" overwrite="true">
<fileset dir="${buildDirectory}/features">
<include name="**/*.log.zip" />
</fileset>
</unzip>
</target>
<!-- ===================================================================== -->
<!-- Steps to do before setup -->
<!-- ===================================================================== -->
<target name="preSetup">
</target>
<!-- ===================================================================== -->
<!-- Steps to do after setup but before starting the build proper -->
<!-- ===================================================================== -->
<target name="postSetup">
<echo message="${buildDirectory}"/>
<mkdir dir="${buildDirectory}/plugins"/>
<echo message="com.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="com.*/**"/>
</copy>
<echo message="org.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="org.*/**"/>
</copy>
<echo message="javax.*/**"/>
<copy todir="${buildDirectory}/plugins">
<fileset dir="${buildDirectory}/../../../" includes="javax.*/**"/>
</copy>
<echo message="features.*/**"/>
<copy todir="${buildDirectory}/features">
<fileset dir="${buildDirectory}/../../../" includes="*.feature*/**"/>
</copy>
<antcall target="getBaseComponents" />
</target>
<!-- ===================================================================== -->
<!-- Steps to do before fetching the build elements -->
<!-- ===================================================================== -->
<target name="preFetch">
</target>
<!-- ===================================================================== -->
<!-- Steps to do after fetching the build elements -->
<!-- ===================================================================== -->
<target name="postFetch">
</target>
<!-- ===================================================================== -->
<!-- Steps to do before generating the build scripts. -->
<!-- ===================================================================== -->
<target name="preGenerate">
</target>
<!-- ===================================================================== -->
<!-- Steps to do after generating the build scripts. -->
<!-- ===================================================================== -->
<target name="postGenerate">
<antcall target="clean" />
</target>
<!-- ===================================================================== -->
<!-- Steps to do before running the build.xmls for the elements being built. -->
<!-- ===================================================================== -->
<target name="preProcess">
</target>
<!-- ===================================================================== -->
<!-- Steps to do after running the build.xmls for the elements being built. -->
<!-- ===================================================================== -->
<target name="postProcess">
</target>
<!-- ===================================================================== -->
<!-- Steps to do before running assemble. -->
<!-- ===================================================================== -->
<target name="preAssemble">
</target>
<!-- ===================================================================== -->
<!-- Steps to do after running assemble. -->
<!-- ===================================================================== -->
<target name="postAssemble">
</target>
<!-- ===================================================================== -->
<!-- Steps to do before running package. -->
<!-- ===================================================================== -->
<target name="prePackage">
</target>
<!-- ===================================================================== -->
<!-- Steps to do after running package. -->
<!-- ===================================================================== -->
<target name="postPackage">
</target>
<!-- ===================================================================== -->
<!-- Steps to do after the build is done. -->
<!-- ===================================================================== -->
<target name="postBuild">
</target>
<!-- ===================================================================== -->
<!-- Steps to do to test the build results -->
<!-- ===================================================================== -->
<target name="test">
<ant antfile="${builder}/test.xml" />
</target>
<target name="checkJUnitTestResults">
<taskdef name="checkJUnitReports" classname="sample.tools.TestResultCheck" classpath="${builder}/bin;${builder}/extraTools/sampletools.jar" />
<checkJUnitReports dir="${buildDirectory}/${buildLabel}/testresults" output="${buildDirectory}/junitresults.txt" />
</target>
<!-- ===================================================================== -->
<!-- Steps to do to publish the build results -->
<!-- ===================================================================== -->
<target name="publish">
</target>
<!-- ===================================================================== -->
<!-- Default target -->
<!-- ===================================================================== -->
<target name="noDefault">
<echo message="You must specify a target when invoking this file" />
</target>
</project>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.wes2bridge.common</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,8 +0,0 @@
#Thu Jan 12 13:45:52 CST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,10 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Wes2Bridge Utility Common
Bundle-SymbolicName: com.raytheon.wes2bridge.common
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.apache.commons.configuration;bundle-version="1.6.0",
org.apache.commons.lang;bundle-version="2.3.0"
Export-Package: com.raytheon.wes2bridge.common.configuration

View file

@ -1,4 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.

View file

@ -1,158 +0,0 @@
/**
*
*/
package com.raytheon.wes2bridge.common.configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;
/**
* @author bkowal
*
*/
/*
* Example:
* <Wes2BridgeCase>
* <name>String</name>
* <dataArchiveRoot>String</dataArchiveRoot>
* <databasePort>int</databasePort>
* <edexHttpPort>int</edexHttpPort>
* <jmsPort>int</jmsPort>
* <webPort>int</webPort>
* <confidentialPort></confidentialPort>
* </Wes2BridgeCase>
*/
public class Wes2BridgeConfiguration
{
private String configurationFile = null;
private String testCaseName = null;
private String dataArchiveRoot = null;
private int databasePort = -1;
private int edexHttpPort = -1;
private int jmsPort = -1;
private int webPort = -1;
private int confidentialPort = -1;
/**
*
*/
public Wes2BridgeConfiguration(String configurationFile)
{
this.configurationFile = configurationFile;
this.testCaseName = null;
this.dataArchiveRoot = null;
this.databasePort = -1;
this.edexHttpPort = -1;
this.jmsPort = -1;
this.webPort = -1;
this.confidentialPort = -1;
}
public void init()
throws ConfigurationException
{
XMLConfiguration xmlConfiguration =
new XMLConfiguration(this.configurationFile);
this.testCaseName =
xmlConfiguration.getString("name");
/*
* Currently spaces are not allowed in the
* name of a test case.
*/
if (this.testCaseName.contains(" "))
{
ConfigurationException exception =
new ConfigurationException(
"The Edex Environment name cannot contain spaces.");
exception.fillInStackTrace();
throw exception;
}
this.dataArchiveRoot =
xmlConfiguration.getString("dataArchiveRoot");
this.databasePort =
xmlConfiguration.getInt("databasePort");
this.edexHttpPort =
xmlConfiguration.getInt("edexHttpPort");
this.jmsPort =
xmlConfiguration.getInt("jmsPort");
this.webPort =
xmlConfiguration.getInt("webPort");
this.confidentialPort =
xmlConfiguration.getInt("confidentialPort");
}
public String getTestCaseName()
{
return testCaseName;
}
public void setTestCaseName(String testCaseName)
{
this.testCaseName = testCaseName;
}
public String getDataArchiveRoot()
{
return dataArchiveRoot;
}
public void setDataArchiveRoot(String dataArchiveRoot)
{
this.dataArchiveRoot = dataArchiveRoot;
}
public int getDatabasePort()
{
return databasePort;
}
public void setDatabasePort(int databasePort)
{
this.databasePort = databasePort;
}
public int getEdexHttpPort()
{
return edexHttpPort;
}
public void setEdexHttpPort(int edexHttpPort)
{
this.edexHttpPort = edexHttpPort;
}
public int getJmsPort()
{
return jmsPort;
}
public void setJmsPort(int jmsPort)
{
this.jmsPort = jmsPort;
}
public int getWebPort()
{
return webPort;
}
public void setWebPort(int webPort)
{
this.webPort = webPort;
}
public int getConfidentialPort()
{
return confidentialPort;
}
public void setConfidentialPort(int confidentialPort)
{
this.confidentialPort = confidentialPort;
}
}

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.wes2bridge.configuration</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,8 +0,0 @@
#Thu Jan 12 14:09:44 CST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,10 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Wes2Bridge Configuration Utility
Bundle-SymbolicName: com.raytheon.wes2bridge.configuration
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.apache.commons.configuration;bundle-version="1.6.0",
org.apache.commons.lang;bundle-version="2.3.0",
com.raytheon.wes2bridge.common;bundle-version="1.0.0"

View file

@ -1,4 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.

View file

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="create_run_jar"
name="Create Runnable Jar for Project com.raytheon.wes2bridge.configuration with Jar-in-Jar Loader"
basedir=".">
<import file="${basedir}/../build.wes2bridge.utility/ant/setup.xml" />
<target name="create_run_jar">
<jar destfile="${destination.directory}/ConfigurationUtility.jar">
<manifest>
<attribute name="Main-Class" value="org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader"/>
<attribute name="Rsrc-Main-Class" value="com.raytheon.wes2bridge.configuration.ConfigurationUtility"/>
<attribute name="Class-Path" value="."/>
<attribute name="Rsrc-Class-Path" value="./ commons-collections-3.2.jar commons-logging-1.1.1.jar geronimo-jms_1.1_spec-1.1.1.jar org.eclipse.ui_3.6.1.M20100826-1330.jar org.eclipse.swt_3.6.1.v3655c.jar org.eclipse.swt.gtk.linux.x86_3.6.1.v3655c.jar org.eclipse.jface_3.6.1.M20100825-0800.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar org.eclipse.ui.workbench_3.6.1.M20100826-1330.jar org.eclipse.core.runtime_3.6.0.v20100505.jar org.eclipse.osgi_3.6.1.R36x_v20100806.jar org.eclipse.equinox.common_3.6.0.v20100503.jar org.eclipse.core.jobs_3.5.1.R36x_v20100824.jar runtime_registry_compatibility.jar org.eclipse.equinox.registry_3.5.0.v20100503.jar org.eclipse.equinox.preferences_3.3.0.v20100503.jar org.eclipse.core.contenttype_3.4.100.v20100505-1235.jar org.eclipse.equinox.app_1.3.1.R36x_v20100803.jar log4j-1.2.16.jar log4j.extras-1.0.jar commons-beanutils-1.8.3.jar commons-digester-1.8.1.jar commons-lang-2.3.jar commons-configuration-1.6.jar"/>
</manifest>
<zipfileset src="${basedir}/../build.wes2bridge.utility/lib/jar-in-jar-loader.zip"/>
<zipfileset dir="${baseline.directory}/org.apache.commons.collections" includes="commons-collections-3.2.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.commons.logging" includes="commons-logging-1.1.1.jar"/>
<zipfileset dir="${baseline.directory}/javax.jms" includes="geronimo-jms_1.1_spec-1.1.1.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.ui_3.6.1.M20100826-1330.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.swt_3.6.1.v3655c.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.swt.gtk.linux.x86_3.6.1.v3655c.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.jface_3.6.1.M20100825-0800.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.ui.workbench_3.6.1.M20100826-1330.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.core.runtime_3.6.0.v20100505.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.osgi_3.6.1.R36x_v20100806.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.core.jobs_3.5.1.R36x_v20100824.jar"/>
<zipfileset dir="${eclipse.directory}/plugins/org.eclipse.core.runtime.compatibility.registry_3.3.0.v20100520" includes="runtime_registry_compatibility.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.equinox.registry_3.5.0.v20100503.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.equinox.preferences_3.3.0.v20100503.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.core.contenttype_3.4.100.v20100505-1235.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.equinox.app_1.3.1.R36x_v20100803.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.log4j" includes="log4j-1.2.16.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.log4j" includes="log4j.extras-1.0.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.commons.beanutils" includes="commons-beanutils-1.8.3.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.commons.digester" includes="commons-digester-1.8.1.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.commons.lang" includes="commons-lang-2.3.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.commons.configuration" includes="commons-configuration-1.6.jar"/>
<fileset dir="${baseline.directory}/com.raytheon.wes2bridge.common/${bin.dir}"/>
<fileset dir="${baseline.directory}/com.raytheon.wes2bridge.configuration/${bin.dir}"/>
</jar>
</target>
</project>

View file

@ -1,80 +0,0 @@
/**
*
*/
package com.raytheon.wes2bridge.configuration;
import org.apache.commons.configuration.ConfigurationException;
import com.raytheon.wes2bridge.common.configuration.Wes2BridgeConfiguration;
/**
* @author bkowal
*
*/
public class ConfigurationUtility
{
private static final String FIELD_NAME = "-name";
private static final String FIELD_ARCHIVE = "-archiveRoot";
private static final String FIELD_DBPORT = "-databasePort";
private static final String FIELD_HTTPPORT = "-httpPort";
private static final String FIELD_JMSPORT = "-jmsPort";
private static final String FIELD_WEBPORT =
"-webPort";
private static final String FIELD_CONFPORT =
"-confidentialPort";
/**
* @param args
*/
public static void main(String[] args)
{
if (args.length != 2)
{
System.out.println("Error: both a configuration file and a field must be specified.");
System.exit(-1);
}
Wes2BridgeConfiguration configuration =
new Wes2BridgeConfiguration(args[0]);
try
{
configuration.init();
}
catch (ConfigurationException e1)
{
e1.printStackTrace();
System.exit(-1);
}
final String field = args[1];
if (field.equals(FIELD_NAME))
{
System.out.print(configuration.getTestCaseName());
}
else if (field.equals(FIELD_ARCHIVE))
{
System.out.print(configuration.getDataArchiveRoot());
}
else if (field.equals(FIELD_DBPORT))
{
System.out.print(configuration.getDatabasePort());
}
else if (field.equals(FIELD_HTTPPORT))
{
System.out.print(configuration.getEdexHttpPort());
}
else if (field.equals(FIELD_JMSPORT))
{
System.out.print(configuration.getJmsPort());
}
else if (field.equals(FIELD_WEBPORT))
{
System.out.println(configuration.getWebPort());
}
else if (field.equals(FIELD_CONFPORT))
{
System.out.println(configuration.getConfidentialPort());
}
System.exit(0);
}
}

View file

@ -1,6 +0,0 @@
log4j.rootLogger=ERROR, CA
log4j.appender.CA=org.apache.log4j.ConsoleAppender
log4j.appender.CA.layout=org.apache.log4j.PatternLayout
log4j.appender.CA.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.wes2bridge.datalink</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,8 +0,0 @@
#Thu Jan 12 13:58:47 CST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,7 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Wes2Bridge Datalink Utility
Bundle-SymbolicName: com.raytheon.wes2bridge.datalink
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View file

@ -1,4 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="create_run_jar"
name="Create Runnable Jar for Project com.raytheon.wes2bridge.datalink with Jar-in-Jar Loader"
basedir=".">
<import file="${basedir}/../build.wes2bridge.utility/ant/setup.xml" />
<target name="create_run_jar">
<jar destfile="${destination.directory}/DataLinkUtility.jar">
<manifest>
<attribute name="Main-Class" value="org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader"/>
<attribute name="Rsrc-Main-Class" value="com.raytheon.wes2bridge.datalink.DataLinkUtility"/>
<attribute name="Class-Path" value="."/>
<attribute name="Rsrc-Class-Path" value="./"/>
</manifest>
<zipfileset src="${basedir}/../build.wes2bridge.utility/lib/jar-in-jar-loader.zip"/>
<fileset dir="${baseline.directory}/com.raytheon.wes2bridge.datalink/${bin.dir}"/>
</jar>
</target>
</project>

View file

@ -1,34 +0,0 @@
/**
*
*/
package com.raytheon.wes2bridge.datalink;
/**
* @author bkowal
*
* This is an extremely simple utility. This program
* expects on argument: a postgresql database directory.
* This utility will then extract the "/awips2/data" and
* return only the name of the database directory.
*/
public class DataLinkUtility
{
private static final String AWIPSII_DATA = "/awips2/data/";
/**
* @param args
*/
public static void main(String[] args)
{
if (args.length != 1)
{
System.out.print("Error: The name of the data directory must be specified.");
System.exit(-1);
}
String dataDirectory = args[0];
System.out.print(dataDirectory.replace(AWIPSII_DATA, ""));
System.exit(0);
}
}

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.wes2bridge.manager</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,8 +0,0 @@
#Wed Jan 11 13:37:48 CST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,10 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Wes2Bridge Manager
Bundle-SymbolicName: com.raytheon.wes2bridge.manager
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: com.raytheon.wes2bridge.common;bundle-version="1.0.0",
org.apache.commons.configuration;bundle-version="1.6.0",
org.apache.commons.lang;bundle-version="2.3.0"

View file

@ -1,4 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.

View file

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="create_run_jar"
name="Create Runnable Jar for Project com.raytheon.wes2bridge.manager with Jar-in-Jar Loader"
basedir=".">
<import file="${basedir}/../build.wes2bridge.utility/ant/setup.xml" />
<target name="create_run_jar">
<jar destfile="${destination.directory}/Wes2BridgeManager.jar">
<manifest>
<attribute name="Main-Class" value="org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader"/>
<attribute name="Rsrc-Main-Class" value="com.raytheon.wes2bridge.manager.Wes2BridgeManager"/>
<attribute name="Class-Path" value="."/>
<attribute name="Rsrc-Class-Path" value="./ commons-collections-3.2.jar commons-logging-1.1.1.jar geronimo-jms_1.1_spec-1.1.1.jar org.eclipse.ui_3.6.1.M20100826-1330.jar org.eclipse.swt_3.6.1.v3655c.jar org.eclipse.swt.gtk.linux.x86_3.6.1.v3655c.jar org.eclipse.jface_3.6.1.M20100825-0800.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar org.eclipse.ui.workbench_3.6.1.M20100826-1330.jar org.eclipse.core.runtime_3.6.0.v20100505.jar org.eclipse.osgi_3.6.1.R36x_v20100806.jar org.eclipse.equinox.common_3.6.0.v20100503.jar org.eclipse.core.jobs_3.5.1.R36x_v20100824.jar runtime_registry_compatibility.jar org.eclipse.equinox.registry_3.5.0.v20100503.jar org.eclipse.equinox.preferences_3.3.0.v20100503.jar org.eclipse.core.contenttype_3.4.100.v20100505-1235.jar org.eclipse.equinox.app_1.3.1.R36x_v20100803.jar log4j-1.2.16.jar log4j.extras-1.0.jar commons-beanutils-1.8.3.jar commons-digester-1.8.1.jar commons-lang-2.3.jar commons-configuration-1.6.jar"/>
</manifest>
<zipfileset src="${basedir}/../build.wes2bridge.utility/lib/jar-in-jar-loader.zip"/>
<zipfileset dir="${baseline.directory}/org.apache.commons.collections" includes="commons-collections-3.2.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.commons.logging" includes="commons-logging-1.1.1.jar"/>
<zipfileset dir="${baseline.directory}/javax.jms" includes="geronimo-jms_1.1_spec-1.1.1.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.ui_3.6.1.M20100826-1330.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.swt_3.6.1.v3655c.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.swt.gtk.linux.x86_3.6.1.v3655c.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.jface_3.6.1.M20100825-0800.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.ui.workbench_3.6.1.M20100826-1330.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.core.runtime_3.6.0.v20100505.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.osgi_3.6.1.R36x_v20100806.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.core.jobs_3.5.1.R36x_v20100824.jar"/>
<zipfileset dir="${eclipse.directory}/plugins/org.eclipse.core.runtime.compatibility.registry_3.3.0.v20100520" includes="runtime_registry_compatibility.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.equinox.registry_3.5.0.v20100503.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.equinox.preferences_3.3.0.v20100503.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.core.contenttype_3.4.100.v20100505-1235.jar"/>
<zipfileset dir="${eclipse.directory}/plugins" includes="org.eclipse.equinox.app_1.3.1.R36x_v20100803.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.log4j" includes="log4j-1.2.16.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.log4j" includes="log4j.extras-1.0.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.commons.beanutils" includes="commons-beanutils-1.8.3.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.commons.digester" includes="commons-digester-1.8.1.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.commons.lang" includes="commons-lang-2.3.jar"/>
<zipfileset dir="${baseline.directory}/org.apache.commons.configuration" includes="commons-configuration-1.6.jar"/>
<fileset dir="${baseline.directory}/com.raytheon.wes2bridge.common/${bin.dir}"/>
<fileset dir="${baseline.directory}/com.raytheon.wes2bridge.manager/${bin.dir}"/>
</jar>
</target>
</project>

View file

@ -1,494 +0,0 @@
/**
*
*/
package com.raytheon.wes2bridge.manager;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.BufferedReader;
import java.io.FileWriter;
import java.io.BufferedWriter;
import java.io.IOException;
import org.apache.commons.configuration.ConfigurationException;
import com.raytheon.wes2bridge.common.configuration.Wes2BridgeConfiguration;
/**
* @author bkowal
*
* This java-based utility is used to update a wes2bridge environment.
* This utility is invoked by the wes2bridge management script (bash)
* after the management script spawns a new edex, database, qpid.
* Only "base" files are updated based on the configuration file. The
* new wes2bridge environment will still need to be localized.
*/
public class Wes2BridgeManager
{
private static final String AWIPSII =
"/awips2";
private static final String AWIPSII_WES2BRIDGE_SCRIPTS =
AWIPSII + "/edex-environment/scripts";
private static final String WES2BRIDGE_DIRECTORY =
"/usr/local/edex-environment";
private Wes2BridgeConfiguration configuration = null;
private String wes2BridgeScripts = null;
/**
*
*/
public Wes2BridgeManager()
{
}
/**
* @param args
*/
public static void main(String[] args)
{
if (args.length != 1)
{
System.out.println("ERROR: The configuration file has not been specified.");
System.exit(-1);
}
Wes2BridgeManager manager = new Wes2BridgeManager();
try
{
manager.init(args[0]);
}
catch (Exception e1)
{
e1.printStackTrace();
System.exit(-1);
}
try
{
manager.reconfigureEdex();
}
catch (Exception e1)
{
e1.printStackTrace();
System.exit(-1);
}
try
{
manager.reconfigurePostgreSQL();
}
catch (Exception e1)
{
e1.printStackTrace();
System.exit(-1);
}
try
{
manager.reconfigureQPID();
}
catch (Exception e1)
{
e1.printStackTrace();
System.exit(-1);
}
System.exit(0);
}
public void init(String arg1)
throws ConfigurationException
{
configuration = new Wes2BridgeConfiguration(arg1);
configuration.init();
this.wes2BridgeScripts = WES2BRIDGE_DIRECTORY + "/" +
configuration.getTestCaseName() + "/" +
"edex-environment";
}
/*
* Updates setup.env and wrapper.conf.
*/
public void reconfigureEdex()
throws FileNotFoundException, IOException
{
final String srcEdexDirectory =
AWIPSII + "/" +
"edex";
final String edexDirectory =
WES2BRIDGE_DIRECTORY + "/" +
this.configuration.getTestCaseName() + "/" +
"edex";
this.updateEdexSetup(srcEdexDirectory, edexDirectory);
this.updateEdexWrapper(srcEdexDirectory, edexDirectory);
this.updateEdexCamel(edexDirectory);
}
private void updateEdexSetup(String srcEdexDirectory,
String edexDirectory)
throws FileNotFoundException, IOException
{
String srcsetup_env = srcEdexDirectory + "/bin/setup.env";
String setup_env = edexDirectory + "/bin/setup.env";
File srcFile = new File(srcsetup_env);
File destFile = new File(setup_env);
BufferedReader br =
new BufferedReader(new FileReader(srcFile));
BufferedWriter bw =
new BufferedWriter(new FileWriter(destFile));
final String line1 = "export DATA_ARCHIVE_ROOT=";
final String line2 = "export DB_PORT=";
final String line3 = "export BROKER_ADDR=";
final String line4 = "export HTTP_PORT=";
final String line5 = "export JMS_SERVER=";
final String line6 = "export SHARE_DIR=";
String line = "";
while ((line = br.readLine()) != null)
{
if (line.startsWith(line1))
{
line = line1 + this.configuration.getDataArchiveRoot();
}
else if (line.startsWith(line2))
{
line = line2 + this.configuration.getDatabasePort();
}
else if (line.startsWith(line3))
{
line = line3 + "localhost:" +
this.configuration.getJmsPort();
}
else if (line.startsWith(line4))
{
line = line4 + this.configuration.getEdexHttpPort();
}
else if (line.startsWith(line5))
{
line = line5 + "tcp://localhost:" +
this.configuration.getJmsPort();
}
else if (line.startsWith(line6))
{
line = line6 + edexDirectory + "/data/share";
}
bw.write(line + "\n");
}
br.close();
bw.close();
}
/* Disable JMX. */
private void updateEdexWrapper(String srcEdexDirectory,
String edexDirectory)
throws FileNotFoundException, IOException
{
String srcwrapper_conf = srcEdexDirectory +
"/bin/linux-x86-32/wrapper.conf";
String wrapper_conf = edexDirectory +
"/bin/linux-x86-32/wrapper.conf";
File srcFile = new File(srcwrapper_conf);
File destFile = new File(wrapper_conf);
BufferedReader br =
new BufferedReader(new FileReader(srcFile));
BufferedWriter bw =
new BufferedWriter(new FileWriter(destFile));
/*
* We want to replace at least one of the jmx jvm arguments
* with the wes2bridge.instance argument.
*/
boolean wes2BridgeInstanceAdded = false;
/*
* Disable JMX Remote and add a new wes2bridge.instance
* JVM argument so that it will be possible to determine
* which edex instance belongs to which test case.
*/
/*
* This may apply to multiple jvm arguments including:
* 1) -Dcom.sun.management.jmxremote.port
* 2) -Dcom.sun.management.jmxremote.authenticate
* 3) -Dcom.sun.management.jmxremote.ssl
*/
final String line1 = "-Dcom.sun.management.jmxremote";
/* Set the web port; used by uengine spring. */
final String line2 = "-Dweb.port";
/* Set the confidential port; used by uengine spring. */
final String line3 = "-Dconfidential.port";
String line = "";
while ((line = br.readLine()) != null)
{
if (line.contains(line1))
{
line = this.getJVMArgumentName(line);
if (wes2BridgeInstanceAdded == false)
{
line += "-Dwes2bridge.instance=" +
this.configuration.getTestCaseName();
wes2BridgeInstanceAdded = true;
}
}
else if (line.contains(line2))
{
line = this.getJVMArgumentName(line);
line += line2 + "=" +
this.configuration.getWebPort();
}
else if (line.contains(line3))
{
line = this.getJVMArgumentName(line);
line += line3 + "=" +
this.configuration.getConfidentialPort();
}
bw.write(line + "\n");
}
br.close();
bw.close();
}
private String getJVMArgumentName(String jvmArgument)
{
if (jvmArgument == null)
{
System.out.println("ERROR: Invalid wrapper.conf file.");
System.exit(-1);
}
String[] splitJVMArg = jvmArgument.split("=");
if (splitJVMArg.length <= 0)
{
System.out.println("ERROR: Invalid wrapper.conf file.");
System.exit(-1);
}
return splitJVMArg[0] + "=";
}
private void updateEdexCamel(String edexDirectory)
throws FileNotFoundException, IOException
{
final String srcedex_camel = AWIPSII_WES2BRIDGE_SCRIPTS + "/" +
"edex_camel";
final String edex_camel = this.wes2BridgeScripts + "/edex_camel";
File srcFile = new File(srcedex_camel);
File destFile = new File(edex_camel);
BufferedReader br =
new BufferedReader(new FileReader(srcFile));
BufferedWriter bw =
new BufferedWriter(new FileWriter(destFile));
final String line1 = "EDEX_INSTALL=";
final String line2 = "export DATA_ARCHIVE_ROOT=";
final String line3 =
"CAMELPROCESS=`ps -ef | grep \"edex.dev.mode\"|grep -c \"edex.run.mode=${1} \" `";
String line = "";
while ((line = br.readLine()) != null)
{
if (line.trim().startsWith(line1))
{
line = line1 + edexDirectory;
}
else if (line.trim().startsWith(line2))
{
line = line2 +
this.configuration.getDataArchiveRoot();
}
else if (line.trim().startsWith(line3))
{
line = "CAMELPROCESS=`ps -ef | " +
"grep \"wes2bridge.instance=" +
this.configuration.getTestCaseName() + "\" | " +
"grep -c \"edex.run.mode=${1} \" `";
}
bw.write(line + "\n");
}
br.close();
bw.close();
}
public void reconfigurePostgreSQL()
throws FileNotFoundException, IOException
{
final String postgresqlRootDirectory =
WES2BRIDGE_DIRECTORY + "/" +
this.configuration.getTestCaseName();
this.updateEdexPostgres(postgresqlRootDirectory);
}
private void updateEdexPostgres(String postgresqlRootDirectory)
throws FileNotFoundException, IOException
{
final String srcedex_postgres = AWIPSII_WES2BRIDGE_SCRIPTS + "/" +
"edex_postgres";
final String edex_postgres = this.wes2BridgeScripts +
"/edex_postgres";
File srcFile = new File(srcedex_postgres);
File destFile = new File(edex_postgres);
BufferedReader br =
new BufferedReader(new FileReader(srcFile));
BufferedWriter bw =
new BufferedWriter(new FileWriter(destFile));
final String line1 = "POSTGRESQL_INSTALL_ROOT=";
final String line2 = "PGPORT=";
String line = "";
while ((line = br.readLine()) != null)
{
if (line.startsWith(line1))
{
line = line1 + postgresqlRootDirectory;
}
else if (line.startsWith(line2))
{
line = line2 +
this.configuration.getDatabasePort();
}
bw.write(line + "\n");
}
br.close();
bw.close();
}
public void reconfigureQPID()
throws FileNotFoundException, IOException
{
final String srcQpidDirectory =
AWIPSII + "/" +
"qpid";
final String qpidDirectory =
WES2BRIDGE_DIRECTORY + "/" +
this.configuration.getTestCaseName() + "/" +
"qpid";
this.updateQpidConf(srcQpidDirectory, qpidDirectory);
this.updateQPIDD(qpidDirectory);
this.updateQueueCreatorSH(qpidDirectory);
}
/* Updates qpidd.conf */
private void updateQpidConf(String srcQpidDirectory,
String qpidDirectory)
throws FileNotFoundException, IOException
{
String srcqpidd_conf = srcQpidDirectory +
"/etc/qpidd.conf";
String qpidd_conf = qpidDirectory + "/etc/qpidd.conf";
File srcFile = new File(srcqpidd_conf);
File destFile = new File(qpidd_conf);
BufferedReader br =
new BufferedReader(new FileReader(srcFile));
BufferedWriter bw =
new BufferedWriter(new FileWriter(destFile));
final String line1 = "data-dir=";
final String line2 = "store-dir=";
final String line3 = "pid-dir=";
/*
* add the port to qpidd.conf
*/
final String line4 = "auth=no";
String line = "";
while ((line = br.readLine()) != null)
{
if (line.startsWith(line1))
{
line = line1 + qpidDirectory + "/data";
}
else if (line.startsWith(line2))
{
line = line2 + qpidDirectory + "/messageStore";
}
else if (line.startsWith(line3))
{
line = line3 + qpidDirectory + "/var/lock";
}
else if (line.startsWith(line4))
{
line = line4 + "\nport=" +
this.configuration.getJmsPort();
}
bw.write(line + "\n");
}
br.close();
bw.close();
}
private void updateQPIDD(String qpidDirectory)
throws FileNotFoundException, IOException
{
final String srcqpidd = AWIPSII_WES2BRIDGE_SCRIPTS + "/" +
"qpidd";
final String qpidd = this.wes2BridgeScripts + "/qpidd";
File srcFile = new File(srcqpidd);
File destFile = new File(qpidd);
BufferedReader br =
new BufferedReader(new FileReader(srcFile));
BufferedWriter bw =
new BufferedWriter(new FileWriter(destFile));
final String line1 = "QPID_HOME=";
String line = "";
while ((line = br.readLine()) != null)
{
if (line.startsWith(line1))
{
line = line1 + qpidDirectory;
}
bw.write(line + "\n");
}
br.close();
bw.close();
}
private void updateQueueCreatorSH(String qpidDirectory)
throws FileNotFoundException, IOException
{
final String srcqueue = AWIPSII_WES2BRIDGE_SCRIPTS + "/" +
"queueCreator.sh";
final String queue = qpidDirectory + "/sbin/queueCreator.sh";
File srcFile = new File(srcqueue);
File destFile = new File(queue);
BufferedReader br =
new BufferedReader(new FileReader(srcFile));
BufferedWriter bw =
new BufferedWriter(new FileWriter(destFile));
final String line1 = "port=";
String line = "";
while ((line = br.readLine()) != null)
{
if (line.startsWith(line1))
{
line = line1 + this.configuration.getJmsPort();
}
bw.write(line + "\n");
}
br.close();
bw.close();
}
}

View file

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.wes2bridge.utility.feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

View file

@ -1 +0,0 @@
bin.includes = feature.xml

View file

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="com.raytheon.wes2bridge.utility.feature"
label="Wes2Bridge Utility Feature"
version="1.0.0.qualifier"
provider-name="RAYTHEON">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<plugin
id="com.raytheon.wes2bridge.common"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.wes2bridge.configuration"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.wes2bridge.datalink"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.wes2bridge.manager"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.apache.commons.beanutils"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.commons.collections"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.commons.configuration"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.commons.digester"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.commons.lang"
download-size="0"
install-size="0"
version="0.0.0"/>
</feature>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.wes2bridge.utility.product</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -1,8 +0,0 @@
#Thu Apr 05 13:05:10 CDT 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,7 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Wes2Bridge Utility Product
Bundle-SymbolicName: com.raytheon.wes2bridge.utility.product
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View file

@ -1,4 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product name="AWIPS II Wes2Bridge Utilities" useFeatures="true" includeLaunchers="true">
<configIni use="default">
</configIni>
<launcherArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
</launcherArgs>
<plugins>
</plugins>
<features>
<feature id="com.raytheon.wes2bridge.utility.feature" version="1.0.0.qualifier"/>
</features>
</product>

View file

View file

@ -1,298 +0,0 @@
%define _installation_directory "/awips2"
#
# awips2-edex-environment
#
Name: awips2-edex-environment
Summary: awips2-edex-environment
Version: %{_component_version}
Release: %{_component_release}
Group: AWIPSII
BuildRoot: %{_build_root}
URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no
provides: awips2-edex-environment
provides: awips2-edex-base
provides: awips2-base-component
provides: awips2-edex-gfe
requires: awips2-postgresql
requires: awips2-qpid-server-store
requires: awips2-qpid-client
requires: awips2-qpid-server
requires: awips2-python
requires: awips2-java
requires: awips2-psql
conflicts: awips2-edex-satellite
conflicts: awips2-edex-cots
conflicts: awips2-edex-radar
conflicts: awips2-edex-dataplugins
conflicts: awips2-edex-text
conflicts: awips2-edex-bufr
conflicts: awips2-edex-npp
conflicts: awips2-edex-grib
conflicts: awips2-edex-dat
conflicts: awips2-edex-common-core
conflicts: awips2-edex-configuration
conflicts: awips2-edex-hydro
conflicts: awips2-edex-ncep
conflicts: awips2-edex-core
%description
The edex environment version of awips2-edex consists of the edex runtime and
the AWIPS II edex-environment manager. The edex-environment manager exists to spawn
and configure additional instances of the AWIPS II processing triad {postgresql,
qpid, edex}. The edex environment version of awips2-edex is not designed to
be run in the same way that the standard awips2-edex is.
# Disable byte-compiling of python and repacking of jar files.
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
%prep
# Verify that a build root has been specified.
if [ "%{build_root}" = "" ]; then
echo "ERROR: A 'BuildRoot' has not been specified."
exit 1
fi
rm -rf %{_build_root}
if [ $? -ne 0 ]; then
exit 1
fi
# Verify that the required scripts exist.
# build.sh
if [ ! -f %{_baseline_workspace}/build.edex/build.sh ]; then
echo "ERROR: Unable to locate the edex pde build script."
exit 1
fi
# deploy-install.sh
if [ ! -f %{_baseline_workspace}/build.edex/deploy-install.xml ]; then
echo "ERROR: Unable to locate the edex deploy-install script."
exit 1
fi
# ensure that ant is in the path.
which ant > /dev/null 2>&1
if [ $? -ne 0 ]; then
which ant
exit 1
fi
mkdir -p %{_build_root}%{_installation_directory}/edex
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p %{_build_root}%{_installation_directory}/edex-environment/scripts
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p %{_build_root}%{_installation_directory}/edex-environment/macro/utilities
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p %{_build_root}%{_installation_directory}/edex-environment/macro/functions
if [ $? -ne 0 ]; then
exit 1
fi
mkdir -p %{_build_root}/etc/profile.d
if [ $? -ne 0 ]; then
exit 1
fi
# create the edex environment directory.
mkdir -p %{_build_root}/usr/local/edex-environment
%build
# build edex
pushd . > /dev/null 2>&1
# Run the pde build.
cd %{_baseline_workspace}/build.edex
/bin/bash build.sh -eclipse=%{_uframe_eclipse}
if [ $? -ne 0 ]; then
echo "ERROR: The pde build of edex has failed."
exit 1
fi
popd > /dev/null 2>&1
# build the edex-environment utilities
pushd . > /dev/null 2>&1
# Run the pde build.
cd %{_baseline_workspace}/build.wes2bridge.utility
/awips2/ant/bin/ant -f build.xml \
-Declipse.dir=%{_uframe_eclipse}
if [ $? -ne 0 ]; then
echo "ERROR: The pde build of the wes2bridge utilities has failed."
exit 1
fi
popd > /dev/null 2>&1
%install
# Run the deployment to the specified directory:
# %{_build_root}%{_installation_directory}/edex
# "install" edex
pushd . > /dev/null 2>&1
cd %{_baseline_workspace}/build.edex
ant -f deploy-install.xml \
-Dinstall.dir=%{_build_root}%{_installation_directory}/edex \
-Dinstaller=true
if [ $? -ne 0 ]; then
echo "ERROR: the deploy-install of edex has failed."
exit 1
fi
popd > /dev/null 2>&1
# "install" the wes2bridge utilities
cd %{_baseline_workspace}/com.raytheon.wes2bridge.configuration
/awips2/ant/bin/ant -f build.xml \
-Ddestination.directory=%{_build_root}%{_installation_directory}/edex-environment/macro/utilities \
-Declipse.directory=%{_uframe_eclipse} \
-Drpm.build=true
if [ $? -ne 0 ]; then
exit 1
fi
cd %{_baseline_workspace}/com.raytheon.wes2bridge.datalink
/awips2/ant/bin/ant -f build.xml \
-Ddestination.directory=%{_build_root}%{_installation_directory}/edex-environment/macro/utilities \
-Declipse.directory=%{_uframe_eclipse} \
-Drpm.build=true
if [ $? -ne 0 ]; then
exit 1
fi
cd %{_baseline_workspace}/com.raytheon.wes2bridge.manager
/awips2/ant/bin/ant -f build.xml \
-Ddestination.directory=%{_build_root}%{_installation_directory}/edex-environment/macro/utilities \
-Declipse.directory=%{_uframe_eclipse} \
-Drpm.build=true
if [ $? -ne 0 ]; then
exit 1
fi
RPM_PROJECT="%{_baseline_workspace}/Installer.rpm"
POSTGRES_INITD="${RPM_PROJECT}/awips2.core/Installer.postgresql/scripts/init.d/edex_postgres"
QPID_INITD="${RPM_PROJECT}/awips2.qpid/SOURCES/qpidd"
QUEUE_SH="${RPM_PROJECT}/awips2.qpid/SOURCES/queueCreator.sh"
EDEX_INITD="${RPM_PROJECT}/awips2.edex/Installer.edex-base/scripts/init.d/edex_camel"
# Copy the startup scripts.
cp ${POSTGRES_INITD} \
%{_build_root}%{_installation_directory}/edex-environment/scripts
if [ $? -ne 0 ]; then
exit 1
fi
cp ${QPID_INITD} \
%{_build_root}%{_installation_directory}/edex-environment/scripts
if [ $? -ne 0 ]; then
exit 1
fi
cp ${QUEUE_SH} \
%{_build_root}%{_installation_directory}/edex-environment/scripts
if [ $? -ne 0 ]; then
exit 1
fi
cp ${EDEX_INITD} \
%{_build_root}%{_installation_directory}/edex-environment/scripts
if [ $? -ne 0 ]; then
exit 1
fi
# Copy the edex-environment macro, functions, and utilities.
DELIVERABLES="%{_baseline_workspace}/Installer.rpm/awips2.edex-environment/wes2bridge.files/deliverables"
# Macro and functions.
cp ${DELIVERABLES}/scripts/edex-environment \
%{_build_root}%{_installation_directory}/edex-environment/macro
if [ $? -ne 0 ]; then
exit 1
fi
cp ${DELIVERABLES}/scripts/functions/*.sh \
%{_build_root}%{_installation_directory}/edex-environment/macro/functions
if [ $? -ne 0 ]; then
exit 1
fi
# The profile.d script.
cp ${DELIVERABLES}/profile.d/* \
%{_build_root}/etc/profile.d
if [ $? -ne 0 ]; then
exit 1
fi
# Temporary? Remove the edex management plugin.
JAR_FILE="com.raytheon.uf.edex.management.jar"
if [ -f %{_build_root}%{_installation_directory}/edex/lib/plugins/${JAR_FILE} ]; then
rm -f %{_build_root}%{_installation_directory}/edex/lib/plugins/${JAR_FILE}
if [ $? -ne 0 ]; then
exit 1
fi
fi
%pre
%post
# We need to create a link to the python shared library if it does not exist.
pushd . > /dev/null 2>&1
if [ -d /awips2/python/lib ]; then
cd /awips2/python/lib
if [ -L libpython.so ]; then
# Ensure that we are pointing to the correct shared library.
rm -f libpython.so
fi
if [ -f libpython2.7.so.1.0 ]; then
ln -s libpython2.7.so.1.0 libpython.so
fi
fi
popd > /dev/null 2>&1
%preun
%postun
%files
%defattr(644,awips,fxalpha,755)
%dir /awips2
%dir /awips2/edex
%dir /awips2/edex/conf
/awips2/edex/conf/*
%dir /awips2/edex/data
/awips2/edex/data/*
%dir /awips2/edex/etc
/awips2/edex/etc/*
%dir /awips2/edex/lib
/awips2/edex/lib/*
%dir /awips2/edex/logs
%dir /awips2/edex/webapps
/awips2/edex/webapps/*
%dir /awips2/edex/bin/linux-x86-32
/awips2/edex/bin/linux-x86-32/*.so
/awips2/edex/bin/linux-x86-32/*.conf
/awips2/edex/bin/setup.env
%dir /usr/local/edex-environment
%defattr(755,awips,fxalpha,755)
%dir /awips2/edex/bin
/awips2/edex/bin/*.sh
/awips2/edex/bin/linux-x86-32/wrapper
/awips2/edex/bin/wrapper.jar
%defattr(644,root,root,755)
%dir /awips2/edex-environment
%dir /awips2/edex-environment/scripts
/awips2/edex-environment/scripts/*
%dir /awips2/edex-environment/macro
%dir /awips2/edex-environment/macro/utilities
/awips2/edex-environment/macro/utilities/*
%dir /awips2/edex-environment/macro/functions
/awips2/edex-environment/macro/functions/*
/etc/profile.d/awips2-edex-env.sh
/etc/profile.d/awips2-edex-env.csh
%defattr(700,root,root,755)
/awips2/edex-environment/macro/edex-environment

View file

@ -1,46 +0,0 @@
#!/bin/bash
# User variables for local builds:
export U_RPM_DESTINATION="/home/bkowal/rpmbuild"
export U_COMPONENT_VERSION="11.9.0"
export U_COMPONENT_RELEASE="1"
export U_BUILD_ROOT="/tmp/${USER}/awips2-build"
export U_UFRAME_ECLIPSE="/opt/uframe-eclipse"
export U_BASELINE_WORKSPACE="/common/bkowal/workspace"
# build variables
if [ "${RPM_DESTINATION}" = "" ]; then
export RPM_DESTINATION="${U_RPM_DESTINATION}"
fi
if [ "${COMPONENT_VERSION}" = "" ]; then
export COMPONENT_VERSION="${U_COMPONENT_VERSION}"
fi
if [ "${COMPONENT_RELEASE}" = "" ]; then
export COMPONENT_RELEASE="${U_COMPONENT_RELEASE}"
fi
if [ "${BUILD_ROOT}" = "" ]; then
export BUILD_ROOT="${U_BUILD_ROOT}"
fi
if [ "${UFRAME_ECLIPSE}" = "" ]; then
export UFRAME_ECLIPSE="/opt/uframe-eclipse"
fi
if [ "${BASELINE_WORKSPACE}" = "" ]; then
export BASELINE_WORKSPACE="${U_BASELINE_WORKSPACE}"
fi
EDEX_ENV="${BASELINE_WORKSPACE}/Installer.rpm/awips2.edex-environment"
/usr/bin/rpmbuild -ba --target=i386 \
--define '_topdir %(echo ${RPM_DESTINATION})' \
--define '_component_version %(echo ${COMPONENT_VERSION})' \
--define '_component_release %(echo ${COMPONENT_RELEASE})' \
--define '_build_root %(echo ${BUILD_ROOT})' \
--define '_uframe_eclipse %(echo ${UFRAME_ECLIPSE})' \
--define '_baseline_workspace %(echo ${BASELINE_WORKSPACE})' \
--buildroot ${BUILD_ROOT} \
${EDEX_ENV}/edex/component.spec
if [ $? -ne 0 ]; then
exit 1
fi
exit 0

View file

@ -1,9 +0,0 @@
#!/bin/csh
set EDEX_ENV_PATH="/awips2/edex-environment/macro"
if $?PATH then
setenv PATH ${EDEX_ENV_PATH}:$PATH
else
setenv PATH ${EDEX_ENV_PATH}
endif

View file

@ -1,10 +0,0 @@
#!/bin/bash
EDEX_ENV_PATH="/awips2/edex-environment/macro"
CHECK_PATH=`echo ${PATH} | grep ${EDEX_ENV_PATH}`
if [ ! "${CHECK_PATH}" = "" ]; then
return
fi
export PATH=${EDEX_ENV_PATH}:${PATH}

View file

@ -1,174 +0,0 @@
#!/bin/bash
# edex-environment environment
dir="/awips2/edex-environment/macro"
export EDEX_ENV_DIR="/usr/local/edex-environment"
export UTILITIES="${dir}/utilities"
# access functions
pushd . > /dev/null 2>&1
cd ${dir}/functions
for func in `ls -1`; do
source ${dir}/functions/${func}
done
popd > /dev/null 2>&1
function usage()
{
echo "Usage: edex-environment -create \${CONFIG_FILE} [--start]"
echo " edex-environment -start { \${CONFIG_FILE} | -name \${NAME} }"
echo " edex-environment -stop { \${CONFIG_FILE} | -name \${NAME} }"
echo " edex-environment -remove { \${CONFIG_FILE} | -name \${NAME} }"
echo " edex-environment --list"
}
function parseCreate()
{
# The second argument should be a configuration file.
if [ "${2}" = "" ]; then
usage
exit 0
fi
config_file="${2}"
createEnvironment "${config_file}"
if [ $? -ne 0 ]; then
exit 1
fi
# The third argument may be "--start"
if [ "${3}" = "--start" ]; then
startEnvironment "${config_file}" ""
if [ $? -ne 0 ]; then
exit 1
fi
fi
exit 0
}
function parseStart()
{
local config_file=""
local env_name=""
# The second argument could be "-name"; if not, it is a config file.
# If the second argument is "-name", the third argument is the 'name'.
if [ "${2}" = "-name" ]; then
if [ "${3}" = "" ]; then
usage
exit 0
fi
env_name="${3}"
else
if [ "${2}" = "" ]; then
usage
exit 0
fi
config_file="${2}"
fi
startEnvironment "${config_file}" "${env_name}"
if [ $? -ne 0 ]; then
exit 1
fi
exit 0
}
function parseStop()
{
local config_file=""
local env_name=""
# The second argument could be "-name"; if not, it is a config file.
# If the second argument is "-name", the third argument is the 'name'.
if [ "${2}" = "-name" ]; then
if [ "${3}" = "" ]; then
usage
exit 0
fi
env_name="${3}"
else
if [ "${2}" = "" ]; then
usage
exit 0
fi
config_file="${2}"
fi
stopEnvironment "${config_file}" "${env_name}"
if [ $? -ne 0 ]; then
exit 1
fi
exit 0
}
function parseRemove()
{
local config_file=""
local env_name=""
# The second argument could be "-name"; if not, it is a config file.
# If the second argument is "-name", the third argument is the 'name'.
if [ "${2}" = "-name" ]; then
if [ "${3}" = "" ]; then
usage
exit 0
fi
env_name="${3}"
else
if [ "${2}" = "" ]; then
usage
exit 0
fi
config_file="${2}"
fi
removeEnvironment "${config_file}" "${env_name}"
if [ $? -ne 0 ]; then
exit 1
fi
exit 0
}
if [ $# -eq 0 ]; then
usage
exit 0
fi
# The first argument should be one of: {-create, -start, -stop, -remove, --list}
if [ "${1}" = "-create" ]; then
parseCreate $*
fi
if [ "${1}" = "-start" ]; then
parseStart $*
fi
if [ "${1}" = "-stop" ]; then
parseStop $*
fi
if [ "${1}" = "-remove" ]; then
parseRemove $*
fi
if [ "${1}" = "--list" ]; then
listEnvironments
exit 0
fi
# default case:
usage
exit 0

View file

@ -1,128 +0,0 @@
#!/bin/bash
function createEnvironment()
{
# Arguments:
# ${1} configuration file.
config_file="${1}"
# Determine the name of the environment.
env_name=`/awips2/java/bin/java -jar ${UTILITIES}/ConfigurationUtility.jar "${config_file}" "-name"`
if [ $? -ne 0 ]; then
return 1
fi
# Ensure that an environment does not already exist.
if [ -d ${EDEX_ENV_DIR}/${env_name} ]; then
echo "ERROR: An edex environment with name = ${env_name} already exists."
return 1
fi
# An environment does not exist. Create it.
# 1) Create the root directory.
mkdir -p ${EDEX_ENV_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Failed to create the ${env_name} environment root directory."
return 1
fi
# 2) Create the environment by copying components in /awips2.
# /awips2/edex
cp -r /awips2/edex ${EDEX_ENV_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to place edex in the ${env_name} environment."
return 1
fi
# /awips2/GFESuite
cp -r /awips2/GFESuite ${EDEX_ENV_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to place GFESuite in the ${env_name} environment."
return 1
fi
# /awips2/database
cp -r /awips2/database ${EDEX_ENV_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to place the database in the ${env_name} environment."
return 1
fi
# /awips2/data
cp -r /awips2/data ${EDEX_ENV_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to place the database in the ${env_name} environment."
return 1
fi
# /awips2/postgresql
cp -r /awips2/postgresql ${EDEX_ENV_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to place postgresql in the ${env_name} environment."
return 1
fi
# /awips2/qpid
cp -r /awips2/qpid ${EDEX_ENV_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to place qpid in the ${env_name} environment."
return 1
fi
# 3) Update the links in: data/pg_tblspc
pushd . > /dev/null 2>&1
cd ${EDEX_ENV_DIR}/${env_name}/data/pg_tblspc
for link in `ls -1`; do
linked_dir=`readlink ${link}`
if [ $? -ne 0 ]; then
return 1
fi
data_dir=`/awips2/java/bin/java -jar ${UTILITIES}/DataLinkUtility.jar "${linked_dir}"`
if [ $? -ne 0 ]; then
return 1
fi
# Remove the existing link.
rm -f ${link}
if [ $? -ne 0 ]; then
return 1
fi
# Create a new link to the correct location.
ln -sf ${EDEX_ENV_DIR}/${env_name}/data/${data_dir} ${link}
if [ $? -ne 0 ]; then
return 1
fi
done
popd > /dev/null 2>&1
# 4) Create a directory for the environment-specific start (init.d) scripts.
mkdir -p ${EDEX_ENV_DIR}/${env_name}/edex-environment
if [ $? -ne 0 ]; then
exit 1
fi
# 5) Re-configure: Edex, QPID, and PostgreSQL
/awips2/java/bin/java -jar ${UTILITIES}/Wes2BridgeManager.jar "${config_file}"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to configure the ${env_name} environment."
return 1
fi
# 6) Adjust permissions.
chown -R awips:fxalpha ${EDEX_ENV_DIR}/${env_name}
if [ $? -ne 0 ]; then
return 1
fi
chmod -R 775 ${EDEX_ENV_DIR}/${env_name}/edex/data
if [ $? -ne 0 ]; then
return 1
fi
# 7) Lockdown the startup scripts.
chown root:root ${EDEX_ENV_DIR}/${env_name}/edex-environment/*
if [ $? -ne 0 ]; then
return 1
fi
chmod 644 ${EDEX_ENV_DIR}/${env_name}/edex-environment/*
if [ $? -ne 0 ]; then
return 1
fi
# FINISHED.
return 0
}

View file

@ -1,12 +0,0 @@
#!/bin/bash
function listEnvironments()
{
pushd . > /dev/null 2>&1
cd ${EDEX_ENV_DIR}
echo "Existing EDEX Environment(s):"
for env_dir in `ls -1`; do
echo " -${env_dir}"
done
popd > /dev/null 2>&1
}

View file

@ -1,48 +0,0 @@
#!/bin/bash
function removeEnvironment()
{
# Arguments:
# ${1} configuration file.
# ${2} name.
config_file="${1}"
env_name="${2}"
if [ ! "${config_file}" = "" ]; then
# Get the name from the configuration file.
env_name=`/awips2/java/bin/java -jar ${UTILITIES}/ConfigurationUtility.jar "${config_file}" "-name"`
if [ $? -ne 0 ]; then
return 1
fi
fi
removeEnvironmentInternal "${env_name}"
if [ $? -ne 0 ]; then
return 1
fi
return 0
}
# private
function removeEnvironmentInternal()
{
# Arguments:
# ${1} name.
env_name="${1}"
# Ensure that the environment exists.
if [ ! -d ${EDEX_ENV_DIR}/${env_name} ]; then
echo "ERROR: The ${env_name} environment does not exist yet."
return 1
fi
# Remove the environment.
rm -rf ${EDEX_ENV_DIR}/${env_name}
if [ $? -ne 0 ]; then
echo "ERROR: Unable to remove the ${env_name} environment."
return 1
fi
return 0
}

View file

@ -1,71 +0,0 @@
#!/bin/bash
function startEnvironment()
{
# Arguments:
# ${1} configuration file.
# ${2} name.
config_file="${1}"
env_name="${2}"
if [ ! "${config_file}" = "" ]; then
# Get the name from the configuration file.
env_name=`/awips2/java/bin/java -jar ${UTILITIES}/ConfigurationUtility.jar "${config_file}" "-name"`
if [ $? -ne 0 ]; then
return 1
fi
fi
startEnvironmentInternal "${env_name}"
if [ $? -ne 0 ]; then
return 1
fi
return 0
}
# private
function startEnvironmentInternal()
{
# Arguments:
# ${1} name.
env_name="${1}"
# Ensure that the environment exists.
if [ ! -d ${EDEX_ENV_DIR}/${env_name} ]; then
echo "ERROR: The ${env_name} environment does not exist yet."
return 1
fi
# Verify that the environment is not missing any startup scripts.
if [ ! -f ${EDEX_ENV_DIR}/${env_name}/edex-environment/edex_camel ]; then
echo "ERROR: The ${env_name} environment is corrupt. Recreate it."
return 1
fi
if [ ! -f ${EDEX_ENV_DIR}/${env_name}/edex-environment/edex_postgres ]; then
echo "ERROR: The ${env_name} environment is corrupt. Recreate it."
return 1
fi
if [ ! -f ${EDEX_ENV_DIR}/${env_name}/edex-environment/qpidd ]; then
echo "ERROR: The ${env_name} environment is corrupt. Recreate it."
return 1
fi
# Start the environment.
pushd . > /dev/null 2>&1
cd ${EDEX_ENV_DIR}/${env_name}/edex-environment
# Start PostgreSQL.
/bin/bash edex_postgres start
echo
sleep 10
# Start QPID.
/bin/bash qpidd start
echo
sleep 10
# Start EDEX (replace with wes mode when available).
/bin/bash edex_camel start
echo
popd > /dev/null 2>&1
return 0
}

View file

@ -1,71 +0,0 @@
#!/bin/bash
function stopEnvironment()
{
# Arguments:
# ${1} configuration file.
# ${2} name.
config_file="${1}"
env_name="${2}"
if [ ! "${config_file}" = "" ]; then
# Get the name from the configuration file.
env_name=`/awips2/java/bin/java -jar ${UTILITIES}/ConfigurationUtility.jar "${config_file}" "-name"`
if [ $? -ne 0 ]; then
return 1
fi
fi
stopEnvironmentInternal "${env_name}"
if [ $? -ne 0 ]; then
return 1
fi
return 0
}
# private
function stopEnvironmentInternal()
{
# Arguments:
# ${1} name.
env_name="${1}"
# Ensure that the environment exists.
if [ ! -d ${EDEX_ENV_DIR}/${env_name} ]; then
echo "ERROR: The ${env_name} environment does not exist yet."
return 1
fi
# Verify that the environment is not missing any startup scripts.
if [ ! -f ${EDEX_ENV_DIR}/${env_name}/edex-environment/edex_camel ]; then
echo "ERROR: The ${env_name} environment is corrupt. Recreate it."
return 1
fi
if [ ! -f ${EDEX_ENV_DIR}/${env_name}/edex-environment/edex_postgres ]; then
echo "ERROR: The ${env_name} environment is corrupt. Recreate it."
return 1
fi
if [ ! -f ${EDEX_ENV_DIR}/${env_name}/edex-environment/qpidd ]; then
echo "ERROR: The ${env_name} environment is corrupt. Recreate it."
return 1
fi
# Stop the environment.
pushd . > /dev/null 2>&1
cd ${EDEX_ENV_DIR}/${env_name}/edex-environment
# Stop EDEX.
/bin/bash edex_camel stop
echo
sleep 10
# Stop QPID.
/bin/bash qpidd stop
echo
sleep 10
# Stop PostgreSQL.
/bin/bash edex_postgres stop
echo
popd > /dev/null 2>&1
return 0
}