Skip to content

Commit

Permalink
Merge pull request #19 from rwth-acis/develop
Browse files Browse the repository at this point in the history
version v0.1.2-alpha
  • Loading branch information
hexTileX authored Jun 29, 2016
2 parents 28fb762 + c7de24b commit adaf495
Show file tree
Hide file tree
Showing 14 changed files with 412 additions and 275 deletions.
25 changes: 12 additions & 13 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
<classpathentry kind="lib" path="lib/asm-4.0.jar"/>
<classpathentry kind="lib" path="lib/asm-tree-4.0.jar"/>
<classpathentry kind="lib" path="lib/asm-util-4.0.jar"/>
<classpathentry kind="lib" path="lib/bcprov-jdk15on-1.50.jar"/>
<classpathentry kind="lib" path="lib/cglib-3.0.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.9.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.10.jar"/>
<classpathentry kind="lib" path="lib/commons-dbcp2-2.0.jar"/>
<classpathentry kind="lib" path="lib/commons-io-2.4.jar"/>
<classpathentry kind="lib" path="lib/commons-lang3-3.3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-lang3-3.3.2.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.2.jar"/>
<classpathentry kind="lib" path="lib/commons-pool2-2.2.jar"/>
<classpathentry kind="lib" path="lib/FreePastry-2.1.jar"/>
Expand All @@ -38,21 +37,21 @@
<classpathentry kind="lib" path="lib/javassist-3.18.2-GA.jar"/>
<classpathentry kind="lib" path="lib/jcip-annotations-1.0.jar"/>
<classpathentry kind="lib" path="lib/joda-time-2.2.jar"/>
<classpathentry kind="lib" path="lib/jooq-3.6.2.jar"/>
<classpathentry kind="lib" path="lib/jooq-codegen-3.6.2.jar"/>
<classpathentry kind="lib" path="lib/jooq-meta-3.6.2.jar"/>
<classpathentry kind="lib" path="lib/json-smart-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/jooq-3.8.2.jar"/>
<classpathentry kind="lib" path="lib/jooq-codegen-3.8.2.jar"/>
<classpathentry kind="lib" path="lib/jooq-meta-3.8.2.jar"/>
<classpathentry kind="lib" path="lib/json-smart-1.3.1.jar"/>
<classpathentry kind="lib" path="lib/jsr311-api-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/junit-4.11.jar"/>
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
<classpathentry kind="lib" path="lib/lang-tag-1.4.jar"/>
<classpathentry kind="lib" path="lib/las2peer-0.4.0.jar"/>
<classpathentry kind="lib" path="lib/las2peer-rest-mapper-0.4-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="lib/las2peer-web-connector-0.4-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="lib/las2peer-0.5.4.jar"/>
<classpathentry kind="lib" path="lib/las2peer-rest-mapper-0.5.4.jar"/>
<classpathentry kind="lib" path="lib/las2peer-web-connector-0.5.4.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.16.jar"/>
<classpathentry kind="lib" path="lib/mail-1.4.7.jar"/>
<classpathentry kind="lib" path="lib/mysql-connector-java-5.1.6.jar"/>
<classpathentry kind="lib" path="lib/nimbus-jose-jwt-2.26.jar"/>
<classpathentry kind="lib" path="lib/oauth2-oidc-sdk-3.3.jar"/>
<classpathentry kind="lib" path="lib/nimbus-jose-jwt-4.0.jar"/>
<classpathentry kind="lib" path="lib/oauth2-oidc-sdk-4.17.jar"/>
<classpathentry kind="lib" path="lib/org.apache.felix.bundlerepository-1.4.2.jar"/>
<classpathentry kind="lib" path="lib/org.apache.felix.framework-2.0.2.jar"/>
<classpathentry kind="lib" path="lib/org.apache.felix.main-2.0.2.jar"/>
Expand Down
17 changes: 4 additions & 13 deletions bin/start_ServiceAgentGenerator.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#! /bin/bash
#!/bin/bash

SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd ${SCRIPTDIR}/../
BASE=${PWD}
export CLASSPATH="${PWD}/lib/*"

if [[ "$#" -ne 2 ]]; then
echo "Syntax error!"
echo ""
echo "Usage: start_ServiceAgentGenerator <service.canonical.class.name> <service.password>";
else
java -cp "${CLASSPATH}" i5.las2peer.tools.ServiceAgentGenerator $1 $2
fi
# this scripts generates a xml file for the specified ServiceClass with the desired ServicePass
# pls run the script form the root folder of your deployment, e. g. ./bin/start_ServiceAgentGenerator.sh

java -cp "lib/*" i5.las2peer.tools.ServiceAgentGenerator "$@"
16 changes: 4 additions & 12 deletions bin/start_UserAgentGenerator.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
#! /bin/bash
#!/bin/bash

SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd ${SCRIPTDIR}/../
BASE=${PWD}
export CLASSPATH="${PWD}/lib/*"
# this scripts generates an user agent as xml file in order to upload it via the startup folder
# pls run the script form the root folder of your deployment, e. g. ./bin/start_UserAgentGenerator.sh

if [[ "$#" -ne 3 ]]; then
echo "Syntax error!"
echo ""
echo "Usage: start_UserAgentGenerator <user.name> <user.pass> <user.mail>";
else
java -cp "${CLASSPATH}" i5.las2peer.tools.UserAgentGenerator $2 $1 $3
fi
java -cp "lib/*" i5.las2peer.tools.UserAgentGenerator "$@"
22 changes: 13 additions & 9 deletions bin/start_network.bat
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
:: this script starts a las2peer node providing the example service of this project
:: pls execute it from the bin folder of your deployment by double-clicking on it
:: this script is autogenerated by 'ant
startscripts'
:: it starts a LAS2peer node providing the service 'de.rwth.dbis.acis.activitytracker.service.ActivityTrackerService' of this project
:: pls execute it from the bin folder of your deployment by double-clicking on it

%~d0
cd %~p0
cd ..
set BASE=%CD%
set CLASSPATH="%BASE%/lib/*;"
%~d0
cd %~p0
cd ..
set BASE=%CD%
set CLASSPATH="%BASE%/lib/*;"

java -cp %CLASSPATH% i5.las2peer.tools.L2pNodeLauncher -w -p 9012 uploadStartupDirectory('etc/startup') startService('de.rwth.dbis.acis.activitytracker.service.ActivityTrackerService','TemplateServicePass') startWebConnector interactive
pause
java -cp %CLASSPATH% i5.las2peer.tools.L2pNodeLauncher -p 9012 uploadStartupDirectory startService('de.rwth.dbis.acis.activitytracker.service.ActivityTrackerService@0.1','Passphrase') startWebConnector interactive
pause


9 changes: 6 additions & 3 deletions bin/start_network.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

# this script starts a las2peer node providing the example service of this project
# pls execute it from the root folder of your deployment, e. g. ./bin/start_network.sh
# this script is autogenerated by 'ant startscripts'
# it starts a LAS2peer node providing the service 'de.rwth.dbis.acis.activitytracker.service.ActivityTrackerService' of this project
# pls execute it from the root folder of your deployment, e. g. ./bin/start_network.sh

java -cp "lib/*" i5.las2peer.tools.L2pNodeLauncher -p 9011 uploadStartupDirectory\(\'etc/startup\'\) startService\(\'de.rwth.dbis.acis.activitytracker.service.ActivityTrackerService\',\'TemplateServicePass\'\) startWebConnector interactive
java -cp "lib/*" i5.las2peer.tools.L2pNodeLauncher -p 9012 uploadStartupDirectory startService\(\'de.rwth.dbis.acis.activitytracker.service.ActivityTrackerService@0.1\',\'Passphrase\'\) startWebConnector interactive


143 changes: 110 additions & 33 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<project name="LAS2peer-ActivityTracker" default="all" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<project name="las2peer-ActivityTracker" default="all" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">

<property file="etc/ant_configuration/user.properties"/>
<property file="etc/ant_configuration/service.properties"/>

<property name="startup" location="etc/startup"/>

<presetdef name="javac">
<javac includeantruntime="false"/>
</presetdef>
<property name="service_agent.path" value="${startup}/${service.name}.${service.class}.xml"/>
<property name="user_agent1.path" value="${startup}/agent-user-${las2peer_user1.name}.xml"/>
<property name="user_agent2.path" value="${startup}/agent-user-${las2peer_user2.name}.xml"/>
<property name="user_agent3.path" value="${startup}/agent-user-${las2peer_user3.name}.xml"/>
<property name="passphrases.path" value="${startup}/passphrases.txt"/>

<property name="src.main" location="src/main"/>
<property name="src.junit" location="src/test"/>
Expand All @@ -31,13 +33,17 @@
<include name="**/*.jar"/>
<exclude name="junit-*.jar"/>
</fileset>
<fileset dir="${service}">
<include name="**/*.jar"/>
<exclude name="i5.las2peer.services.*.jar"/>
</fileset>
</path>

<property name="lib.junit" location="${lib}/junit-4.11.jar"/>
<property name="lib.junit" location="${lib}/junit-4.12.jar"/>


<!-- Ivy Installation (Tool to fetch Libraries) -->
<property name="ivy.install.version" value="2.3.0"/>
<property name="ivy.install.version" value="2.4.0"/>
<property name="ivy.jar.dir" value="${basedir}/etc/ivy"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<property name="ivy.settings.file" value="${ivy.jar.dir}/ivysettings.xml"/>
Expand All @@ -59,24 +65,30 @@


<!-- Get Dependencies from our Maven Repository via Ivy -->
<target name="get_deps" depends="install-ivy" description="--> resolve dependencies">
<target name="get_deps" depends="install-ivy, init_deps" description="--> resolve dependencies">
<ivy:settings>
<credentials host="role.dbis.rwth-aachen.de:9911/archiva" realm="Repository internal"/>
</ivy:settings>
<ivy:retrieve type="jar, bundle"/>
<ivy:retrieve type="jar, bundle" conf="platform" pattern="${lib}/[artifact]-[revision].[ext]"/>
<ivy:retrieve type="jar, bundle" conf="bundle" pattern="${service}/[artifact]-[revision].[ext]"/>
</target>


<!-- Initialization (Folder Creation)-->
<target name="init_general" depends="clean_before_build">
<target name="init_deps">
<mkdir dir="${lib}"/>
<mkdir dir="${service}"/>
</target>

<target name="init_general">
<tstamp/>
<mkdir dir="${tmp}"/>
<mkdir dir="${export}"/>
<mkdir dir="${startup}"/>
<mkdir dir="${log}"/>
</target>

<target name="init_compile" depends="init_general, get_deps">
<target name="init_compile" depends="init_general">
<mkdir dir="${tmp.classes}"/>
<mkdir dir="${tmp.junit}"/>
</target>
Expand All @@ -97,7 +109,8 @@
classpathref="libraries"
debug="on"
encoding="UTF-8"
/>
includeantruntime="false"
/>
<copy todir="${tmp.classes}">
<fileset dir="${src.main}">
<include name="**/*.xml"/>
Expand All @@ -112,7 +125,8 @@
classpathref="libraries"
debug="on"
encoding="UTF-8"
/>
includeantruntime="false"
/>
<copy todir="${tmp.junit}">
<fileset dir="${src.junit}">
<include name="**/*.xml"/>
Expand All @@ -122,14 +136,43 @@

<target name="compile_all" depends="compile_main, compile_junit"/>

<!-- Generate start scripts -->
<target name="startscripts" description="generate start scripts for Windows and Unix">
<mkdir dir="${basedir}/bin"/>
<echo file="${basedir}/bin/start_network.sh" append="false">#!/bin/bash

# this script is autogenerated by 'ant startscripts'
# it starts a LAS2peer node providing the service '${service.name}.${service.class}' of this project
# pls execute it from the root folder of your deployment, e. g. ./bin/start_network.sh

java -cp "lib/*" i5.las2peer.tools.L2pNodeLauncher -p 9012 uploadStartupDirectory startService\(\'${service.name}.${service.class}@${service.version}\',\'${service.passphrase}\'\) startWebConnector interactive

</echo>
<echo file="${basedir}/bin/start_network.bat" append="false">:: this script is autogenerated by 'ant
startscripts'
:: it starts a LAS2peer node providing the service '${service.name}.${service.class}' of this project
:: pls execute it from the bin folder of your deployment by double-clicking on it

%~d0
cd %~p0
cd ..
set BASE=%CD%
set CLASSPATH="%BASE%/lib/*;"

java -cp %CLASSPATH% i5.las2peer.tools.L2pNodeLauncher -p 9012 uploadStartupDirectory startService('${service.name}.${service.class}@${service.version}','${service.passphrase}') startWebConnector interactive
pause

</echo>
</target>

<!-- Generate Jars -->
<target name="jar" depends="compile_main" description="--> jar">
<target name="jar" description="--> jar">
<jar jarfile="${export.jars}/${service.name}-${service.version}.jar">
<fileset dir="${tmp.classes}" includes="${service.path}/**"/>
<manifest>
<attribute name="Library-Version" value="${service.version}"/>
<attribute name="Library-SymbolicName" value="${service.name}"/>
<attribute name="Import-Library" value="${service.dependencies}"/>
</manifest>
</jar>
<!-- Add the same Jar to the Service Directory !-->
Expand All @@ -138,26 +181,27 @@
<manifest>
<attribute name="Library-Version" value="${service.version}"/>
<attribute name="Library-SymbolicName" value="${service.name}"/>
<attribute name="Import-Library" value="${service.dependencies}"/>
</manifest>
</jar>
</target>


<!-- Generate Documentation -->
<target name="java_doc" depends="init_doc">
<target name="javadoc" depends="init_doc">
<javadoc destdir="${export.doc}"
author="true"
version="true"
use="true"
source="1.7"
source="1.8"
windowtitle="Service Documentation"
failonerror="yes"
encoding="utf8"
classpath="${tmp.classes}"
classpathref="libraries"
>
>
<packageset dir="${src.main}" defaultexcludes="yes">
<include name="i5/las2peer/**"/>
<include name="de/rwth/**"/>
</packageset>
</javadoc>
</target>
Expand Down Expand Up @@ -193,34 +237,67 @@


<!-- XML Agent Generation (Builds Jar first so that Generator is available)-->
<available file="${service_agent.path}" property="service_agent_exists"/>
<available file="${user_agent1.path}" property="user_agent_exists1"/>
<available file="${user_agent2.path}" property="user_agent_exists2"/>
<available file="${user_agent3.path}" property="user_agent_exists3"/>

<target name="generate_service_agent" depends="jar" unless="service_agent_exists">
<echo message="Writing Service Agent xml to ${service_agent.path}"/>
<java classname="i5.las2peer.tools.ServiceAgentGenerator" classpathref="libraries"
failonerror="true" fork="true" output="${service_agent.path}">
<arg line="'${service.name}.${service.class}@${service.version}' '${service.passphrase}'"/>
</java>
</target>
<target name="generate_user_agent1" depends="jar" unless="user_agent_exists1">
<echo message="Writing User Agent xml to ${user_agent1.path}"/>
<java classname="i5.las2peer.tools.UserAgentGenerator" classpathref="libraries"
failonerror="true" fork="true" output="${user_agent1.path}">
<arg line="'${las2peer_user1.password}' '${las2peer_user1.name}' '${las2peer_user1.email}'"/>
</java>
</target>
<target name="generate_user_agent2" depends="jar" unless="user_agent_exists2">
<echo message="Writing User Agent xml to ${user_agent2.path}"/>
<java classname="i5.las2peer.tools.UserAgentGenerator" classpathref="libraries"
failonerror="true" fork="true" output="${user_agent2.path}">
<arg line="'${las2peer_user2.password}' '${las2peer_user2.name}' '${las2peer_user2.email}'"/>
</java>
</target>
<target name="generate_user_agent3" depends="jar" unless="user_agent_exists3">
<echo message="Writing User Agent xml to ${user_agent3.path}"/>
<java classname="i5.las2peer.tools.UserAgentGenerator" classpathref="libraries"
failonerror="true" fork="true" output="${user_agent3.path}">
<arg line="'${las2peer_user3.password}' '${las2peer_user3.name}' '${las2peer_user3.email}'"/>
</java>
</target>

<target name="generate_configs" depends="jar">
<target name="generate_agents" depends="generate_service_agent, generate_user_agent1, generate_user_agent2, generate_user_agent3"
description="--> generate example user agents">
<echo file="${passphrases.path}" append="false">agent-user-${las2peer_user1.name}.xml;${las2peer_user1.password}
agent-user-${las2peer_user2.name}.xml;${las2peer_user2.password}
agent-user-${las2peer_user3.name}.xml;${las2peer_user3.password}
</echo>
</target>


<!-- General Cleanup -->
<target name="clean_before_build">
<delete dir="${export}"/>
<delete file="${service}/${service.name}-${service.version}.jar"/>
</target>

<target name="clean_after_build">
<target name="clean" description="--> clean">
<delete dir="${tmp}"/>
</target>

<target name="clean_deps" description="--> remove all dependencies">
<delete dir="${export}"/>
<delete dir="${lib}"/>
<delete dir="${service}"/>
</target>

<target name="clean_all" depends="clean_after_build, clean_before_build, clean_deps">
<target name="clean_all" depends="clean" description="--> clean all data">
<delete dir="${log}"/>
<delete dir="node-storage"/>
</target>

<target name="all" depends="clean_before_build, generate_configs, junit, java_doc, clean_after_build"/>
<target name="all" depends="clean_all, get_deps, compile_main, jar, startscripts, generate_agents"/>


<!-- Run -->
<target name="run" depends="jar">
<!-- Run degbug -->
<target name="debug" depends="compile_main, jar">
<java classname="i5.las2peer.tools.L2pNodeLauncher"
classpathref="libraries"
failonerror="true"
Expand All @@ -231,9 +308,9 @@
<arg value='-p'/>
<arg value='9012'/>
<arg value='uploadStartupDirectory(\"etc/startup\")'/>
<arg value='startService(\"de.rwth.dbis.acis.activitytracker.service.ActivityTrackerService\",\"SampleServicePass\")'/>
<arg value='startService(\"de.rwth.dbis.acis.activitytracker.service.ActivityTrackerService@0.1\",\"SampleServicePass\")'/>
<arg value='startWebConnector'/>
</java>
</target>

</project>
</project>
Loading

0 comments on commit adaf495

Please sign in to comment.