diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 00000000..34b06b5d
Binary files /dev/null and b/.DS_Store differ
diff --git a/.gitignore b/.gitignore
index 486efd97..22aa8f55 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,8 +20,11 @@ src/main/javascript/client/SXP*
/logs/
/simpleDb/
src/main/js/SXP-linux-x64/
+src/main/js/SXP-darwin-x64/
src/main/js/node_modules/
certConfig.conf
keystore.jks
.cache*
derby.log
+SXP.iml
+/.idea/
\ No newline at end of file
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7b1b2593..aac59de3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -51,7 +51,10 @@ tests:
except:
- master
-
+ deploy:
+ stage: deploy
+ script:
+ - ./deploy
#selenium:
# stage: test
# image: selenium/standalone-firefox
diff --git a/README.md b/README.md
index 7b255a98..3d86828b 100644
--- a/README.md
+++ b/README.md
@@ -1,52 +1,14 @@
-# Secure Exchange Protocols (SXP)
+This is the wiki of the project **ContractSXP**.
-Below is a description of the idea behind the SXP project. For technical details the reader should refer to the wiki on github.
-* SXP protocol wiki: https://pja35.github.io/SXP/wiki/.
-* SXP code wiki https://github.com/pja35/SXP/wiki/.
+If you need more details, please refer to the SXP wiki: [https://pja35.github.io/SXP/wiki/](https://pja35.github.io/SXP/wiki/) or the code wiki: [https://github.com/pja35/SXP/wiki/.](https://github.com/pja35/SXP/wiki/.)
-## Philosophy
+* [Installation](https://github.com/GiInfo/SXP/wiki/Installation)
+* [User Manual](https://github.com/GiInfo/SXP/wiki/User-Manual)
+* The project and what we did:
-Centralized and free services have counterparts: *Google*, *Facebook*, *Amazon*... are watching you. They scan your browsing to exploit your datas. "If it is free, then you are the product" is now a famous adage related to such services. Our technological era allows us to easily connect to each other. Why not build our self-managed services in peer-to-peer? [1]
-
-[1] https://www.gnu.org/philosophy/who-does-that-server-really-serve.en.html
-
-This is a project to create an open, ubiquitous, peer-to-peer, secure protocol suite for multi-party exchanges of contracts.
-
-The idea is that any of us can join together and create a virtual market, in which others can tell what they have to offer and what they need. The market, or anyone for that matter, can propose deals, whereby one person would give an item to another who gives an item to a third etc. If all parties concerned agree to a deal, the deal gets secured into an electronic contract, signed by the different parties.
-
-More precisely, say Alice, Bob, and Charlie have access to different resources a, b, and c. Say Alice wants b, Bob wants c and Charlie wants a, but they do not know each other, nor do they trust each other. Here a, b and c can be anything, e.g a the ability to give maths lessons, b some barrel of beer, and c coins from a certain currency. Finally, say Alice, Bob and Charlie have an iPhone, Android, or whatever smart phone in their pockets. Using Secure eXchange Protocols on their smart phones, they should be able to quickly declare their resources and needs on virtual ad hoc markets, which in turn should detect and propose the obvious deal between them. If the three of them accept the deal, then an electronic contract will be secured, which is a formal proof of their agreement to perform the swap.
-
-## In brief
-
-Most of websites bringing users together rely on common principles:
-* account creation on a server,
-* publication and search of announcements,
-* connect users,
-and differ only according to the market they hold: *Airbnb* (housing), *Drivy* (cars), etc. Despite this common basis, each company develops its own software solution. The SXP project aims at offering this shared core features, and imposing it via open source diffusion, on the one hand. On the other hand, SXP decides to implement these services on **peer-to-peer**, i.e. it gets rid of the centralized server maintaining accounts and announcements. This, in a:
-* secure ("if I use an official version of the SXP client, then my datas are safe and my identity preserved, even if other users are malicious modify their SXP client"),
-* resilient ("if I shutdown or even lost my computer or smartphone, my accounts continue to exists on the network, and I continue to receive messages, that I will be able to read from a new machine"),
-* transparent ("As the source code is open and executed by me, I know exactly what the system does, and I can contribute to its enhancement").
-These choices reassure users and allow economic actors to open new markets via a simple adaptation of the SXP client, without infrastructure cost.
-
-## Contract signing
-
-When two users, say Alice and Bob, agree on a contract C, they have to sign this contract: Alice wants C signed by B and Bob wants C signed by Alice. But who is about to sign first? In real life they meet and sign simultaneously. On a network this is not possible. Yet, if Alice commits first she runs the risk of never receiving Bob\'92s counterpart, whereas he can benefit from what she gave in.
-
-The traditional solution relies on a trusted third party, Trent, acting as an intermediate to which Alice and Bob each send the contract with their signature. In SXP, this solution consists in offering centralized services in order to secure an exchange -- this is a possible economic model for the project.
-
-Nevertheless, there exist "optimistic" contract signing protocols, that call Trent only if there is a conflict between Alice and Bob -- i.e. as a referee rather than as an intermediate. SXP implements such a protocol. An additional step would be to replace a single Trent with a set of random peers -- i.e. to replace the referee with a jury. It seems possible though still at a research stage. In technical terms, our idea is basically to merge two great works in order to fit our needs: publicly verifiable secret sharing [1] and optimistic fair exchange protocols [2,3].
-
-[1] Markus Stadler, Publicly Verifiable Secret Sharing.
-[2] Schunter Asokan, Review of optimistic fair exchange.
-[3] Gildas Avoine and Serge Vaudenay, Optimistic Fair Exchange Based on Publicly Verifiable Secret Sharing.
-
-## Comparison to existing services
-
-* Some free CMS, such as *Wordpress*, ease the creation of online shops. None offers a complete solution to bring users together. None offers a decentralize solution.
-* *Bitcoin* is a virtual currency in P2P. It is actually one big shared ledger book, with mechanisms enforcing consensus of users on its content, and in which writing "Alice gives 10B$ to Bob" signed by Alice is equivalent to effectively doing it. This technology has drawbacks: the ledger book is growing huge (13Go in Jan. 2014, 50Go in Dec. 2015), and the enormous consumption of computational power and energy needed for consensus mechanisms. Compared to SXP, *Bitcoin* does not allow diffusion and search of announcements, but offers a payment system that may be seen as complementary.
-* *Diaspora* is a social network in P2P, that does not implement any cryptography yet.
-
-## Status
-
-SXP is now at a prototype stage. In particular, it has a rudimentary user interface. But main functionalities of account creation, announcement publication, announcement search, resilience of accounts and datas, confidentiality, are implemented, as well as a first version of optimistic contract signing.
+ * Definition of a Contract
+ * [Multi-user chat and Contract chat](https://github.com/GiInfo/SXP/wiki/Multi-user-chat-and-Contract-chat)
+ * [Making users aware of the status of a contract](https://github.com/GiInfo/SXP/wiki/Making-users-aware-of-the-status-of-a-contract)
+ * [Small contributions here and there](https://github.com/GiInfo/SXP/wiki/Small-contributions-here-and-there)
+* [What else can be done](https://github.com/GiInfo/SXP/wiki/What-else-can-be-done)
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 7f8cd6e7..5dc0fd1a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -10,23 +10,23 @@ jacoco {
//Adding Google java format and sonar pluggins for jdk >= 8
buildscript {
- repositories {
- maven {
- url "https://plugins.gradle.org/m2/"
+ repositories {
+ maven {
+ url "https://plugins.gradle.org/m2/"
+ }
+ }
+ dependencies {
+ //classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.3.2"
+ if (JavaVersion.current() >= JavaVersion.VERSION_1_8) {
+ classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.1"
+ }
+ classpath "com.netflix.nebula:nebula-ospackage-plugin:3.+"
}
- }
- dependencies {
- //classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.3.2"
- if(JavaVersion.current()>= JavaVersion.VERSION_1_8){
- classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.1"
- }
- classpath "com.netflix.nebula:nebula-ospackage-plugin:3.+"
- }
}
//apply plugin: "com.github.sherter.google-java-format"
-if(JavaVersion.current()>= JavaVersion.VERSION_1_8){
- apply plugin: "org.sonarqube"
+if (JavaVersion.current() >= JavaVersion.VERSION_1_8) {
+ apply plugin: "org.sonarqube"
}
@@ -37,15 +37,17 @@ targetCompatibility = 1.7
repositories {
mavenCentral()
maven {
+
url 'http://www.janus-project.org/maven'
url uri('libs')
+
}
}
jar {
- manifest {
- attributes 'Implementation-Title': 'SXP network',
- 'Implementation-Version': 1.0
- }
+ manifest {
+ attributes 'Implementation-Title': 'SXP network',
+ 'Implementation-Version': 1.0
+ }
}
sourceSets.main.resources.srcDirs += ["src/main/resources"]
@@ -57,15 +59,15 @@ configurations {
}
//Define selenium sources and resources
-sourceSets {
- selenium {
+sourceSets {
+ selenium {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/selenium/java')
}
resources.srcDir file('src/selenium/resources')
- }
+ }
}
//selenium task
@@ -75,28 +77,28 @@ task selenium(type: Test) {
testClassesDir = sourceSets.selenium.output.classesDir
classpath = sourceSets.selenium.runtimeClasspath
outputs.upToDateWhen { false }
- // jvmArgs ""
+ // jvmArgs ""
}
-test{
- //exclude 'model/syncManager/**'
- //exclude 'controller/**'
- //exclude 'crypt/**'
- //exclude 'model/entity/**'
- //exclude 'model/validator/**'
- //exclude 'network/**'
- //exclude 'protocol/**'
- //exclude 'rest/**'
- //exclude 'util/**'
-
- testLogging {
- showStandardStreams = false
- showExceptions = false
- showStackTraces = false
- }
-
-
- if (System.getProperty('DEBUG', 'false') == 'true') {
+test {
+ //exclude 'model/syncManager/**'
+ //exclude 'controller/**'
+ //exclude 'crypt/**'
+ //exclude 'model/entity/**'
+ //exclude 'model/validator/**'
+ //exclude 'network/**'
+ //exclude 'protocol/**'
+ //exclude 'rest/**'
+ //exclude 'util/**'
+
+ testLogging {
+ showStandardStreams = false
+ showExceptions = false
+ showStackTraces = false
+ }
+
+
+ if (System.getProperty('DEBUG', 'false') == 'true') {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5006'
}
}
@@ -130,52 +132,53 @@ tasks.withType(Test) {
}
dependencies {
-
- compile 'org.hibernate:hibernate-validator:5.2.4.Final'
-
- compile 'org.apache.logging.log4j:log4j-api:2.1'
- compile 'org.apache.logging.log4j:log4j-core:2.1'
- compile 'org.apache.logging.log4j:log4j-1.2-api:2.1'
- compile 'org.apache.logging.log4j:log4j-web:2.5'
-
- compile 'org.eclipse.jetty:jetty-server:9.2+'
- compile 'org.eclipse.jetty:jetty-servlet:9.2+'
- compile 'org.eclipse.jetty:jetty-webapp:9.3+'
+
+ compile 'org.hibernate:hibernate-validator:5.2.4.Final'
+
+ compile 'org.apache.logging.log4j:log4j-api:2.1'
+ compile 'org.apache.logging.log4j:log4j-core:2.1'
+ compile 'org.apache.logging.log4j:log4j-1.2-api:2.1'
+ compile 'org.apache.logging.log4j:log4j-web:2.5'
+
+ compile 'org.eclipse.jetty:jetty-server:9.2+'
+ compile 'org.eclipse.jetty:jetty-servlet:9.2+'
+ compile 'org.eclipse.jetty:jetty-webapp:9.3+'
compile 'org.eclipse.jetty:jetty-util:9.2+'
- //compile 'org.eclipse.jetty:apache-jsp:9.2+'
- //compile 'org.eclipse.jetty:apache-jstl:9.2+'
-
- compile 'org.apache.commons:commons-collections4:4.0'
-
- compile 'org.glassfish.jersey.core:jersey-server:2.7'
- compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.7'
- compile 'org.glassfish.jersey.containers:jersey-container-servlet-core:2.7'
- compile 'org.glassfish.jersey.containers:jersey-container-jetty-http:2.7'
- compile 'org.glassfish.jersey.media:jersey-media-moxy:2.7'
- compile 'javax:javaee-api:7.0'
- compile 'org.apache.derby:derby:10.12.1.1'
- compile 'org.eclipse.persistence:eclipselink:2.6.3-M1'
- compile 'org.eclipse.persistence:javax.persistence:2.1.1'
- compile 'com.fasterxml.jackson.core:jackson-databind:2.6.3'
- compile fileTree(dir: './libs', include: '*.jar')
- compile ('com.kenai.jxse:jxse:2.7')
- {
- // org.jboss.netty has moved to io.netty
- exclude group: 'org.jboss.netty', module: 'httptunnel'
- }
- compile 'org.jdom:jdom2:2.0.6'
- compile 'com.google.guava:guava:19.0'
- compile 'org.shredzone.acme4j:acme4j-utils:0.8'
- compile 'com.fasterxml.jackson.core:jackson-databind:2.6.3'
-
- compile 'org.hibernate:hibernate-validator:5.3.3.Final'
- compile 'javax.el:javax.el-api:2.2.4'
- compile 'org.glassfish.web:javax.el:2.2.4'
-
-
- testCompile 'org.apache.commons:commons-lang3:3.1'
- testCompile fileTree(dir: './libs', include: 'loremipsum-1.0.jar')
- testCompile group: 'junit', name: 'junit', version: '4.+'
+ //compile 'org.eclipse.jetty:apache-jsp:9.2+'
+ //compile 'org.eclipse.jetty:apache-jstl:9.2+'
+
+ compile 'org.apache.commons:commons-collections4:4.0'
+
+ compile 'org.glassfish.jersey.core:jersey-server:2.7'
+ compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.7'
+ compile 'org.glassfish.jersey.containers:jersey-container-servlet-core:2.7'
+ compile 'org.glassfish.jersey.containers:jersey-container-jetty-http:2.7'
+ compile 'org.glassfish.jersey.media:jersey-media-moxy:2.7'
+ compile 'javax:javaee-api:7.0'
+ compile 'org.apache.derby:derby:10.12.1.1'
+ compile 'org.eclipse.persistence:eclipselink:2.6.3-M1'
+ compile 'org.eclipse.persistence:javax.persistence:2.1.1'
+ compile 'com.fasterxml.jackson.core:jackson-databind:2.6.3'
+ compile 'io.netty:netty-all:4.0.24.Final'
+ compile('com.kenai.jxse:jxse:2.7') {
+ exclude group: 'org.jboss.netty', module: 'httptunnel'
+
+ }
+ compile 'org.jdom:jdom2:2.0.6'
+ compile fileTree(dir: './libs', include: '*.jar')
+ compile 'com.google.guava:guava:19.0'
+ compile 'org.shredzone.acme4j:acme4j-utils:0.8'
+ compile 'com.fasterxml.jackson.core:jackson-databind:2.6.3'
+
+ compile 'org.hibernate:hibernate-validator:5.3.3.Final'
+ compile 'javax.el:javax.el-api:2.2.4'
+ compile 'org.glassfish.web:javax.el:2.2.4'
+
+
+ testCompile 'org.apache.commons:commons-lang3:3.1'
+ testCompile fileTree(dir: './libs', include: 'loremipsum-1.0.jar')
+ testCompile group: 'junit', name: 'junit', version: '4.+'
+
testCompile group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.16.0'
testCompile group: 'org.json', name: 'json', version: '20160810'
seleniumCompile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.0.1'
@@ -184,20 +187,19 @@ dependencies {
configurations.all {
exclude group: "log4j", module: "log4j"
}
-
[compileJava, compileTestJava]*.options.collect {options ->
options.encoding = 'UTF-8'}
eclipse {
- classpath {
- downloadSources = true
- downloadJavadoc = true
- }
+ classpath {
+ downloadSources = true
+ downloadJavadoc = true
+ }
}
//Copy dependencies in the libs directory
task libs(type: Sync) {
- from configurations.compile
+ from configurations.compile
//from configurations.runtime
from configurations.testCompile
from configurations.seleniumCompile
diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html
index 2268bec0..925a4de9 100644
--- a/docs/_layouts/default.html
+++ b/docs/_layouts/default.html
@@ -1,63 +1,73 @@
-
+
-
+
-
+
-
+
{{ site.title | default: site.github.repository_name }}
-
-
-
- securely exchange anything, anywhere, with anyone.
-
-
-
-
-
-
+
+
+
+securely exchange anything, anywhere, with anyone.
+
+
+
+
+
+
-
+
+
-
-
+
+{% if site.google_analytics %}
+
+{% endif %}
+
diff --git a/docs/_layouts/tagpage.html b/docs/_layouts/tagpage.html
index c64d2f57..bce0bfd9 100644
--- a/docs/_layouts/tagpage.html
+++ b/docs/_layouts/tagpage.html
@@ -3,18 +3,18 @@
---
-
{{ page.title }}
- {{ content }}
+
{{ page.title }}
+ {{ content }}
-
- {% for p in site.pages %}
- {% for tag in p.tags %}
+
+ {% for p in site.pages %}
+ {% for tag in p.tags %}
{% if tag == page.tag %}
-
+
{{ p.title }}
-
+
{% endif %}
- {% endfor %}
- {% endfor %}
-
+ {% endfor %}
+ {% endfor %}
+
diff --git a/docs/_layouts/wiki.html b/docs/_layouts/wiki.html
index 5ba82cc0..5a6811b3 100644
--- a/docs/_layouts/wiki.html
+++ b/docs/_layouts/wiki.html
@@ -3,9 +3,12 @@
---
-
- {% for tag in page.tags %}{{ tag }} {% endfor %}
-
-
-
{{ page.title }}
- {{ content }}
+
+
+
+
+
{{ page.title }}
+ {{ content }}
diff --git a/docs/images/sxp.svg b/docs/images/sxp.svg
index c4a45fc9..8def9d51 100644
--- a/docs/images/sxp.svg
+++ b/docs/images/sxp.svg
@@ -1,7 +1,7 @@
-
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 3391a4cd..be1189c1 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index e1714424..f413c044 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue Jul 12 11:30:16 CEST 2016
+#Sun Nov 19 19:20:42 CET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-rc-2-bin.zip
diff --git a/gradlew b/gradlew
index 9d82f789..4453ccea 100755
--- a/gradlew
+++ b/gradlew
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
##############################################################################
##
@@ -6,12 +6,30 @@
##
##############################################################################
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
+nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
@@ -40,26 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
+ NONSTOP* )
+ nonstop=true
+ ;;
esac
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -85,7 +89,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -150,11 +154,19 @@ if $cygwin ; then
esac
fi
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
+# Escape application args
+save ( ) {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index aec99730..e95643d6 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail
:init
-@rem Get command-line arguments, handling Windowz variants
+@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
diff --git a/libs/.DS_Store b/libs/.DS_Store
new file mode 100644
index 00000000..d5b49515
Binary files /dev/null and b/libs/.DS_Store differ
diff --git a/libs/netty-3.1.5.GA.jar b/libs/netty-3.1.5.GA.jar
new file mode 100644
index 00000000..3729ddd0
Binary files /dev/null and b/libs/netty-3.1.5.GA.jar differ
diff --git a/out/.DS_Store b/out/.DS_Store
new file mode 100644
index 00000000..6e0151d2
Binary files /dev/null and b/out/.DS_Store differ
diff --git a/out/production/.DS_Store b/out/production/.DS_Store
new file mode 100644
index 00000000..0efabae5
Binary files /dev/null and b/out/production/.DS_Store differ
diff --git a/out/production/classes/controller/Application.class b/out/production/classes/controller/Application.class
new file mode 100644
index 00000000..56c627b2
Binary files /dev/null and b/out/production/classes/controller/Application.class differ
diff --git a/out/production/classes/controller/CASingingRequest.class b/out/production/classes/controller/CASingingRequest.class
new file mode 100644
index 00000000..f449233f
Binary files /dev/null and b/out/production/classes/controller/CASingingRequest.class differ
diff --git a/out/production/classes/controller/Contracts$1.class b/out/production/classes/controller/Contracts$1.class
new file mode 100644
index 00000000..a80681fb
Binary files /dev/null and b/out/production/classes/controller/Contracts$1.class differ
diff --git a/out/production/classes/controller/Contracts$2.class b/out/production/classes/controller/Contracts$2.class
new file mode 100644
index 00000000..219d80f1
Binary files /dev/null and b/out/production/classes/controller/Contracts$2.class differ
diff --git a/out/production/classes/controller/Contracts$3.class b/out/production/classes/controller/Contracts$3.class
new file mode 100644
index 00000000..d72ec7c9
Binary files /dev/null and b/out/production/classes/controller/Contracts$3.class differ
diff --git a/out/production/classes/controller/Contracts$4.class b/out/production/classes/controller/Contracts$4.class
new file mode 100644
index 00000000..fd6a9363
Binary files /dev/null and b/out/production/classes/controller/Contracts$4.class differ
diff --git a/out/production/classes/controller/Contracts$5.class b/out/production/classes/controller/Contracts$5.class
new file mode 100644
index 00000000..3aa19653
Binary files /dev/null and b/out/production/classes/controller/Contracts$5.class differ
diff --git a/out/production/classes/controller/Contracts$6.class b/out/production/classes/controller/Contracts$6.class
new file mode 100644
index 00000000..7f69129b
Binary files /dev/null and b/out/production/classes/controller/Contracts$6.class differ
diff --git a/out/production/classes/controller/Contracts$7.class b/out/production/classes/controller/Contracts$7.class
new file mode 100644
index 00000000..e80bbc5f
Binary files /dev/null and b/out/production/classes/controller/Contracts$7.class differ
diff --git a/out/production/classes/controller/Contracts.class b/out/production/classes/controller/Contracts.class
new file mode 100644
index 00000000..df85178a
Binary files /dev/null and b/out/production/classes/controller/Contracts.class differ
diff --git a/out/production/classes/controller/CryptCommander.class b/out/production/classes/controller/CryptCommander.class
new file mode 100644
index 00000000..1ee7a75b
Binary files /dev/null and b/out/production/classes/controller/CryptCommander.class differ
diff --git a/out/production/classes/controller/Items$1.class b/out/production/classes/controller/Items$1.class
new file mode 100644
index 00000000..5dc9dd8d
Binary files /dev/null and b/out/production/classes/controller/Items$1.class differ
diff --git a/out/production/classes/controller/Items$2.class b/out/production/classes/controller/Items$2.class
new file mode 100644
index 00000000..0689c4cb
Binary files /dev/null and b/out/production/classes/controller/Items$2.class differ
diff --git a/out/production/classes/controller/Items$3.class b/out/production/classes/controller/Items$3.class
new file mode 100644
index 00000000..38bec324
Binary files /dev/null and b/out/production/classes/controller/Items$3.class differ
diff --git a/out/production/classes/controller/Items$4.class b/out/production/classes/controller/Items$4.class
new file mode 100644
index 00000000..266cf045
Binary files /dev/null and b/out/production/classes/controller/Items$4.class differ
diff --git a/out/production/classes/controller/Items.class b/out/production/classes/controller/Items.class
new file mode 100644
index 00000000..2aa3c6b3
Binary files /dev/null and b/out/production/classes/controller/Items.class differ
diff --git a/out/production/classes/controller/Messages$1$1.class b/out/production/classes/controller/Messages$1$1.class
new file mode 100644
index 00000000..0b84fc26
Binary files /dev/null and b/out/production/classes/controller/Messages$1$1.class differ
diff --git a/out/production/classes/controller/Messages$1$2.class b/out/production/classes/controller/Messages$1$2.class
new file mode 100644
index 00000000..379dd993
Binary files /dev/null and b/out/production/classes/controller/Messages$1$2.class differ
diff --git a/out/production/classes/controller/Messages$1.class b/out/production/classes/controller/Messages$1.class
new file mode 100644
index 00000000..201d78bd
Binary files /dev/null and b/out/production/classes/controller/Messages$1.class differ
diff --git a/out/production/classes/controller/Messages$2$1.class b/out/production/classes/controller/Messages$2$1.class
new file mode 100644
index 00000000..62281fe9
Binary files /dev/null and b/out/production/classes/controller/Messages$2$1.class differ
diff --git a/out/production/classes/controller/Messages$2$2.class b/out/production/classes/controller/Messages$2$2.class
new file mode 100644
index 00000000..66ed4413
Binary files /dev/null and b/out/production/classes/controller/Messages$2$2.class differ
diff --git a/out/production/classes/controller/Messages$2$3.class b/out/production/classes/controller/Messages$2$3.class
new file mode 100644
index 00000000..68c33e53
Binary files /dev/null and b/out/production/classes/controller/Messages$2$3.class differ
diff --git a/out/production/classes/controller/Messages$2.class b/out/production/classes/controller/Messages$2.class
new file mode 100644
index 00000000..56314158
Binary files /dev/null and b/out/production/classes/controller/Messages$2.class differ
diff --git a/out/production/classes/controller/Messages.class b/out/production/classes/controller/Messages.class
new file mode 100644
index 00000000..5fa9ee78
Binary files /dev/null and b/out/production/classes/controller/Messages.class differ
diff --git a/out/production/classes/controller/Search$1$1$1.class b/out/production/classes/controller/Search$1$1$1.class
new file mode 100644
index 00000000..e4ab7061
Binary files /dev/null and b/out/production/classes/controller/Search$1$1$1.class differ
diff --git a/out/production/classes/controller/Search$1$1.class b/out/production/classes/controller/Search$1$1.class
new file mode 100644
index 00000000..b6e60159
Binary files /dev/null and b/out/production/classes/controller/Search$1$1.class differ
diff --git a/out/production/classes/controller/Search$1.class b/out/production/classes/controller/Search$1.class
new file mode 100644
index 00000000..4b7e37ed
Binary files /dev/null and b/out/production/classes/controller/Search$1.class differ
diff --git a/out/production/classes/controller/Search$2$1$1.class b/out/production/classes/controller/Search$2$1$1.class
new file mode 100644
index 00000000..87ae20ad
Binary files /dev/null and b/out/production/classes/controller/Search$2$1$1.class differ
diff --git a/out/production/classes/controller/Search$2$1.class b/out/production/classes/controller/Search$2$1.class
new file mode 100644
index 00000000..91509c6c
Binary files /dev/null and b/out/production/classes/controller/Search$2$1.class differ
diff --git a/out/production/classes/controller/Search$2.class b/out/production/classes/controller/Search$2.class
new file mode 100644
index 00000000..2f927f71
Binary files /dev/null and b/out/production/classes/controller/Search$2.class differ
diff --git a/out/production/classes/controller/Search.class b/out/production/classes/controller/Search.class
new file mode 100644
index 00000000..9593932c
Binary files /dev/null and b/out/production/classes/controller/Search.class differ
diff --git a/out/production/classes/controller/Users$1.class b/out/production/classes/controller/Users$1.class
new file mode 100644
index 00000000..7e5d8677
Binary files /dev/null and b/out/production/classes/controller/Users$1.class differ
diff --git a/out/production/classes/controller/Users$2.class b/out/production/classes/controller/Users$2.class
new file mode 100644
index 00000000..9d268a33
Binary files /dev/null and b/out/production/classes/controller/Users$2.class differ
diff --git a/out/production/classes/controller/Users$3.class b/out/production/classes/controller/Users$3.class
new file mode 100644
index 00000000..c0ee8702
Binary files /dev/null and b/out/production/classes/controller/Users$3.class differ
diff --git a/out/production/classes/controller/Users$4.class b/out/production/classes/controller/Users$4.class
new file mode 100644
index 00000000..568928b7
Binary files /dev/null and b/out/production/classes/controller/Users$4.class differ
diff --git a/out/production/classes/controller/Users$5.class b/out/production/classes/controller/Users$5.class
new file mode 100644
index 00000000..ddc29a62
Binary files /dev/null and b/out/production/classes/controller/Users$5.class differ
diff --git a/out/production/classes/controller/Users.class b/out/production/classes/controller/Users.class
new file mode 100644
index 00000000..e001e7d6
Binary files /dev/null and b/out/production/classes/controller/Users.class differ
diff --git a/out/production/classes/controller/managers/CryptoItemManagerDecorator$1.class b/out/production/classes/controller/managers/CryptoItemManagerDecorator$1.class
new file mode 100644
index 00000000..20d630bf
Binary files /dev/null and b/out/production/classes/controller/managers/CryptoItemManagerDecorator$1.class differ
diff --git a/out/production/classes/controller/managers/CryptoItemManagerDecorator$2.class b/out/production/classes/controller/managers/CryptoItemManagerDecorator$2.class
new file mode 100644
index 00000000..3f2e9248
Binary files /dev/null and b/out/production/classes/controller/managers/CryptoItemManagerDecorator$2.class differ
diff --git a/out/production/classes/controller/managers/CryptoItemManagerDecorator$3.class b/out/production/classes/controller/managers/CryptoItemManagerDecorator$3.class
new file mode 100644
index 00000000..8305d60e
Binary files /dev/null and b/out/production/classes/controller/managers/CryptoItemManagerDecorator$3.class differ
diff --git a/out/production/classes/controller/managers/CryptoItemManagerDecorator.class b/out/production/classes/controller/managers/CryptoItemManagerDecorator.class
new file mode 100644
index 00000000..9ca9832b
Binary files /dev/null and b/out/production/classes/controller/managers/CryptoItemManagerDecorator.class differ
diff --git a/out/production/classes/controller/managers/CryptoMessageManagerDecorator$1.class b/out/production/classes/controller/managers/CryptoMessageManagerDecorator$1.class
new file mode 100644
index 00000000..ee884622
Binary files /dev/null and b/out/production/classes/controller/managers/CryptoMessageManagerDecorator$1.class differ
diff --git a/out/production/classes/controller/managers/CryptoMessageManagerDecorator.class b/out/production/classes/controller/managers/CryptoMessageManagerDecorator.class
new file mode 100644
index 00000000..4641e7cb
Binary files /dev/null and b/out/production/classes/controller/managers/CryptoMessageManagerDecorator.class differ
diff --git a/out/production/classes/controller/managers/CryptoUserManagerDecorator.class b/out/production/classes/controller/managers/CryptoUserManagerDecorator.class
new file mode 100644
index 00000000..334c853d
Binary files /dev/null and b/out/production/classes/controller/managers/CryptoUserManagerDecorator.class differ
diff --git a/out/production/classes/controller/managers/NetworkContractManagerDecorator$1$1.class b/out/production/classes/controller/managers/NetworkContractManagerDecorator$1$1.class
new file mode 100644
index 00000000..181853b1
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkContractManagerDecorator$1$1.class differ
diff --git a/out/production/classes/controller/managers/NetworkContractManagerDecorator$1.class b/out/production/classes/controller/managers/NetworkContractManagerDecorator$1.class
new file mode 100644
index 00000000..eec6af83
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkContractManagerDecorator$1.class differ
diff --git a/out/production/classes/controller/managers/NetworkContractManagerDecorator$2$1.class b/out/production/classes/controller/managers/NetworkContractManagerDecorator$2$1.class
new file mode 100644
index 00000000..ecef8273
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkContractManagerDecorator$2$1.class differ
diff --git a/out/production/classes/controller/managers/NetworkContractManagerDecorator$2.class b/out/production/classes/controller/managers/NetworkContractManagerDecorator$2.class
new file mode 100644
index 00000000..85f692fd
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkContractManagerDecorator$2.class differ
diff --git a/out/production/classes/controller/managers/NetworkContractManagerDecorator.class b/out/production/classes/controller/managers/NetworkContractManagerDecorator.class
new file mode 100644
index 00000000..52f49ebf
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkContractManagerDecorator.class differ
diff --git a/out/production/classes/controller/managers/NetworkItemManagerDecorator$1$1.class b/out/production/classes/controller/managers/NetworkItemManagerDecorator$1$1.class
new file mode 100644
index 00000000..b9da4e54
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkItemManagerDecorator$1$1.class differ
diff --git a/out/production/classes/controller/managers/NetworkItemManagerDecorator$1.class b/out/production/classes/controller/managers/NetworkItemManagerDecorator$1.class
new file mode 100644
index 00000000..5eeb40d1
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkItemManagerDecorator$1.class differ
diff --git a/out/production/classes/controller/managers/NetworkItemManagerDecorator$2.class b/out/production/classes/controller/managers/NetworkItemManagerDecorator$2.class
new file mode 100644
index 00000000..ffc40cc6
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkItemManagerDecorator$2.class differ
diff --git a/out/production/classes/controller/managers/NetworkItemManagerDecorator.class b/out/production/classes/controller/managers/NetworkItemManagerDecorator.class
new file mode 100644
index 00000000..c9adc939
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkItemManagerDecorator.class differ
diff --git a/out/production/classes/controller/managers/NetworkMessageManagerDecorator$1$1.class b/out/production/classes/controller/managers/NetworkMessageManagerDecorator$1$1.class
new file mode 100644
index 00000000..88ab382a
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkMessageManagerDecorator$1$1.class differ
diff --git a/out/production/classes/controller/managers/NetworkMessageManagerDecorator$1.class b/out/production/classes/controller/managers/NetworkMessageManagerDecorator$1.class
new file mode 100644
index 00000000..1c7d994d
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkMessageManagerDecorator$1.class differ
diff --git a/out/production/classes/controller/managers/NetworkMessageManagerDecorator$2.class b/out/production/classes/controller/managers/NetworkMessageManagerDecorator$2.class
new file mode 100644
index 00000000..5ee58d1b
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkMessageManagerDecorator$2.class differ
diff --git a/out/production/classes/controller/managers/NetworkMessageManagerDecorator.class b/out/production/classes/controller/managers/NetworkMessageManagerDecorator.class
new file mode 100644
index 00000000..68849a4a
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkMessageManagerDecorator.class differ
diff --git a/out/production/classes/controller/managers/NetworkUserManagerDecorator$1$1.class b/out/production/classes/controller/managers/NetworkUserManagerDecorator$1$1.class
new file mode 100644
index 00000000..d6bb1ca1
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkUserManagerDecorator$1$1.class differ
diff --git a/out/production/classes/controller/managers/NetworkUserManagerDecorator$1.class b/out/production/classes/controller/managers/NetworkUserManagerDecorator$1.class
new file mode 100644
index 00000000..47d2a0c1
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkUserManagerDecorator$1.class differ
diff --git a/out/production/classes/controller/managers/NetworkUserManagerDecorator$2.class b/out/production/classes/controller/managers/NetworkUserManagerDecorator$2.class
new file mode 100644
index 00000000..3c70a672
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkUserManagerDecorator$2.class differ
diff --git a/out/production/classes/controller/managers/NetworkUserManagerDecorator$3$1.class b/out/production/classes/controller/managers/NetworkUserManagerDecorator$3$1.class
new file mode 100644
index 00000000..9e0ff87e
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkUserManagerDecorator$3$1.class differ
diff --git a/out/production/classes/controller/managers/NetworkUserManagerDecorator$3.class b/out/production/classes/controller/managers/NetworkUserManagerDecorator$3.class
new file mode 100644
index 00000000..4acf5500
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkUserManagerDecorator$3.class differ
diff --git a/out/production/classes/controller/managers/NetworkUserManagerDecorator$4.class b/out/production/classes/controller/managers/NetworkUserManagerDecorator$4.class
new file mode 100644
index 00000000..4212bd9f
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkUserManagerDecorator$4.class differ
diff --git a/out/production/classes/controller/managers/NetworkUserManagerDecorator.class b/out/production/classes/controller/managers/NetworkUserManagerDecorator.class
new file mode 100644
index 00000000..97b01097
Binary files /dev/null and b/out/production/classes/controller/managers/NetworkUserManagerDecorator.class differ
diff --git a/out/production/classes/controller/managers/ResilienceContractManagerDecorator.class b/out/production/classes/controller/managers/ResilienceContractManagerDecorator.class
new file mode 100644
index 00000000..fde0fe3f
Binary files /dev/null and b/out/production/classes/controller/managers/ResilienceContractManagerDecorator.class differ
diff --git a/out/production/classes/controller/managers/ResilienceItemManagerDecorator.class b/out/production/classes/controller/managers/ResilienceItemManagerDecorator.class
new file mode 100644
index 00000000..f441cda7
Binary files /dev/null and b/out/production/classes/controller/managers/ResilienceItemManagerDecorator.class differ
diff --git a/out/production/classes/controller/tools/BigIntegerDeserializer.class b/out/production/classes/controller/tools/BigIntegerDeserializer.class
new file mode 100644
index 00000000..73f4800a
Binary files /dev/null and b/out/production/classes/controller/tools/BigIntegerDeserializer.class differ
diff --git a/out/production/classes/controller/tools/BigIntegerSerializer.class b/out/production/classes/controller/tools/BigIntegerSerializer.class
new file mode 100644
index 00000000..59284f31
Binary files /dev/null and b/out/production/classes/controller/tools/BigIntegerSerializer.class differ
diff --git a/out/production/classes/controller/tools/JsonTools.class b/out/production/classes/controller/tools/JsonTools.class
new file mode 100644
index 00000000..0cbb91d5
Binary files /dev/null and b/out/production/classes/controller/tools/JsonTools.class differ
diff --git a/out/production/classes/controller/tools/LoggerUtilities.class b/out/production/classes/controller/tools/LoggerUtilities.class
new file mode 100644
index 00000000..8cb93f4b
Binary files /dev/null and b/out/production/classes/controller/tools/LoggerUtilities.class differ
diff --git a/out/production/classes/controller/tools/MapKeyStringDeserializer.class b/out/production/classes/controller/tools/MapKeyStringDeserializer.class
new file mode 100644
index 00000000..18056b8d
Binary files /dev/null and b/out/production/classes/controller/tools/MapKeyStringDeserializer.class differ
diff --git a/out/production/classes/controller/tools/MapResponseKeyDeserializer.class b/out/production/classes/controller/tools/MapResponseKeyDeserializer.class
new file mode 100644
index 00000000..9093e010
Binary files /dev/null and b/out/production/classes/controller/tools/MapResponseKeyDeserializer.class differ
diff --git a/out/production/classes/controller/tools/MapSerializer.class b/out/production/classes/controller/tools/MapSerializer.class
new file mode 100644
index 00000000..97bf3379
Binary files /dev/null and b/out/production/classes/controller/tools/MapSerializer.class differ
diff --git a/out/production/classes/controller/tools/MapStringDeserializer.class b/out/production/classes/controller/tools/MapStringDeserializer.class
new file mode 100644
index 00000000..3d569638
Binary files /dev/null and b/out/production/classes/controller/tools/MapStringDeserializer.class differ
diff --git a/out/production/classes/crypt/CryptCommander.class b/out/production/classes/crypt/CryptCommander.class
new file mode 100644
index 00000000..9b20d71e
Binary files /dev/null and b/out/production/classes/crypt/CryptCommander.class differ
diff --git a/out/production/classes/crypt/ElGamalEngineK.class b/out/production/classes/crypt/ElGamalEngineK.class
new file mode 100644
index 00000000..c07ea470
Binary files /dev/null and b/out/production/classes/crypt/ElGamalEngineK.class differ
diff --git a/out/production/classes/crypt/annotations/CryptCryptAnnotation.class b/out/production/classes/crypt/annotations/CryptCryptAnnotation.class
new file mode 100644
index 00000000..8cf53f01
Binary files /dev/null and b/out/production/classes/crypt/annotations/CryptCryptAnnotation.class differ
diff --git a/out/production/classes/crypt/annotations/CryptHashAnnotation.class b/out/production/classes/crypt/annotations/CryptHashAnnotation.class
new file mode 100644
index 00000000..fd973279
Binary files /dev/null and b/out/production/classes/crypt/annotations/CryptHashAnnotation.class differ
diff --git a/out/production/classes/crypt/annotations/CryptSigneAnnotation.class b/out/production/classes/crypt/annotations/CryptSigneAnnotation.class
new file mode 100644
index 00000000..b79fe304
Binary files /dev/null and b/out/production/classes/crypt/annotations/CryptSigneAnnotation.class differ
diff --git a/out/production/classes/crypt/api/annotation/ParserAction.class b/out/production/classes/crypt/api/annotation/ParserAction.class
new file mode 100644
index 00000000..8d008065
Binary files /dev/null and b/out/production/classes/crypt/api/annotation/ParserAction.class differ
diff --git a/out/production/classes/crypt/api/annotation/ParserAnnotation.class b/out/production/classes/crypt/api/annotation/ParserAnnotation.class
new file mode 100644
index 00000000..6856ac77
Binary files /dev/null and b/out/production/classes/crypt/api/annotation/ParserAnnotation.class differ
diff --git a/out/production/classes/crypt/api/certificate/CertificateGenerator.class b/out/production/classes/crypt/api/certificate/CertificateGenerator.class
new file mode 100644
index 00000000..e779edf3
Binary files /dev/null and b/out/production/classes/crypt/api/certificate/CertificateGenerator.class differ
diff --git a/out/production/classes/crypt/api/encryption/Encryptable.class b/out/production/classes/crypt/api/encryption/Encryptable.class
new file mode 100644
index 00000000..32438b69
Binary files /dev/null and b/out/production/classes/crypt/api/encryption/Encryptable.class differ
diff --git a/out/production/classes/crypt/api/encryption/Encrypter.class b/out/production/classes/crypt/api/encryption/Encrypter.class
new file mode 100644
index 00000000..b65a2b6c
Binary files /dev/null and b/out/production/classes/crypt/api/encryption/Encrypter.class differ
diff --git a/out/production/classes/crypt/api/hashs/Hashable.class b/out/production/classes/crypt/api/hashs/Hashable.class
new file mode 100644
index 00000000..6cf9b97f
Binary files /dev/null and b/out/production/classes/crypt/api/hashs/Hashable.class differ
diff --git a/out/production/classes/crypt/api/hashs/Hasher.class b/out/production/classes/crypt/api/hashs/Hasher.class
new file mode 100644
index 00000000..79eaf3dc
Binary files /dev/null and b/out/production/classes/crypt/api/hashs/Hasher.class differ
diff --git a/out/production/classes/crypt/api/key/AsymKey.class b/out/production/classes/crypt/api/key/AsymKey.class
new file mode 100644
index 00000000..30a3feb8
Binary files /dev/null and b/out/production/classes/crypt/api/key/AsymKey.class differ
diff --git a/out/production/classes/crypt/api/signatures/ParamName.class b/out/production/classes/crypt/api/signatures/ParamName.class
new file mode 100644
index 00000000..42cbcc6c
Binary files /dev/null and b/out/production/classes/crypt/api/signatures/ParamName.class differ
diff --git a/out/production/classes/crypt/api/signatures/Signable.class b/out/production/classes/crypt/api/signatures/Signable.class
new file mode 100644
index 00000000..5a728819
Binary files /dev/null and b/out/production/classes/crypt/api/signatures/Signable.class differ
diff --git a/out/production/classes/crypt/api/signatures/Signature.class b/out/production/classes/crypt/api/signatures/Signature.class
new file mode 100644
index 00000000..19561db6
Binary files /dev/null and b/out/production/classes/crypt/api/signatures/Signature.class differ
diff --git a/out/production/classes/crypt/api/signatures/Signer.class b/out/production/classes/crypt/api/signatures/Signer.class
new file mode 100644
index 00000000..ef2459a4
Binary files /dev/null and b/out/production/classes/crypt/api/signatures/Signer.class differ
diff --git a/out/production/classes/crypt/base/AbstractAsymKey.class b/out/production/classes/crypt/base/AbstractAsymKey.class
new file mode 100644
index 00000000..89031449
Binary files /dev/null and b/out/production/classes/crypt/base/AbstractAsymKey.class differ
diff --git a/out/production/classes/crypt/base/AbstractHasher.class b/out/production/classes/crypt/base/AbstractHasher.class
new file mode 100644
index 00000000..46afd123
Binary files /dev/null and b/out/production/classes/crypt/base/AbstractHasher.class differ
diff --git a/out/production/classes/crypt/base/AbstractSigner.class b/out/production/classes/crypt/base/AbstractSigner.class
new file mode 100644
index 00000000..fb816293
Binary files /dev/null and b/out/production/classes/crypt/base/AbstractSigner.class differ
diff --git a/out/production/classes/crypt/base/BaseSignature.class b/out/production/classes/crypt/base/BaseSignature.class
new file mode 100644
index 00000000..c8b59037
Binary files /dev/null and b/out/production/classes/crypt/base/BaseSignature.class differ
diff --git a/out/production/classes/crypt/factories/AsymKeyFactory.class b/out/production/classes/crypt/factories/AsymKeyFactory.class
new file mode 100644
index 00000000..040ec148
Binary files /dev/null and b/out/production/classes/crypt/factories/AsymKeyFactory.class differ
diff --git a/out/production/classes/crypt/factories/ElGamalAsymKeyFactory.class b/out/production/classes/crypt/factories/ElGamalAsymKeyFactory.class
new file mode 100644
index 00000000..616e68a6
Binary files /dev/null and b/out/production/classes/crypt/factories/ElGamalAsymKeyFactory.class differ
diff --git a/out/production/classes/crypt/factories/EncrypterFactory.class b/out/production/classes/crypt/factories/EncrypterFactory.class
new file mode 100644
index 00000000..492809c8
Binary files /dev/null and b/out/production/classes/crypt/factories/EncrypterFactory.class differ
diff --git a/out/production/classes/crypt/factories/HasherFactory.class b/out/production/classes/crypt/factories/HasherFactory.class
new file mode 100644
index 00000000..d1eb0226
Binary files /dev/null and b/out/production/classes/crypt/factories/HasherFactory.class differ
diff --git a/out/production/classes/crypt/factories/ParserFactory.class b/out/production/classes/crypt/factories/ParserFactory.class
new file mode 100644
index 00000000..c8e95159
Binary files /dev/null and b/out/production/classes/crypt/factories/ParserFactory.class differ
diff --git a/out/production/classes/crypt/factories/SignerFactory.class b/out/production/classes/crypt/factories/SignerFactory.class
new file mode 100644
index 00000000..e86e07a4
Binary files /dev/null and b/out/production/classes/crypt/factories/SignerFactory.class differ
diff --git a/out/production/classes/crypt/impl/certificate/X509V3Generator.class b/out/production/classes/crypt/impl/certificate/X509V3Generator.class
new file mode 100644
index 00000000..32334fe4
Binary files /dev/null and b/out/production/classes/crypt/impl/certificate/X509V3Generator.class differ
diff --git a/out/production/classes/crypt/impl/encryption/ElGamalEncrypter.class b/out/production/classes/crypt/impl/encryption/ElGamalEncrypter.class
new file mode 100644
index 00000000..c7fb7624
Binary files /dev/null and b/out/production/classes/crypt/impl/encryption/ElGamalEncrypter.class differ
diff --git a/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter$1.class b/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter$1.class
new file mode 100644
index 00000000..a8c5fc51
Binary files /dev/null and b/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter$1.class differ
diff --git a/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter$2.class b/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter$2.class
new file mode 100644
index 00000000..06188f96
Binary files /dev/null and b/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter$2.class differ
diff --git a/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter$3.class b/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter$3.class
new file mode 100644
index 00000000..37c432ff
Binary files /dev/null and b/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter$3.class differ
diff --git a/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter$4.class b/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter$4.class
new file mode 100644
index 00000000..ac6a3ffe
Binary files /dev/null and b/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter$4.class differ
diff --git a/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter.class b/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter.class
new file mode 100644
index 00000000..e2e96d76
Binary files /dev/null and b/out/production/classes/crypt/impl/encryption/ElGamalSerpentEncrypter.class differ
diff --git a/out/production/classes/crypt/impl/encryption/SerpentEncrypter.class b/out/production/classes/crypt/impl/encryption/SerpentEncrypter.class
new file mode 100644
index 00000000..056d16fc
Binary files /dev/null and b/out/production/classes/crypt/impl/encryption/SerpentEncrypter.class differ
diff --git a/out/production/classes/crypt/impl/hashs/SHA256Hasher.class b/out/production/classes/crypt/impl/hashs/SHA256Hasher.class
new file mode 100644
index 00000000..84434028
Binary files /dev/null and b/out/production/classes/crypt/impl/hashs/SHA256Hasher.class differ
diff --git a/out/production/classes/crypt/impl/key/ElGamalAsymKey.class b/out/production/classes/crypt/impl/key/ElGamalAsymKey.class
new file mode 100644
index 00000000..04a934a8
Binary files /dev/null and b/out/production/classes/crypt/impl/key/ElGamalAsymKey.class differ
diff --git a/out/production/classes/crypt/impl/signatures/ElGamalSignature.class b/out/production/classes/crypt/impl/signatures/ElGamalSignature.class
new file mode 100644
index 00000000..9ce1028f
Binary files /dev/null and b/out/production/classes/crypt/impl/signatures/ElGamalSignature.class differ
diff --git a/out/production/classes/crypt/impl/signatures/ElGamalSigner.class b/out/production/classes/crypt/impl/signatures/ElGamalSigner.class
new file mode 100644
index 00000000..e645e2b6
Binary files /dev/null and b/out/production/classes/crypt/impl/signatures/ElGamalSigner.class differ
diff --git a/out/production/classes/crypt/impl/signatures/SigmaSigner.class b/out/production/classes/crypt/impl/signatures/SigmaSigner.class
new file mode 100644
index 00000000..fab1e368
Binary files /dev/null and b/out/production/classes/crypt/impl/signatures/SigmaSigner.class differ
diff --git a/out/production/classes/crypt/utils/AbstractParser.class b/out/production/classes/crypt/utils/AbstractParser.class
new file mode 100644
index 00000000..96f4ffba
Binary files /dev/null and b/out/production/classes/crypt/utils/AbstractParser.class differ
diff --git a/out/production/classes/crypt/utils/BigIntegerRandom.class b/out/production/classes/crypt/utils/BigIntegerRandom.class
new file mode 100644
index 00000000..c7145ea6
Binary files /dev/null and b/out/production/classes/crypt/utils/BigIntegerRandom.class differ
diff --git a/out/production/classes/crypt/utils/CryptoParser$1.class b/out/production/classes/crypt/utils/CryptoParser$1.class
new file mode 100644
index 00000000..5e19bcfa
Binary files /dev/null and b/out/production/classes/crypt/utils/CryptoParser$1.class differ
diff --git a/out/production/classes/crypt/utils/CryptoParser.class b/out/production/classes/crypt/utils/CryptoParser.class
new file mode 100644
index 00000000..076aa53a
Binary files /dev/null and b/out/production/classes/crypt/utils/CryptoParser.class differ
diff --git a/out/production/classes/model/api/ContractSyncManager.class b/out/production/classes/model/api/ContractSyncManager.class
new file mode 100644
index 00000000..17de90e0
Binary files /dev/null and b/out/production/classes/model/api/ContractSyncManager.class differ
diff --git a/out/production/classes/model/api/EntityValidation.class b/out/production/classes/model/api/EntityValidation.class
new file mode 100644
index 00000000..430f4726
Binary files /dev/null and b/out/production/classes/model/api/EntityValidation.class differ
diff --git a/out/production/classes/model/api/EstablisherType.class b/out/production/classes/model/api/EstablisherType.class
new file mode 100644
index 00000000..b5dc675f
Binary files /dev/null and b/out/production/classes/model/api/EstablisherType.class differ
diff --git a/out/production/classes/model/api/ItemSyncManager.class b/out/production/classes/model/api/ItemSyncManager.class
new file mode 100644
index 00000000..ed73904a
Binary files /dev/null and b/out/production/classes/model/api/ItemSyncManager.class differ
diff --git a/out/production/classes/model/api/Manager.class b/out/production/classes/model/api/Manager.class
new file mode 100644
index 00000000..5cd8ada6
Binary files /dev/null and b/out/production/classes/model/api/Manager.class differ
diff --git a/out/production/classes/model/api/ManagerDecorator.class b/out/production/classes/model/api/ManagerDecorator.class
new file mode 100644
index 00000000..5392a9b5
Binary files /dev/null and b/out/production/classes/model/api/ManagerDecorator.class differ
diff --git a/out/production/classes/model/api/ManagerListener.class b/out/production/classes/model/api/ManagerListener.class
new file mode 100644
index 00000000..f377474f
Binary files /dev/null and b/out/production/classes/model/api/ManagerListener.class differ
diff --git a/out/production/classes/model/api/MessageSyncManager.class b/out/production/classes/model/api/MessageSyncManager.class
new file mode 100644
index 00000000..2bb474bc
Binary files /dev/null and b/out/production/classes/model/api/MessageSyncManager.class differ
diff --git a/out/production/classes/model/api/Status.class b/out/production/classes/model/api/Status.class
new file mode 100644
index 00000000..480c492c
Binary files /dev/null and b/out/production/classes/model/api/Status.class differ
diff --git a/out/production/classes/model/api/SyncManager.class b/out/production/classes/model/api/SyncManager.class
new file mode 100644
index 00000000..3cc95d77
Binary files /dev/null and b/out/production/classes/model/api/SyncManager.class differ
diff --git a/out/production/classes/model/api/UserSyncManager.class b/out/production/classes/model/api/UserSyncManager.class
new file mode 100644
index 00000000..64a067c4
Binary files /dev/null and b/out/production/classes/model/api/UserSyncManager.class differ
diff --git a/out/production/classes/model/api/Wish.class b/out/production/classes/model/api/Wish.class
new file mode 100644
index 00000000..4c6149a4
Binary files /dev/null and b/out/production/classes/model/api/Wish.class differ
diff --git a/out/production/classes/model/entity/ContractEntity.class b/out/production/classes/model/entity/ContractEntity.class
new file mode 100644
index 00000000..6a5f20ab
Binary files /dev/null and b/out/production/classes/model/entity/ContractEntity.class differ
diff --git a/out/production/classes/model/entity/ElGamalKey.class b/out/production/classes/model/entity/ElGamalKey.class
new file mode 100644
index 00000000..233cfb3e
Binary files /dev/null and b/out/production/classes/model/entity/ElGamalKey.class differ
diff --git a/out/production/classes/model/entity/ElGamalSignEntity.class b/out/production/classes/model/entity/ElGamalSignEntity.class
new file mode 100644
index 00000000..0a517de1
Binary files /dev/null and b/out/production/classes/model/entity/ElGamalSignEntity.class differ
diff --git a/out/production/classes/model/entity/Item.class b/out/production/classes/model/entity/Item.class
new file mode 100644
index 00000000..e8e4e33b
Binary files /dev/null and b/out/production/classes/model/entity/Item.class differ
diff --git a/out/production/classes/model/entity/LoginToken.class b/out/production/classes/model/entity/LoginToken.class
new file mode 100644
index 00000000..42492e04
Binary files /dev/null and b/out/production/classes/model/entity/LoginToken.class differ
diff --git a/out/production/classes/model/entity/Message$ReceptionStatus.class b/out/production/classes/model/entity/Message$ReceptionStatus.class
new file mode 100644
index 00000000..036d81eb
Binary files /dev/null and b/out/production/classes/model/entity/Message$ReceptionStatus.class differ
diff --git a/out/production/classes/model/entity/Message.class b/out/production/classes/model/entity/Message.class
new file mode 100644
index 00000000..5f5b9227
Binary files /dev/null and b/out/production/classes/model/entity/Message.class differ
diff --git a/out/production/classes/model/entity/User.class b/out/production/classes/model/entity/User.class
new file mode 100644
index 00000000..0bdab3e4
Binary files /dev/null and b/out/production/classes/model/entity/User.class differ
diff --git a/out/production/classes/model/entity/sigma/And.class b/out/production/classes/model/entity/sigma/And.class
new file mode 100644
index 00000000..68ab732a
Binary files /dev/null and b/out/production/classes/model/entity/sigma/And.class differ
diff --git a/out/production/classes/model/entity/sigma/Masks.class b/out/production/classes/model/entity/sigma/Masks.class
new file mode 100644
index 00000000..897d3852
Binary files /dev/null and b/out/production/classes/model/entity/sigma/Masks.class differ
diff --git a/out/production/classes/model/entity/sigma/Or.class b/out/production/classes/model/entity/sigma/Or.class
new file mode 100644
index 00000000..1e03bef1
Binary files /dev/null and b/out/production/classes/model/entity/sigma/Or.class differ
diff --git a/out/production/classes/model/entity/sigma/ResEncrypt.class b/out/production/classes/model/entity/sigma/ResEncrypt.class
new file mode 100644
index 00000000..ae39ff8f
Binary files /dev/null and b/out/production/classes/model/entity/sigma/ResEncrypt.class differ
diff --git a/out/production/classes/model/entity/sigma/Responses.class b/out/production/classes/model/entity/sigma/Responses.class
new file mode 100644
index 00000000..e182d345
Binary files /dev/null and b/out/production/classes/model/entity/sigma/Responses.class differ
diff --git a/out/production/classes/model/entity/sigma/ResponsesCCD.class b/out/production/classes/model/entity/sigma/ResponsesCCD.class
new file mode 100644
index 00000000..52a7489e
Binary files /dev/null and b/out/production/classes/model/entity/sigma/ResponsesCCD.class differ
diff --git a/out/production/classes/model/entity/sigma/ResponsesCCE.class b/out/production/classes/model/entity/sigma/ResponsesCCE.class
new file mode 100644
index 00000000..8c096a9f
Binary files /dev/null and b/out/production/classes/model/entity/sigma/ResponsesCCE.class differ
diff --git a/out/production/classes/model/entity/sigma/ResponsesSchnorr.class b/out/production/classes/model/entity/sigma/ResponsesSchnorr.class
new file mode 100644
index 00000000..9af9745e
Binary files /dev/null and b/out/production/classes/model/entity/sigma/ResponsesSchnorr.class differ
diff --git a/out/production/classes/model/entity/sigma/SigmaSignature$1.class b/out/production/classes/model/entity/sigma/SigmaSignature$1.class
new file mode 100644
index 00000000..eff05a71
Binary files /dev/null and b/out/production/classes/model/entity/sigma/SigmaSignature$1.class differ
diff --git a/out/production/classes/model/entity/sigma/SigmaSignature$2.class b/out/production/classes/model/entity/sigma/SigmaSignature$2.class
new file mode 100644
index 00000000..ea7d0a67
Binary files /dev/null and b/out/production/classes/model/entity/sigma/SigmaSignature$2.class differ
diff --git a/out/production/classes/model/entity/sigma/SigmaSignature$3.class b/out/production/classes/model/entity/sigma/SigmaSignature$3.class
new file mode 100644
index 00000000..d2a1c458
Binary files /dev/null and b/out/production/classes/model/entity/sigma/SigmaSignature$3.class differ
diff --git a/out/production/classes/model/entity/sigma/SigmaSignature.class b/out/production/classes/model/entity/sigma/SigmaSignature.class
new file mode 100644
index 00000000..ab25f6e0
Binary files /dev/null and b/out/production/classes/model/entity/sigma/SigmaSignature.class differ
diff --git a/out/production/classes/model/factory/ManagerFactory.class b/out/production/classes/model/factory/ManagerFactory.class
new file mode 100644
index 00000000..3baea766
Binary files /dev/null and b/out/production/classes/model/factory/ManagerFactory.class differ
diff --git a/out/production/classes/model/factory/SyncManagerFactory.class b/out/production/classes/model/factory/SyncManagerFactory.class
new file mode 100644
index 00000000..9ac44121
Binary files /dev/null and b/out/production/classes/model/factory/SyncManagerFactory.class differ
diff --git a/out/production/classes/model/factory/ValidatorFactory.class b/out/production/classes/model/factory/ValidatorFactory.class
new file mode 100644
index 00000000..8ac49456
Binary files /dev/null and b/out/production/classes/model/factory/ValidatorFactory.class differ
diff --git a/out/production/classes/model/manager/ManagerAdapter.class b/out/production/classes/model/manager/ManagerAdapter.class
new file mode 100644
index 00000000..44623912
Binary files /dev/null and b/out/production/classes/model/manager/ManagerAdapter.class differ
diff --git a/out/production/classes/model/syncManager/AbstractSyncManager.class b/out/production/classes/model/syncManager/AbstractSyncManager.class
new file mode 100644
index 00000000..1726b365
Binary files /dev/null and b/out/production/classes/model/syncManager/AbstractSyncManager.class differ
diff --git a/out/production/classes/model/syncManager/ContractSyncManagerImpl.class b/out/production/classes/model/syncManager/ContractSyncManagerImpl.class
new file mode 100644
index 00000000..276cfaaa
Binary files /dev/null and b/out/production/classes/model/syncManager/ContractSyncManagerImpl.class differ
diff --git a/out/production/classes/model/syncManager/ItemSyncManagerImpl.class b/out/production/classes/model/syncManager/ItemSyncManagerImpl.class
new file mode 100644
index 00000000..44235f6e
Binary files /dev/null and b/out/production/classes/model/syncManager/ItemSyncManagerImpl.class differ
diff --git a/out/production/classes/model/syncManager/MessageSyncManagerImpl.class b/out/production/classes/model/syncManager/MessageSyncManagerImpl.class
new file mode 100644
index 00000000..6ad14317
Binary files /dev/null and b/out/production/classes/model/syncManager/MessageSyncManagerImpl.class differ
diff --git a/out/production/classes/model/syncManager/UserSyncManagerImpl.class b/out/production/classes/model/syncManager/UserSyncManagerImpl.class
new file mode 100644
index 00000000..f3dddcad
Binary files /dev/null and b/out/production/classes/model/syncManager/UserSyncManagerImpl.class differ
diff --git a/out/production/classes/model/validator/ContractValidator.class b/out/production/classes/model/validator/ContractValidator.class
new file mode 100644
index 00000000..23676917
Binary files /dev/null and b/out/production/classes/model/validator/ContractValidator.class differ
diff --git a/out/production/classes/model/validator/EntityValidator.class b/out/production/classes/model/validator/EntityValidator.class
new file mode 100644
index 00000000..d4511779
Binary files /dev/null and b/out/production/classes/model/validator/EntityValidator.class differ
diff --git a/out/production/classes/model/validator/ItemValidator.class b/out/production/classes/model/validator/ItemValidator.class
new file mode 100644
index 00000000..2560d0ec
Binary files /dev/null and b/out/production/classes/model/validator/ItemValidator.class differ
diff --git a/out/production/classes/model/validator/MessageValidator.class b/out/production/classes/model/validator/MessageValidator.class
new file mode 100644
index 00000000..6d29858c
Binary files /dev/null and b/out/production/classes/model/validator/MessageValidator.class differ
diff --git a/out/production/classes/model/validator/UserValidator.class b/out/production/classes/model/validator/UserValidator.class
new file mode 100644
index 00000000..ae92f554
Binary files /dev/null and b/out/production/classes/model/validator/UserValidator.class differ
diff --git a/out/production/classes/network/api/EstablisherService.class b/out/production/classes/network/api/EstablisherService.class
new file mode 100644
index 00000000..57bae8a9
Binary files /dev/null and b/out/production/classes/network/api/EstablisherService.class differ
diff --git a/out/production/classes/network/api/EstablisherServiceListener.class b/out/production/classes/network/api/EstablisherServiceListener.class
new file mode 100644
index 00000000..97f2e4bd
Binary files /dev/null and b/out/production/classes/network/api/EstablisherServiceListener.class differ
diff --git a/out/production/classes/network/api/ItemRequestService.class b/out/production/classes/network/api/ItemRequestService.class
new file mode 100644
index 00000000..70d509a1
Binary files /dev/null and b/out/production/classes/network/api/ItemRequestService.class differ
diff --git a/out/production/classes/network/api/ItemService.class b/out/production/classes/network/api/ItemService.class
new file mode 100644
index 00000000..49070017
Binary files /dev/null and b/out/production/classes/network/api/ItemService.class differ
diff --git a/out/production/classes/network/api/MessageRequestService.class b/out/production/classes/network/api/MessageRequestService.class
new file mode 100644
index 00000000..96880031
Binary files /dev/null and b/out/production/classes/network/api/MessageRequestService.class differ
diff --git a/out/production/classes/network/api/MessageService.class b/out/production/classes/network/api/MessageService.class
new file mode 100644
index 00000000..486660f4
Binary files /dev/null and b/out/production/classes/network/api/MessageService.class differ
diff --git a/out/production/classes/network/api/Messages.class b/out/production/classes/network/api/Messages.class
new file mode 100644
index 00000000..dd2a4d06
Binary files /dev/null and b/out/production/classes/network/api/Messages.class differ
diff --git a/out/production/classes/network/api/Node.class b/out/production/classes/network/api/Node.class
new file mode 100644
index 00000000..e3a3bb49
Binary files /dev/null and b/out/production/classes/network/api/Node.class differ
diff --git a/out/production/classes/network/api/Peer.class b/out/production/classes/network/api/Peer.class
new file mode 100644
index 00000000..eda9976a
Binary files /dev/null and b/out/production/classes/network/api/Peer.class differ
diff --git a/out/production/classes/network/api/Search.class b/out/production/classes/network/api/Search.class
new file mode 100644
index 00000000..edd894a0
Binary files /dev/null and b/out/production/classes/network/api/Search.class differ
diff --git a/out/production/classes/network/api/SearchListener.class b/out/production/classes/network/api/SearchListener.class
new file mode 100644
index 00000000..7a61d8cd
Binary files /dev/null and b/out/production/classes/network/api/SearchListener.class differ
diff --git a/out/production/classes/network/api/ServiceListener.class b/out/production/classes/network/api/ServiceListener.class
new file mode 100644
index 00000000..bdb0f656
Binary files /dev/null and b/out/production/classes/network/api/ServiceListener.class differ
diff --git a/out/production/classes/network/api/UserRequestService.class b/out/production/classes/network/api/UserRequestService.class
new file mode 100644
index 00000000..a6d25a76
Binary files /dev/null and b/out/production/classes/network/api/UserRequestService.class differ
diff --git a/out/production/classes/network/api/UserService.class b/out/production/classes/network/api/UserService.class
new file mode 100644
index 00000000..5f52e6d9
Binary files /dev/null and b/out/production/classes/network/api/UserService.class differ
diff --git a/out/production/classes/network/api/advertisement/Advertisement.class b/out/production/classes/network/api/advertisement/Advertisement.class
new file mode 100644
index 00000000..264f8ecf
Binary files /dev/null and b/out/production/classes/network/api/advertisement/Advertisement.class differ
diff --git a/out/production/classes/network/api/advertisement/EstablisherAdvertisementInterface.class b/out/production/classes/network/api/advertisement/EstablisherAdvertisementInterface.class
new file mode 100644
index 00000000..4742730a
Binary files /dev/null and b/out/production/classes/network/api/advertisement/EstablisherAdvertisementInterface.class differ
diff --git a/out/production/classes/network/api/advertisement/ItemAdvertisementInterface.class b/out/production/classes/network/api/advertisement/ItemAdvertisementInterface.class
new file mode 100644
index 00000000..78713721
Binary files /dev/null and b/out/production/classes/network/api/advertisement/ItemAdvertisementInterface.class differ
diff --git a/out/production/classes/network/api/advertisement/MessageAdvertisementInterface.class b/out/production/classes/network/api/advertisement/MessageAdvertisementInterface.class
new file mode 100644
index 00000000..1561c764
Binary files /dev/null and b/out/production/classes/network/api/advertisement/MessageAdvertisementInterface.class differ
diff --git a/out/production/classes/network/api/advertisement/PeerAdvertisementInterface.class b/out/production/classes/network/api/advertisement/PeerAdvertisementInterface.class
new file mode 100644
index 00000000..00de6c3c
Binary files /dev/null and b/out/production/classes/network/api/advertisement/PeerAdvertisementInterface.class differ
diff --git a/out/production/classes/network/api/advertisement/UserAdvertisementInterface.class b/out/production/classes/network/api/advertisement/UserAdvertisementInterface.class
new file mode 100644
index 00000000..a15fffc6
Binary files /dev/null and b/out/production/classes/network/api/advertisement/UserAdvertisementInterface.class differ
diff --git a/out/production/classes/network/api/annotation/AdvertisementAttribute.class b/out/production/classes/network/api/annotation/AdvertisementAttribute.class
new file mode 100644
index 00000000..e68a4eb4
Binary files /dev/null and b/out/production/classes/network/api/annotation/AdvertisementAttribute.class differ
diff --git a/out/production/classes/network/api/annotation/MessageElement.class b/out/production/classes/network/api/annotation/MessageElement.class
new file mode 100644
index 00000000..1235a2c1
Binary files /dev/null and b/out/production/classes/network/api/annotation/MessageElement.class differ
diff --git a/out/production/classes/network/api/annotation/ServiceName.class b/out/production/classes/network/api/annotation/ServiceName.class
new file mode 100644
index 00000000..b8e82005
Binary files /dev/null and b/out/production/classes/network/api/annotation/ServiceName.class differ
diff --git a/out/production/classes/network/api/service/InvalidServiceException.class b/out/production/classes/network/api/service/InvalidServiceException.class
new file mode 100644
index 00000000..4ec9ef7d
Binary files /dev/null and b/out/production/classes/network/api/service/InvalidServiceException.class differ
diff --git a/out/production/classes/network/api/service/Service.class b/out/production/classes/network/api/service/Service.class
new file mode 100644
index 00000000..7df03a7b
Binary files /dev/null and b/out/production/classes/network/api/service/Service.class differ
diff --git a/out/production/classes/network/factories/AdvertisementFactory.class b/out/production/classes/network/factories/AdvertisementFactory.class
new file mode 100644
index 00000000..56473ad9
Binary files /dev/null and b/out/production/classes/network/factories/AdvertisementFactory.class differ
diff --git a/out/production/classes/network/factories/PeerFactory.class b/out/production/classes/network/factories/PeerFactory.class
new file mode 100644
index 00000000..75945e4f
Binary files /dev/null and b/out/production/classes/network/factories/PeerFactory.class differ
diff --git a/out/production/classes/network/factories/ServiceFactory.class b/out/production/classes/network/factories/ServiceFactory.class
new file mode 100644
index 00000000..6577f764
Binary files /dev/null and b/out/production/classes/network/factories/ServiceFactory.class differ
diff --git a/out/production/classes/network/impl/AbstractAdvertisement.class b/out/production/classes/network/impl/AbstractAdvertisement.class
new file mode 100644
index 00000000..e595abb8
Binary files /dev/null and b/out/production/classes/network/impl/AbstractAdvertisement.class differ
diff --git a/out/production/classes/network/impl/MessagesGeneric.class b/out/production/classes/network/impl/MessagesGeneric.class
new file mode 100644
index 00000000..c616e177
Binary files /dev/null and b/out/production/classes/network/impl/MessagesGeneric.class differ
diff --git a/out/production/classes/network/impl/MessagesImpl.class b/out/production/classes/network/impl/MessagesImpl.class
new file mode 100644
index 00000000..8af9088e
Binary files /dev/null and b/out/production/classes/network/impl/MessagesImpl.class differ
diff --git a/out/production/classes/network/impl/advertisement/EstablisherAdvertisement.class b/out/production/classes/network/impl/advertisement/EstablisherAdvertisement.class
new file mode 100644
index 00000000..f619738c
Binary files /dev/null and b/out/production/classes/network/impl/advertisement/EstablisherAdvertisement.class differ
diff --git a/out/production/classes/network/impl/advertisement/ItemAdvertisement.class b/out/production/classes/network/impl/advertisement/ItemAdvertisement.class
new file mode 100644
index 00000000..339d8ee4
Binary files /dev/null and b/out/production/classes/network/impl/advertisement/ItemAdvertisement.class differ
diff --git a/out/production/classes/network/impl/advertisement/MessageAdvertisement.class b/out/production/classes/network/impl/advertisement/MessageAdvertisement.class
new file mode 100644
index 00000000..7aae14c2
Binary files /dev/null and b/out/production/classes/network/impl/advertisement/MessageAdvertisement.class differ
diff --git a/out/production/classes/network/impl/advertisement/PeerAdvertisement.class b/out/production/classes/network/impl/advertisement/PeerAdvertisement.class
new file mode 100644
index 00000000..9b9ba7b0
Binary files /dev/null and b/out/production/classes/network/impl/advertisement/PeerAdvertisement.class differ
diff --git a/out/production/classes/network/impl/advertisement/UserAdvertisement.class b/out/production/classes/network/impl/advertisement/UserAdvertisement.class
new file mode 100644
index 00000000..91e5c2ad
Binary files /dev/null and b/out/production/classes/network/impl/advertisement/UserAdvertisement.class differ
diff --git a/out/production/classes/network/impl/jxta/AdvertisementBridge.class b/out/production/classes/network/impl/jxta/AdvertisementBridge.class
new file mode 100644
index 00000000..681966e7
Binary files /dev/null and b/out/production/classes/network/impl/jxta/AdvertisementBridge.class differ
diff --git a/out/production/classes/network/impl/jxta/AdvertisementInstanciator.class b/out/production/classes/network/impl/jxta/AdvertisementInstanciator.class
new file mode 100644
index 00000000..5ad9774b
Binary files /dev/null and b/out/production/classes/network/impl/jxta/AdvertisementInstanciator.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaAdvertisement.class b/out/production/classes/network/impl/jxta/JxtaAdvertisement.class
new file mode 100644
index 00000000..1867b932
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaAdvertisement.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaEstablisherService$1.class b/out/production/classes/network/impl/jxta/JxtaEstablisherService$1.class
new file mode 100644
index 00000000..d1946107
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaEstablisherService$1.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaEstablisherService$2.class b/out/production/classes/network/impl/jxta/JxtaEstablisherService$2.class
new file mode 100644
index 00000000..614d0a85
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaEstablisherService$2.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaEstablisherService$3.class b/out/production/classes/network/impl/jxta/JxtaEstablisherService$3.class
new file mode 100644
index 00000000..1703b31d
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaEstablisherService$3.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaEstablisherService$ListenerWithParam.class b/out/production/classes/network/impl/jxta/JxtaEstablisherService$ListenerWithParam.class
new file mode 100644
index 00000000..981dd559
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaEstablisherService$ListenerWithParam.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaEstablisherService.class b/out/production/classes/network/impl/jxta/JxtaEstablisherService.class
new file mode 100644
index 00000000..888dd4c8
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaEstablisherService.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaItemService.class b/out/production/classes/network/impl/jxta/JxtaItemService.class
new file mode 100644
index 00000000..7eae827f
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaItemService.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaItemsSenderService$1.class b/out/production/classes/network/impl/jxta/JxtaItemsSenderService$1.class
new file mode 100644
index 00000000..1383bd17
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaItemsSenderService$1.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaItemsSenderService.class b/out/production/classes/network/impl/jxta/JxtaItemsSenderService.class
new file mode 100644
index 00000000..aa4cf8d7
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaItemsSenderService.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaMessageSenderService$1.class b/out/production/classes/network/impl/jxta/JxtaMessageSenderService$1.class
new file mode 100644
index 00000000..0aa1d6ec
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaMessageSenderService$1.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaMessageSenderService.class b/out/production/classes/network/impl/jxta/JxtaMessageSenderService.class
new file mode 100644
index 00000000..f61f850a
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaMessageSenderService.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaMessageService.class b/out/production/classes/network/impl/jxta/JxtaMessageService.class
new file mode 100644
index 00000000..5006a8ca
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaMessageService.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaNode.class b/out/production/classes/network/impl/jxta/JxtaNode.class
new file mode 100644
index 00000000..bdb4910e
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaNode.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaPeer.class b/out/production/classes/network/impl/jxta/JxtaPeer.class
new file mode 100644
index 00000000..2fa24b65
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaPeer.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaService.class b/out/production/classes/network/impl/jxta/JxtaService.class
new file mode 100644
index 00000000..d0988e15
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaService.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaSyncSearch.class b/out/production/classes/network/impl/jxta/JxtaSyncSearch.class
new file mode 100644
index 00000000..6a0a5078
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaSyncSearch.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaUserService.class b/out/production/classes/network/impl/jxta/JxtaUserService.class
new file mode 100644
index 00000000..01aab33f
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaUserService.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaUsersSenderService$1.class b/out/production/classes/network/impl/jxta/JxtaUsersSenderService$1.class
new file mode 100644
index 00000000..09c921e2
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaUsersSenderService$1.class differ
diff --git a/out/production/classes/network/impl/jxta/JxtaUsersSenderService.class b/out/production/classes/network/impl/jxta/JxtaUsersSenderService.class
new file mode 100644
index 00000000..2a6a22fa
Binary files /dev/null and b/out/production/classes/network/impl/jxta/JxtaUsersSenderService.class differ
diff --git a/out/production/classes/network/impl/messages/EstablisherMessage.class b/out/production/classes/network/impl/messages/EstablisherMessage.class
new file mode 100644
index 00000000..cc4b46f1
Binary files /dev/null and b/out/production/classes/network/impl/messages/EstablisherMessage.class differ
diff --git a/out/production/classes/network/impl/messages/RequestItemMessage.class b/out/production/classes/network/impl/messages/RequestItemMessage.class
new file mode 100644
index 00000000..9c8bff14
Binary files /dev/null and b/out/production/classes/network/impl/messages/RequestItemMessage.class differ
diff --git a/out/production/classes/network/impl/messages/RequestMessageUserMessage.class b/out/production/classes/network/impl/messages/RequestMessageUserMessage.class
new file mode 100644
index 00000000..8705cd7c
Binary files /dev/null and b/out/production/classes/network/impl/messages/RequestMessageUserMessage.class differ
diff --git a/out/production/classes/network/impl/messages/RequestUserMessage.class b/out/production/classes/network/impl/messages/RequestUserMessage.class
new file mode 100644
index 00000000..b88d90d6
Binary files /dev/null and b/out/production/classes/network/impl/messages/RequestUserMessage.class differ
diff --git a/out/production/classes/network/utils/IpChecker.class b/out/production/classes/network/utils/IpChecker.class
new file mode 100644
index 00000000..d12e70f3
Binary files /dev/null and b/out/production/classes/network/utils/IpChecker.class differ
diff --git a/out/production/classes/protocol/api/Establisher.class b/out/production/classes/protocol/api/Establisher.class
new file mode 100644
index 00000000..021a6baf
Binary files /dev/null and b/out/production/classes/protocol/api/Establisher.class differ
diff --git a/out/production/classes/protocol/api/EstablisherContract.class b/out/production/classes/protocol/api/EstablisherContract.class
new file mode 100644
index 00000000..774920cd
Binary files /dev/null and b/out/production/classes/protocol/api/EstablisherContract.class differ
diff --git a/out/production/classes/protocol/api/EstablisherListener.class b/out/production/classes/protocol/api/EstablisherListener.class
new file mode 100644
index 00000000..7cd9d35d
Binary files /dev/null and b/out/production/classes/protocol/api/EstablisherListener.class differ
diff --git a/out/production/classes/protocol/impl/SigmaEstablisher$1.class b/out/production/classes/protocol/impl/SigmaEstablisher$1.class
new file mode 100644
index 00000000..f234a2f5
Binary files /dev/null and b/out/production/classes/protocol/impl/SigmaEstablisher$1.class differ
diff --git a/out/production/classes/protocol/impl/SigmaEstablisher.class b/out/production/classes/protocol/impl/SigmaEstablisher.class
new file mode 100644
index 00000000..343b4da1
Binary files /dev/null and b/out/production/classes/protocol/impl/SigmaEstablisher.class differ
diff --git a/out/production/classes/protocol/impl/sigma/ElGamal.class b/out/production/classes/protocol/impl/sigma/ElGamal.class
new file mode 100644
index 00000000..e8864f9a
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/ElGamal.class differ
diff --git a/out/production/classes/protocol/impl/sigma/ElGamalEncrypt.class b/out/production/classes/protocol/impl/sigma/ElGamalEncrypt.class
new file mode 100644
index 00000000..bca7a9fc
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/ElGamalEncrypt.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Fabric.class b/out/production/classes/protocol/impl/sigma/Fabric.class
new file mode 100644
index 00000000..a3395aba
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Fabric.class differ
diff --git a/out/production/classes/protocol/impl/sigma/PCS.class b/out/production/classes/protocol/impl/sigma/PCS.class
new file mode 100644
index 00000000..001da6b0
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/PCS.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Receiver.class b/out/production/classes/protocol/impl/sigma/Receiver.class
new file mode 100644
index 00000000..59e72b58
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Receiver.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Sender.class b/out/production/classes/protocol/impl/sigma/Sender.class
new file mode 100644
index 00000000..2c9f9506
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Sender.class differ
diff --git a/out/production/classes/protocol/impl/sigma/SigmaClauses.class b/out/production/classes/protocol/impl/sigma/SigmaClauses.class
new file mode 100644
index 00000000..455b13ac
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/SigmaClauses.class differ
diff --git a/out/production/classes/protocol/impl/sigma/SigmaContract$1.class b/out/production/classes/protocol/impl/sigma/SigmaContract$1.class
new file mode 100644
index 00000000..bec4fc76
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/SigmaContract$1.class differ
diff --git a/out/production/classes/protocol/impl/sigma/SigmaContract$2.class b/out/production/classes/protocol/impl/sigma/SigmaContract$2.class
new file mode 100644
index 00000000..4fd77611
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/SigmaContract$2.class differ
diff --git a/out/production/classes/protocol/impl/sigma/SigmaContract.class b/out/production/classes/protocol/impl/sigma/SigmaContract.class
new file mode 100644
index 00000000..5cdc241c
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/SigmaContract.class differ
diff --git a/out/production/classes/protocol/impl/sigma/SigmaEstablisherData.class b/out/production/classes/protocol/impl/sigma/SigmaEstablisherData.class
new file mode 100644
index 00000000..efd60037
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/SigmaEstablisherData.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Trent$1.class b/out/production/classes/protocol/impl/sigma/Trent$1.class
new file mode 100644
index 00000000..03623097
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Trent$1.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Trent$2.class b/out/production/classes/protocol/impl/sigma/Trent$2.class
new file mode 100644
index 00000000..5c9a93d2
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Trent$2.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Trent$3.class b/out/production/classes/protocol/impl/sigma/Trent$3.class
new file mode 100644
index 00000000..8d59df7a
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Trent$3.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Trent$4.class b/out/production/classes/protocol/impl/sigma/Trent$4.class
new file mode 100644
index 00000000..1af72e8d
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Trent$4.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Trent$5.class b/out/production/classes/protocol/impl/sigma/Trent$5.class
new file mode 100644
index 00000000..276d64de
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Trent$5.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Trent$6.class b/out/production/classes/protocol/impl/sigma/Trent$6.class
new file mode 100644
index 00000000..e717bc05
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Trent$6.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Trent$7.class b/out/production/classes/protocol/impl/sigma/Trent$7.class
new file mode 100644
index 00000000..a672cc80
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Trent$7.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Trent$8.class b/out/production/classes/protocol/impl/sigma/Trent$8.class
new file mode 100644
index 00000000..0d228497
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Trent$8.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Trent.class b/out/production/classes/protocol/impl/sigma/Trent.class
new file mode 100644
index 00000000..f091a833
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Trent.class differ
diff --git a/out/production/classes/protocol/impl/sigma/TrentSolver$1.class b/out/production/classes/protocol/impl/sigma/TrentSolver$1.class
new file mode 100644
index 00000000..08996670
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/TrentSolver$1.class differ
diff --git a/out/production/classes/protocol/impl/sigma/TrentSolver$2.class b/out/production/classes/protocol/impl/sigma/TrentSolver$2.class
new file mode 100644
index 00000000..bf1c35b9
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/TrentSolver$2.class differ
diff --git a/out/production/classes/protocol/impl/sigma/TrentSolver$3.class b/out/production/classes/protocol/impl/sigma/TrentSolver$3.class
new file mode 100644
index 00000000..2a5e1903
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/TrentSolver$3.class differ
diff --git a/out/production/classes/protocol/impl/sigma/TrentSolver$4.class b/out/production/classes/protocol/impl/sigma/TrentSolver$4.class
new file mode 100644
index 00000000..85b35bcc
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/TrentSolver$4.class differ
diff --git a/out/production/classes/protocol/impl/sigma/TrentSolver$5.class b/out/production/classes/protocol/impl/sigma/TrentSolver$5.class
new file mode 100644
index 00000000..e9d30476
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/TrentSolver$5.class differ
diff --git a/out/production/classes/protocol/impl/sigma/TrentSolver.class b/out/production/classes/protocol/impl/sigma/TrentSolver.class
new file mode 100644
index 00000000..f2072a9d
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/TrentSolver.class differ
diff --git a/out/production/classes/protocol/impl/sigma/Utils.class b/out/production/classes/protocol/impl/sigma/Utils.class
new file mode 100644
index 00000000..73f93998
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/Utils.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent$1.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent$1.class
new file mode 100644
index 00000000..e6225660
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent$1.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent$2.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent$2.class
new file mode 100644
index 00000000..b500960e
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent$2.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent$3$1.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent$3$1.class
new file mode 100644
index 00000000..6f16846c
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent$3$1.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent$3.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent$3.class
new file mode 100644
index 00000000..0da85c05
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent$3.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent.class
new file mode 100644
index 00000000..0aa72b10
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolChooseTrent.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$1.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$1.class
new file mode 100644
index 00000000..69f9cb5c
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$1.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$2.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$2.class
new file mode 100644
index 00000000..0dd72c2d
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$2.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$3.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$3.class
new file mode 100644
index 00000000..ed76c292
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$3.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$4.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$4.class
new file mode 100644
index 00000000..3fc7c4f9
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$4.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5$1.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5$1.class
new file mode 100644
index 00000000..dbdb5d7d
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5$1.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5$2.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5$2.class
new file mode 100644
index 00000000..5dedf214
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5$2.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5$3.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5$3.class
new file mode 100644
index 00000000..5aeec72d
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5$3.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5$4.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5$4.class
new file mode 100644
index 00000000..c6a0061a
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5$4.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5.class
new file mode 100644
index 00000000..50028969
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve$5.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve.class
new file mode 100644
index 00000000..536f579a
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolResolve.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$1.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$1.class
new file mode 100644
index 00000000..33a69b5e
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$1.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$2.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$2.class
new file mode 100644
index 00000000..12de021a
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$2.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$3.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$3.class
new file mode 100644
index 00000000..6006c149
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$3.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$4.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$4.class
new file mode 100644
index 00000000..9ffcd36b
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$4.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$5.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$5.class
new file mode 100644
index 00000000..7c71b4d6
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$5.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$6.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$6.class
new file mode 100644
index 00000000..156721a7
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$6.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$7.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$7.class
new file mode 100644
index 00000000..c490bf08
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign$7.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolSign.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign.class
new file mode 100644
index 00000000..00c6f9d4
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolSign.class differ
diff --git a/out/production/classes/protocol/impl/sigma/steps/ProtocolStep.class b/out/production/classes/protocol/impl/sigma/steps/ProtocolStep.class
new file mode 100644
index 00000000..a62c3902
Binary files /dev/null and b/out/production/classes/protocol/impl/sigma/steps/ProtocolStep.class differ
diff --git a/out/production/classes/rest/api/Authentifier.class b/out/production/classes/rest/api/Authentifier.class
new file mode 100644
index 00000000..082fee50
Binary files /dev/null and b/out/production/classes/rest/api/Authentifier.class differ
diff --git a/out/production/classes/rest/api/RestServer.class b/out/production/classes/rest/api/RestServer.class
new file mode 100644
index 00000000..af938468
Binary files /dev/null and b/out/production/classes/rest/api/RestServer.class differ
diff --git a/out/production/classes/rest/api/ServletPath.class b/out/production/classes/rest/api/ServletPath.class
new file mode 100644
index 00000000..f2f2a896
Binary files /dev/null and b/out/production/classes/rest/api/ServletPath.class differ
diff --git a/out/production/classes/rest/factories/AuthentifierFactory.class b/out/production/classes/rest/factories/AuthentifierFactory.class
new file mode 100644
index 00000000..96dc41ab
Binary files /dev/null and b/out/production/classes/rest/factories/AuthentifierFactory.class differ
diff --git a/out/production/classes/rest/factories/RestServerFactory$1.class b/out/production/classes/rest/factories/RestServerFactory$1.class
new file mode 100644
index 00000000..78698db9
Binary files /dev/null and b/out/production/classes/rest/factories/RestServerFactory$1.class differ
diff --git a/out/production/classes/rest/factories/RestServerFactory.class b/out/production/classes/rest/factories/RestServerFactory.class
new file mode 100644
index 00000000..ebe4379a
Binary files /dev/null and b/out/production/classes/rest/factories/RestServerFactory.class differ
diff --git a/out/production/classes/rest/impl/JettyRestServer$1.class b/out/production/classes/rest/impl/JettyRestServer$1.class
new file mode 100644
index 00000000..b3b7be22
Binary files /dev/null and b/out/production/classes/rest/impl/JettyRestServer$1.class differ
diff --git a/out/production/classes/rest/impl/JettyRestServer.class b/out/production/classes/rest/impl/JettyRestServer.class
new file mode 100644
index 00000000..36198c32
Binary files /dev/null and b/out/production/classes/rest/impl/JettyRestServer.class differ
diff --git a/out/production/classes/rest/impl/SimpleAuthentifier$Logins.class b/out/production/classes/rest/impl/SimpleAuthentifier$Logins.class
new file mode 100644
index 00000000..c5f27c31
Binary files /dev/null and b/out/production/classes/rest/impl/SimpleAuthentifier$Logins.class differ
diff --git a/out/production/classes/rest/impl/SimpleAuthentifier.class b/out/production/classes/rest/impl/SimpleAuthentifier.class
new file mode 100644
index 00000000..a41ccae1
Binary files /dev/null and b/out/production/classes/rest/impl/SimpleAuthentifier.class differ
diff --git a/out/production/resources/META-INF/persistence.xml b/out/production/resources/META-INF/persistence.xml
new file mode 100644
index 00000000..75b0c48d
--- /dev/null
+++ b/out/production/resources/META-INF/persistence.xml
@@ -0,0 +1,25 @@
+
+
+
+ org.eclipse.persistence.jpa.PersistenceProvider
+ model.entity.Item
+ model.entity.User
+ model.entity.ContractEntity
+ model.entity.Message
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/out/production/resources/jetty-logging.properties b/out/production/resources/jetty-logging.properties
new file mode 100644
index 00000000..af1c30db
--- /dev/null
+++ b/out/production/resources/jetty-logging.properties
@@ -0,0 +1,5 @@
+# Setup logging implementation
+org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
+org.eclipse.jetty.LEVEL=INFO
+# Make websocket more verbose for testing
+#org.eclipse.jetty.websocket.LEVEL=DEBUG
diff --git a/out/production/resources/log4j2.xml b/out/production/resources/log4j2.xml
new file mode 100644
index 00000000..3a363c87
--- /dev/null
+++ b/out/production/resources/log4j2.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/out/test/classes/controller/ControllerTest$1.class b/out/test/classes/controller/ControllerTest$1.class
new file mode 100644
index 00000000..a50d0992
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$1.class differ
diff --git a/out/test/classes/controller/ControllerTest$10.class b/out/test/classes/controller/ControllerTest$10.class
new file mode 100644
index 00000000..94cbf7f8
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$10.class differ
diff --git a/out/test/classes/controller/ControllerTest$11.class b/out/test/classes/controller/ControllerTest$11.class
new file mode 100644
index 00000000..9c820dd4
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$11.class differ
diff --git a/out/test/classes/controller/ControllerTest$12.class b/out/test/classes/controller/ControllerTest$12.class
new file mode 100644
index 00000000..0a4c7a2a
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$12.class differ
diff --git a/out/test/classes/controller/ControllerTest$13.class b/out/test/classes/controller/ControllerTest$13.class
new file mode 100644
index 00000000..5ef510e3
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$13.class differ
diff --git a/out/test/classes/controller/ControllerTest$14.class b/out/test/classes/controller/ControllerTest$14.class
new file mode 100644
index 00000000..9a2a4472
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$14.class differ
diff --git a/out/test/classes/controller/ControllerTest$15.class b/out/test/classes/controller/ControllerTest$15.class
new file mode 100644
index 00000000..3c3e3b86
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$15.class differ
diff --git a/out/test/classes/controller/ControllerTest$16.class b/out/test/classes/controller/ControllerTest$16.class
new file mode 100644
index 00000000..de1c1ae9
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$16.class differ
diff --git a/out/test/classes/controller/ControllerTest$17.class b/out/test/classes/controller/ControllerTest$17.class
new file mode 100644
index 00000000..d5879180
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$17.class differ
diff --git a/out/test/classes/controller/ControllerTest$18.class b/out/test/classes/controller/ControllerTest$18.class
new file mode 100644
index 00000000..0b1a00da
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$18.class differ
diff --git a/out/test/classes/controller/ControllerTest$19.class b/out/test/classes/controller/ControllerTest$19.class
new file mode 100644
index 00000000..1ea59c3a
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$19.class differ
diff --git a/out/test/classes/controller/ControllerTest$2.class b/out/test/classes/controller/ControllerTest$2.class
new file mode 100644
index 00000000..5de9cc75
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$2.class differ
diff --git a/out/test/classes/controller/ControllerTest$20.class b/out/test/classes/controller/ControllerTest$20.class
new file mode 100644
index 00000000..89151e28
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$20.class differ
diff --git a/out/test/classes/controller/ControllerTest$21.class b/out/test/classes/controller/ControllerTest$21.class
new file mode 100644
index 00000000..3c548ad6
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$21.class differ
diff --git a/out/test/classes/controller/ControllerTest$22.class b/out/test/classes/controller/ControllerTest$22.class
new file mode 100644
index 00000000..0887165c
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$22.class differ
diff --git a/out/test/classes/controller/ControllerTest$23.class b/out/test/classes/controller/ControllerTest$23.class
new file mode 100644
index 00000000..578c51e5
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$23.class differ
diff --git a/out/test/classes/controller/ControllerTest$3.class b/out/test/classes/controller/ControllerTest$3.class
new file mode 100644
index 00000000..530c24b4
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$3.class differ
diff --git a/out/test/classes/controller/ControllerTest$4.class b/out/test/classes/controller/ControllerTest$4.class
new file mode 100644
index 00000000..8e3137d2
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$4.class differ
diff --git a/out/test/classes/controller/ControllerTest$5.class b/out/test/classes/controller/ControllerTest$5.class
new file mode 100644
index 00000000..161563e7
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$5.class differ
diff --git a/out/test/classes/controller/ControllerTest$6.class b/out/test/classes/controller/ControllerTest$6.class
new file mode 100644
index 00000000..39493277
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$6.class differ
diff --git a/out/test/classes/controller/ControllerTest$7.class b/out/test/classes/controller/ControllerTest$7.class
new file mode 100644
index 00000000..0d9d3ef7
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$7.class differ
diff --git a/out/test/classes/controller/ControllerTest$8.class b/out/test/classes/controller/ControllerTest$8.class
new file mode 100644
index 00000000..6d5b34a0
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$8.class differ
diff --git a/out/test/classes/controller/ControllerTest$9.class b/out/test/classes/controller/ControllerTest$9.class
new file mode 100644
index 00000000..5f1d5b09
Binary files /dev/null and b/out/test/classes/controller/ControllerTest$9.class differ
diff --git a/out/test/classes/controller/ControllerTest.class b/out/test/classes/controller/ControllerTest.class
new file mode 100644
index 00000000..4ca78c2d
Binary files /dev/null and b/out/test/classes/controller/ControllerTest.class differ
diff --git a/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$1.class b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$1.class
new file mode 100644
index 00000000..ab2a71ac
Binary files /dev/null and b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$1.class differ
diff --git a/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$2.class b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$2.class
new file mode 100644
index 00000000..0b14e743
Binary files /dev/null and b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$2.class differ
diff --git a/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$3.class b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$3.class
new file mode 100644
index 00000000..eaa8fc03
Binary files /dev/null and b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$3.class differ
diff --git a/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$4.class b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$4.class
new file mode 100644
index 00000000..9ea82c54
Binary files /dev/null and b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$4.class differ
diff --git a/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$5.class b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$5.class
new file mode 100644
index 00000000..4c2bc22b
Binary files /dev/null and b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$5.class differ
diff --git a/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$6.class b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$6.class
new file mode 100644
index 00000000..0a2875e4
Binary files /dev/null and b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest$6.class differ
diff --git a/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest.class b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest.class
new file mode 100644
index 00000000..404dc8d3
Binary files /dev/null and b/out/test/classes/controller/managers/CryptoItemManagerDecoratorTest.class differ
diff --git a/out/test/classes/controller/managers/CryptoMessageManagerDecoratorTest$1.class b/out/test/classes/controller/managers/CryptoMessageManagerDecoratorTest$1.class
new file mode 100644
index 00000000..a6104d39
Binary files /dev/null and b/out/test/classes/controller/managers/CryptoMessageManagerDecoratorTest$1.class differ
diff --git a/out/test/classes/controller/managers/CryptoMessageManagerDecoratorTest.class b/out/test/classes/controller/managers/CryptoMessageManagerDecoratorTest.class
new file mode 100644
index 00000000..f796ae56
Binary files /dev/null and b/out/test/classes/controller/managers/CryptoMessageManagerDecoratorTest.class differ
diff --git a/out/test/classes/controller/managers/CryptoUserManagerDecoratorTest.class b/out/test/classes/controller/managers/CryptoUserManagerDecoratorTest.class
new file mode 100644
index 00000000..768e4ef4
Binary files /dev/null and b/out/test/classes/controller/managers/CryptoUserManagerDecoratorTest.class differ
diff --git a/out/test/classes/crypt/ElGamalEngineTestK.class b/out/test/classes/crypt/ElGamalEngineTestK.class
new file mode 100644
index 00000000..40189de6
Binary files /dev/null and b/out/test/classes/crypt/ElGamalEngineTestK.class differ
diff --git a/out/test/classes/crypt/api/hashs/HasherTest$ToyHashable.class b/out/test/classes/crypt/api/hashs/HasherTest$ToyHashable.class
new file mode 100644
index 00000000..ae9b6cb3
Binary files /dev/null and b/out/test/classes/crypt/api/hashs/HasherTest$ToyHashable.class differ
diff --git a/out/test/classes/crypt/api/hashs/HasherTest.class b/out/test/classes/crypt/api/hashs/HasherTest.class
new file mode 100644
index 00000000..41fc96c2
Binary files /dev/null and b/out/test/classes/crypt/api/hashs/HasherTest.class differ
diff --git a/out/test/classes/crypt/api/key/AsymKeyTest.class b/out/test/classes/crypt/api/key/AsymKeyTest.class
new file mode 100644
index 00000000..bf7be5f8
Binary files /dev/null and b/out/test/classes/crypt/api/key/AsymKeyTest.class differ
diff --git a/out/test/classes/crypt/base/BaseSignatureTest.class b/out/test/classes/crypt/base/BaseSignatureTest.class
new file mode 100644
index 00000000..dfbcf169
Binary files /dev/null and b/out/test/classes/crypt/base/BaseSignatureTest.class differ
diff --git a/out/test/classes/crypt/impl/TestCrypt.class b/out/test/classes/crypt/impl/TestCrypt.class
new file mode 100644
index 00000000..924f6d82
Binary files /dev/null and b/out/test/classes/crypt/impl/TestCrypt.class differ
diff --git a/out/test/classes/crypt/impl/certificate/X509V3GeneratorTest.class b/out/test/classes/crypt/impl/certificate/X509V3GeneratorTest.class
new file mode 100644
index 00000000..8af32ce7
Binary files /dev/null and b/out/test/classes/crypt/impl/certificate/X509V3GeneratorTest.class differ
diff --git a/out/test/classes/crypt/impl/encryption/ElGamalEncrypterTest.class b/out/test/classes/crypt/impl/encryption/ElGamalEncrypterTest.class
new file mode 100644
index 00000000..87fc008b
Binary files /dev/null and b/out/test/classes/crypt/impl/encryption/ElGamalEncrypterTest.class differ
diff --git a/out/test/classes/crypt/impl/encryption/SerpentEncrypterTest.class b/out/test/classes/crypt/impl/encryption/SerpentEncrypterTest.class
new file mode 100644
index 00000000..b7bc5297
Binary files /dev/null and b/out/test/classes/crypt/impl/encryption/SerpentEncrypterTest.class differ
diff --git a/out/test/classes/crypt/impl/hashs/SHA256HasherTest.class b/out/test/classes/crypt/impl/hashs/SHA256HasherTest.class
new file mode 100644
index 00000000..597feeff
Binary files /dev/null and b/out/test/classes/crypt/impl/hashs/SHA256HasherTest.class differ
diff --git a/out/test/classes/crypt/impl/key/ElGamalAsymKeyTest.class b/out/test/classes/crypt/impl/key/ElGamalAsymKeyTest.class
new file mode 100644
index 00000000..77616b5e
Binary files /dev/null and b/out/test/classes/crypt/impl/key/ElGamalAsymKeyTest.class differ
diff --git a/out/test/classes/crypt/impl/signatures/ElGamalSignatureTest.class b/out/test/classes/crypt/impl/signatures/ElGamalSignatureTest.class
new file mode 100644
index 00000000..60cc2b27
Binary files /dev/null and b/out/test/classes/crypt/impl/signatures/ElGamalSignatureTest.class differ
diff --git a/out/test/classes/crypt/impl/signatures/ElGamalSignerTest.class b/out/test/classes/crypt/impl/signatures/ElGamalSignerTest.class
new file mode 100644
index 00000000..28f5af7f
Binary files /dev/null and b/out/test/classes/crypt/impl/signatures/ElGamalSignerTest.class differ
diff --git a/out/test/classes/crypt/impl/signatures/SigmaSignatureTest$1.class b/out/test/classes/crypt/impl/signatures/SigmaSignatureTest$1.class
new file mode 100644
index 00000000..5a9d4cec
Binary files /dev/null and b/out/test/classes/crypt/impl/signatures/SigmaSignatureTest$1.class differ
diff --git a/out/test/classes/crypt/impl/signatures/SigmaSignatureTest$2.class b/out/test/classes/crypt/impl/signatures/SigmaSignatureTest$2.class
new file mode 100644
index 00000000..8badac10
Binary files /dev/null and b/out/test/classes/crypt/impl/signatures/SigmaSignatureTest$2.class differ
diff --git a/out/test/classes/crypt/impl/signatures/SigmaSignatureTest$3.class b/out/test/classes/crypt/impl/signatures/SigmaSignatureTest$3.class
new file mode 100644
index 00000000..59cfb17e
Binary files /dev/null and b/out/test/classes/crypt/impl/signatures/SigmaSignatureTest$3.class differ
diff --git a/out/test/classes/crypt/impl/signatures/SigmaSignatureTest.class b/out/test/classes/crypt/impl/signatures/SigmaSignatureTest.class
new file mode 100644
index 00000000..8de8a0cd
Binary files /dev/null and b/out/test/classes/crypt/impl/signatures/SigmaSignatureTest.class differ
diff --git a/out/test/classes/crypt/impl/signatures/SigmaSignerTest.class b/out/test/classes/crypt/impl/signatures/SigmaSignerTest.class
new file mode 100644
index 00000000..7ed7b42b
Binary files /dev/null and b/out/test/classes/crypt/impl/signatures/SigmaSignerTest.class differ
diff --git a/out/test/classes/crypt/utils/BigIntegerRandomTest.class b/out/test/classes/crypt/utils/BigIntegerRandomTest.class
new file mode 100644
index 00000000..c63a3bc2
Binary files /dev/null and b/out/test/classes/crypt/utils/BigIntegerRandomTest.class differ
diff --git a/out/test/classes/crypt/utils/CryptoParserTest.class b/out/test/classes/crypt/utils/CryptoParserTest.class
new file mode 100644
index 00000000..896b8ce1
Binary files /dev/null and b/out/test/classes/crypt/utils/CryptoParserTest.class differ
diff --git a/out/test/classes/model/entity/ElGamalKeyTest.class b/out/test/classes/model/entity/ElGamalKeyTest.class
new file mode 100644
index 00000000..8ac2a9be
Binary files /dev/null and b/out/test/classes/model/entity/ElGamalKeyTest.class differ
diff --git a/out/test/classes/model/entity/ElGamalSignEntityTest.class b/out/test/classes/model/entity/ElGamalSignEntityTest.class
new file mode 100644
index 00000000..6548242f
Binary files /dev/null and b/out/test/classes/model/entity/ElGamalSignEntityTest.class differ
diff --git a/out/test/classes/model/entity/ItemTest.class b/out/test/classes/model/entity/ItemTest.class
new file mode 100644
index 00000000..49c34573
Binary files /dev/null and b/out/test/classes/model/entity/ItemTest.class differ
diff --git a/out/test/classes/model/entity/LoginTokenTest.class b/out/test/classes/model/entity/LoginTokenTest.class
new file mode 100644
index 00000000..2fb86e1f
Binary files /dev/null and b/out/test/classes/model/entity/LoginTokenTest.class differ
diff --git a/out/test/classes/model/entity/UserTest.class b/out/test/classes/model/entity/UserTest.class
new file mode 100644
index 00000000..6d3d7b5f
Binary files /dev/null and b/out/test/classes/model/entity/UserTest.class differ
diff --git a/out/test/classes/model/entity/sigma/AndTest.class b/out/test/classes/model/entity/sigma/AndTest.class
new file mode 100644
index 00000000..0176f3fc
Binary files /dev/null and b/out/test/classes/model/entity/sigma/AndTest.class differ
diff --git a/out/test/classes/model/entity/sigma/MasksTest.class b/out/test/classes/model/entity/sigma/MasksTest.class
new file mode 100644
index 00000000..4847ab7c
Binary files /dev/null and b/out/test/classes/model/entity/sigma/MasksTest.class differ
diff --git a/out/test/classes/model/entity/sigma/OrTest.class b/out/test/classes/model/entity/sigma/OrTest.class
new file mode 100644
index 00000000..7188121a
Binary files /dev/null and b/out/test/classes/model/entity/sigma/OrTest.class differ
diff --git a/out/test/classes/model/entity/sigma/ResEncryptTest.class b/out/test/classes/model/entity/sigma/ResEncryptTest.class
new file mode 100644
index 00000000..e511f47b
Binary files /dev/null and b/out/test/classes/model/entity/sigma/ResEncryptTest.class differ
diff --git a/out/test/classes/model/entity/sigma/ResponsesCCDTest.class b/out/test/classes/model/entity/sigma/ResponsesCCDTest.class
new file mode 100644
index 00000000..b3310065
Binary files /dev/null and b/out/test/classes/model/entity/sigma/ResponsesCCDTest.class differ
diff --git a/out/test/classes/model/entity/sigma/ResponsesCCETest.class b/out/test/classes/model/entity/sigma/ResponsesCCETest.class
new file mode 100644
index 00000000..7b7c90f4
Binary files /dev/null and b/out/test/classes/model/entity/sigma/ResponsesCCETest.class differ
diff --git a/out/test/classes/model/entity/sigma/ResponsesSchnorrTest.class b/out/test/classes/model/entity/sigma/ResponsesSchnorrTest.class
new file mode 100644
index 00000000..78c9dfcc
Binary files /dev/null and b/out/test/classes/model/entity/sigma/ResponsesSchnorrTest.class differ
diff --git a/out/test/classes/model/syncManager/ItemSyncManagerImplTest.class b/out/test/classes/model/syncManager/ItemSyncManagerImplTest.class
new file mode 100644
index 00000000..ad395f2b
Binary files /dev/null and b/out/test/classes/model/syncManager/ItemSyncManagerImplTest.class differ
diff --git a/out/test/classes/model/syncManager/MessageSyncManagerImplTest.class b/out/test/classes/model/syncManager/MessageSyncManagerImplTest.class
new file mode 100644
index 00000000..53f599dc
Binary files /dev/null and b/out/test/classes/model/syncManager/MessageSyncManagerImplTest.class differ
diff --git a/out/test/classes/model/syncManager/UserSyncManagerImplTest.class b/out/test/classes/model/syncManager/UserSyncManagerImplTest.class
new file mode 100644
index 00000000..7b471b9c
Binary files /dev/null and b/out/test/classes/model/syncManager/UserSyncManagerImplTest.class differ
diff --git a/out/test/classes/model/validator/ItemValidatorTest.class b/out/test/classes/model/validator/ItemValidatorTest.class
new file mode 100644
index 00000000..7a5a4be6
Binary files /dev/null and b/out/test/classes/model/validator/ItemValidatorTest.class differ
diff --git a/out/test/classes/model/validator/UserValidatorTest.class b/out/test/classes/model/validator/UserValidatorTest.class
new file mode 100644
index 00000000..638be40f
Binary files /dev/null and b/out/test/classes/model/validator/UserValidatorTest.class differ
diff --git a/out/test/classes/network/impl/EstablisherServiceTest$1.class b/out/test/classes/network/impl/EstablisherServiceTest$1.class
new file mode 100644
index 00000000..9f8783d8
Binary files /dev/null and b/out/test/classes/network/impl/EstablisherServiceTest$1.class differ
diff --git a/out/test/classes/network/impl/EstablisherServiceTest$Key.class b/out/test/classes/network/impl/EstablisherServiceTest$Key.class
new file mode 100644
index 00000000..b531ba1c
Binary files /dev/null and b/out/test/classes/network/impl/EstablisherServiceTest$Key.class differ
diff --git a/out/test/classes/network/impl/EstablisherServiceTest.class b/out/test/classes/network/impl/EstablisherServiceTest.class
new file mode 100644
index 00000000..cdf03930
Binary files /dev/null and b/out/test/classes/network/impl/EstablisherServiceTest.class differ
diff --git a/out/test/classes/network/impl/MessagesGenericTest.class b/out/test/classes/network/impl/MessagesGenericTest.class
new file mode 100644
index 00000000..2b88b149
Binary files /dev/null and b/out/test/classes/network/impl/MessagesGenericTest.class differ
diff --git a/out/test/classes/network/impl/advertisement/ItemAdvertisementTest.class b/out/test/classes/network/impl/advertisement/ItemAdvertisementTest.class
new file mode 100644
index 00000000..963fccdf
Binary files /dev/null and b/out/test/classes/network/impl/advertisement/ItemAdvertisementTest.class differ
diff --git a/out/test/classes/network/impl/advertisement/PeerAdvertisementTest.class b/out/test/classes/network/impl/advertisement/PeerAdvertisementTest.class
new file mode 100644
index 00000000..611a6dd4
Binary files /dev/null and b/out/test/classes/network/impl/advertisement/PeerAdvertisementTest.class differ
diff --git a/out/test/classes/network/impl/advertisement/UserAdvertisementTest.class b/out/test/classes/network/impl/advertisement/UserAdvertisementTest.class
new file mode 100644
index 00000000..cfdab433
Binary files /dev/null and b/out/test/classes/network/impl/advertisement/UserAdvertisementTest.class differ
diff --git a/out/test/classes/network/impl/jxta/AdvertisementInstaciatorTest.class b/out/test/classes/network/impl/jxta/AdvertisementInstaciatorTest.class
new file mode 100644
index 00000000..430ad2a9
Binary files /dev/null and b/out/test/classes/network/impl/jxta/AdvertisementInstaciatorTest.class differ
diff --git a/out/test/classes/network/impl/jxta/JxtaAdvertisementTest.class b/out/test/classes/network/impl/jxta/JxtaAdvertisementTest.class
new file mode 100644
index 00000000..0ffc8679
Binary files /dev/null and b/out/test/classes/network/impl/jxta/JxtaAdvertisementTest.class differ
diff --git a/out/test/classes/network/impl/jxta/JxtaItemServiceTest.class b/out/test/classes/network/impl/jxta/JxtaItemServiceTest.class
new file mode 100644
index 00000000..d7e3c1f4
Binary files /dev/null and b/out/test/classes/network/impl/jxta/JxtaItemServiceTest.class differ
diff --git a/out/test/classes/network/impl/jxta/JxtaNodeTest.class b/out/test/classes/network/impl/jxta/JxtaNodeTest.class
new file mode 100644
index 00000000..aceb1927
Binary files /dev/null and b/out/test/classes/network/impl/jxta/JxtaNodeTest.class differ
diff --git a/out/test/classes/network/impl/jxta/JxtaServiceTest.class b/out/test/classes/network/impl/jxta/JxtaServiceTest.class
new file mode 100644
index 00000000..873ea4a6
Binary files /dev/null and b/out/test/classes/network/impl/jxta/JxtaServiceTest.class differ
diff --git a/out/test/classes/network/impl/messages/RequestItemMessageTest.class b/out/test/classes/network/impl/messages/RequestItemMessageTest.class
new file mode 100644
index 00000000..245ffeb0
Binary files /dev/null and b/out/test/classes/network/impl/messages/RequestItemMessageTest.class differ
diff --git a/out/test/classes/network/utils/IpCheckerTest.class b/out/test/classes/network/utils/IpCheckerTest.class
new file mode 100644
index 00000000..bbd70be5
Binary files /dev/null and b/out/test/classes/network/utils/IpCheckerTest.class differ
diff --git a/out/test/classes/protocol/impl/SigmaEstablisherFailer.class b/out/test/classes/protocol/impl/SigmaEstablisherFailer.class
new file mode 100644
index 00000000..a2ba1c4f
Binary files /dev/null and b/out/test/classes/protocol/impl/SigmaEstablisherFailer.class differ
diff --git a/out/test/classes/protocol/impl/SigmaEstablisherTest.class b/out/test/classes/protocol/impl/SigmaEstablisherTest.class
new file mode 100644
index 00000000..279d1b9e
Binary files /dev/null and b/out/test/classes/protocol/impl/SigmaEstablisherTest.class differ
diff --git a/out/test/classes/protocol/impl/sigma/ElGamalEncryptTest.class b/out/test/classes/protocol/impl/sigma/ElGamalEncryptTest.class
new file mode 100644
index 00000000..52b6f531
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/ElGamalEncryptTest.class differ
diff --git a/out/test/classes/protocol/impl/sigma/ElGamalTest.class b/out/test/classes/protocol/impl/sigma/ElGamalTest.class
new file mode 100644
index 00000000..563391c8
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/ElGamalTest.class differ
diff --git a/out/test/classes/protocol/impl/sigma/FabricTest.class b/out/test/classes/protocol/impl/sigma/FabricTest.class
new file mode 100644
index 00000000..252df51d
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/FabricTest.class differ
diff --git a/out/test/classes/protocol/impl/sigma/PCSTest.class b/out/test/classes/protocol/impl/sigma/PCSTest.class
new file mode 100644
index 00000000..1629482d
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/PCSTest.class differ
diff --git a/out/test/classes/protocol/impl/sigma/ReceiverTest.class b/out/test/classes/protocol/impl/sigma/ReceiverTest.class
new file mode 100644
index 00000000..37ba51ae
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/ReceiverTest.class differ
diff --git a/out/test/classes/protocol/impl/sigma/SenderReceiverTest.class b/out/test/classes/protocol/impl/sigma/SenderReceiverTest.class
new file mode 100644
index 00000000..910da320
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/SenderReceiverTest.class differ
diff --git a/out/test/classes/protocol/impl/sigma/SenderTest.class b/out/test/classes/protocol/impl/sigma/SenderTest.class
new file mode 100644
index 00000000..7f808e3f
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/SenderTest.class differ
diff --git a/out/test/classes/protocol/impl/sigma/SigmaClausesTest.class b/out/test/classes/protocol/impl/sigma/SigmaClausesTest.class
new file mode 100644
index 00000000..68f1703c
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/SigmaClausesTest.class differ
diff --git a/out/test/classes/protocol/impl/sigma/SigmaContractTest$1.class b/out/test/classes/protocol/impl/sigma/SigmaContractTest$1.class
new file mode 100644
index 00000000..5f2d12a7
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/SigmaContractTest$1.class differ
diff --git a/out/test/classes/protocol/impl/sigma/SigmaContractTest$Clauses.class b/out/test/classes/protocol/impl/sigma/SigmaContractTest$Clauses.class
new file mode 100644
index 00000000..1c038e48
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/SigmaContractTest$Clauses.class differ
diff --git a/out/test/classes/protocol/impl/sigma/SigmaContractTest.class b/out/test/classes/protocol/impl/sigma/SigmaContractTest.class
new file mode 100644
index 00000000..24743947
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/SigmaContractTest.class differ
diff --git a/out/test/classes/protocol/impl/sigma/TrentTest.class b/out/test/classes/protocol/impl/sigma/TrentTest.class
new file mode 100644
index 00000000..0cacc986
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/TrentTest.class differ
diff --git a/out/test/classes/protocol/impl/sigma/UtilsTest.class b/out/test/classes/protocol/impl/sigma/UtilsTest.class
new file mode 100644
index 00000000..b82dec53
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/UtilsTest.class differ
diff --git a/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer$1.class b/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer$1.class
new file mode 100644
index 00000000..d98b2b58
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer$1.class differ
diff --git a/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer$2.class b/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer$2.class
new file mode 100644
index 00000000..288427d6
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer$2.class differ
diff --git a/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer$3.class b/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer$3.class
new file mode 100644
index 00000000..5a587513
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer$3.class differ
diff --git a/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer$4.class b/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer$4.class
new file mode 100644
index 00000000..55e5bf81
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer$4.class differ
diff --git a/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer.class b/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer.class
new file mode 100644
index 00000000..83163222
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/step/ProtocolResolveFailer.class differ
diff --git a/out/test/classes/protocol/impl/sigma/step/ProtocolSignFailer$1.class b/out/test/classes/protocol/impl/sigma/step/ProtocolSignFailer$1.class
new file mode 100644
index 00000000..0218c59a
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/step/ProtocolSignFailer$1.class differ
diff --git a/out/test/classes/protocol/impl/sigma/step/ProtocolSignFailer.class b/out/test/classes/protocol/impl/sigma/step/ProtocolSignFailer.class
new file mode 100644
index 00000000..be000346
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/step/ProtocolSignFailer.class differ
diff --git a/out/test/classes/protocol/impl/sigma/step/ProtocolSignFailerLiar$1.class b/out/test/classes/protocol/impl/sigma/step/ProtocolSignFailerLiar$1.class
new file mode 100644
index 00000000..4cb93d5e
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/step/ProtocolSignFailerLiar$1.class differ
diff --git a/out/test/classes/protocol/impl/sigma/step/ProtocolSignFailerLiar.class b/out/test/classes/protocol/impl/sigma/step/ProtocolSignFailerLiar.class
new file mode 100644
index 00000000..513d8163
Binary files /dev/null and b/out/test/classes/protocol/impl/sigma/step/ProtocolSignFailerLiar.class differ
diff --git a/out/test/classes/rest/impl/SimpleAuthentifierTest.class b/out/test/classes/rest/impl/SimpleAuthentifierTest.class
new file mode 100644
index 00000000..29d0c9a4
Binary files /dev/null and b/out/test/classes/rest/impl/SimpleAuthentifierTest.class differ
diff --git a/out/test/classes/util/TestInputGenerator.class b/out/test/classes/util/TestInputGenerator.class
new file mode 100644
index 00000000..ee46a3e6
Binary files /dev/null and b/out/test/classes/util/TestInputGenerator.class differ
diff --git a/out/test/classes/util/TestUtils.class b/out/test/classes/util/TestUtils.class
new file mode 100644
index 00000000..b1d1b17b
Binary files /dev/null and b/out/test/classes/util/TestUtils.class differ
diff --git a/out/test/classes/util/TrustModifier$1.class b/out/test/classes/util/TrustModifier$1.class
new file mode 100644
index 00000000..f1321338
Binary files /dev/null and b/out/test/classes/util/TrustModifier$1.class differ
diff --git a/out/test/classes/util/TrustModifier$AlwaysTrustManager.class b/out/test/classes/util/TrustModifier$AlwaysTrustManager.class
new file mode 100644
index 00000000..8d0e4b43
Binary files /dev/null and b/out/test/classes/util/TrustModifier$AlwaysTrustManager.class differ
diff --git a/out/test/classes/util/TrustModifier$TrustingHostnameVerifier.class b/out/test/classes/util/TrustModifier$TrustingHostnameVerifier.class
new file mode 100644
index 00000000..d9db779a
Binary files /dev/null and b/out/test/classes/util/TrustModifier$TrustingHostnameVerifier.class differ
diff --git a/out/test/classes/util/TrustModifier.class b/out/test/classes/util/TrustModifier.class
new file mode 100644
index 00000000..da4390d9
Binary files /dev/null and b/out/test/classes/util/TrustModifier.class differ
diff --git a/out/test/resources/resources.xml b/out/test/resources/resources.xml
new file mode 100644
index 00000000..e69de29b
diff --git a/src/.DS_Store b/src/.DS_Store
new file mode 100644
index 00000000..ac9d0726
Binary files /dev/null and b/src/.DS_Store differ
diff --git a/src/main/.DS_Store b/src/main/.DS_Store
new file mode 100644
index 00000000..fa398650
Binary files /dev/null and b/src/main/.DS_Store differ
diff --git a/src/main/java/controller/Application.java b/src/main/java/controller/Application.java
index 11c50281..c71cd840 100644
--- a/src/main/java/controller/Application.java
+++ b/src/main/java/controller/Application.java
@@ -13,78 +13,77 @@
/**
* Main class
* {@link Application} is a singleton
- * @author Julien Prudhomme
*
+ * @author Julien Prudhomme
*/
public class Application {
- public final static int jxtaPort = 9800;
- public final static int restPort = 8081;
- public final static String[] rdvPeerIds = {"tcp://145.239.76.112:9800","tcp://localhost:9800"};
-
- private static Application instance = null;
- private static UserSyncManagerImpl umg;
- private Peer peer;
- private Authentifier auth;
-
-
-
- public Application() {
- if(instance != null) {
- throw new RuntimeException("Application can be instanciate only once !");
- }
- instance = this;
- }
-
- public static Application getInstance() {
- return instance;
- }
-
- public void run() {
- setPeer(PeerFactory.createDefaultAndStartPeer());
- setAuth(AuthentifierFactory.createDefaultAuthentifier());
- RestServerFactory.createAndStartDefaultRestServer(restPort); //start the rest api
- }
-
- public void runForTests(int restPort) {
- Properties p = System.getProperties();
- p.put("derby.system.home", "./.db-" + restPort + "/");
- umg = new UserSyncManagerImpl(); //just init the db
- umg.close();
- umg = null;
- try {
- setPeer(PeerFactory.createDefaultAndStartPeerForTest());
- setAuth(AuthentifierFactory.createDefaultAuthentifier());
- RestServerFactory.createAndStartDefaultRestServer(restPort);
- } catch (Exception e) {
- LoggerUtilities.logStackTrace(e);
- }
- }
-
- public static void main(String[] args) {
- new Application();
-
- Application.getInstance().runForTests(restPort);
-
- }
-
- public void stop(){
- peer.stop();
- instance = null;
- }
-
- public Peer getPeer() {
- return peer;
- }
-
- public void setPeer(Peer peer) {
- this.peer = peer;
- }
-
- public Authentifier getAuth() {
- return auth;
- }
-
- public void setAuth(Authentifier auth) {
- this.auth = auth;
- }
+ public final static int jxtaPort = 9800;
+ public final static int restPort = 8081;
+ public final static String[] rdvPeerIds = {"tcp://145.239.76.112:9800", "tcp://localhost:9800"};
+
+ private static Application instance = null;
+ private static UserSyncManagerImpl umg;
+ private Peer peer;
+ private Authentifier auth;
+
+
+ public Application() {
+ if (instance != null) {
+ throw new RuntimeException("Application can be instanciate only once !");
+ }
+ instance = this;
+ }
+
+ public static Application getInstance() {
+ return instance;
+ }
+
+ public static void main(String[] args) {
+ new Application();
+
+ Application.getInstance().runForTests(restPort);
+
+ }
+
+ public void run() {
+ setPeer(PeerFactory.createDefaultAndStartPeer());
+ setAuth(AuthentifierFactory.createDefaultAuthentifier());
+ RestServerFactory.createAndStartDefaultRestServer(restPort); //start the rest api
+ }
+
+ public void runForTests(int restPort) {
+ Properties p = System.getProperties();
+ p.put("derby.system.home", "./.db-" + restPort + "/");
+ umg = new UserSyncManagerImpl(); //just init the db
+ umg.close();
+ umg = null;
+ try {
+ setPeer(PeerFactory.createDefaultAndStartPeerForTest());
+ setAuth(AuthentifierFactory.createDefaultAuthentifier());
+ RestServerFactory.createAndStartDefaultRestServer(restPort);
+ } catch (Exception e) {
+ LoggerUtilities.logStackTrace(e);
+ }
+ }
+
+ public void stop() {
+ peer.stop();
+ instance = null;
+ }
+
+ public Peer getPeer() {
+ return peer;
+ }
+
+ public void setPeer(Peer peer) {
+ this.peer = peer;
+ }
+
+ public Authentifier getAuth() {
+ return auth;
+ }
+
+ public void setAuth(Authentifier auth) {
+ this.auth = auth;
+ }
}
diff --git a/src/main/java/controller/CASingingRequest.java b/src/main/java/controller/CASingingRequest.java
index 68cb1c6e..d29a3cbd 100644
--- a/src/main/java/controller/CASingingRequest.java
+++ b/src/main/java/controller/CASingingRequest.java
@@ -11,19 +11,16 @@
@ServletPath("/.well-know/acme-challenge/*")
@Path("/")
-public class CASingingRequest {
- @GET
- @Path("/{input}")
- public String hash(@PathParam("input") String input) throws Exception
- {
- //Send the file for the CA. (let's encrypt)
- File file = new File("." + input);
- if( file.exists() )
- {
- String res = new String(Files.readAllBytes(file.toPath()));
- return res;
- }
- else
- return "404 not found";
+public class CASingingRequest {
+ @GET
+ @Path("/{input}")
+ public String hash(@PathParam("input") String input) throws Exception {
+ //Send the file for the CA. (let's encrypt)
+ File file = new File("." + input);
+ if (file.exists()) {
+ String res = new String(Files.readAllBytes(file.toPath()));
+ return res;
+ } else
+ return "404 not found";
}
}
diff --git a/src/main/java/controller/Contracts.java b/src/main/java/controller/Contracts.java
index 3d21d52a..7dbbabda 100644
--- a/src/main/java/controller/Contracts.java
+++ b/src/main/java/controller/Contracts.java
@@ -49,6 +49,7 @@ public String add(ContractEntity contract, @HeaderParam(Authentifier.PARAM_NAME)
Manager em = ManagerFactory.createNetworkResilianceContractManager(Application.getInstance().getPeer(), token);
Authentifier auth = Application.getInstance().getAuth();
UserSyncManager users = SyncManagerFactory.createUserSyncManager();
+ HashMap wishes = new HashMap<>();
User currentUser = users.getUser(auth.getLogin(token), auth.getPassword(token));
users.close();
@@ -66,7 +67,9 @@ public String add(ContractEntity contract, @HeaderParam(Authentifier.PARAM_NAME)
for (String id : parties){
User u = json3.toEntity(us.get(id));
partiesNames.put(id, u.getNick());
+ wishes.put(u.getNick(),Wish.NEUTRAL);
}
+
//TODO VALIDATION / VERIFICATION
for (int k=0; k parties = c.getParties();
HashMap partiesNames = new HashMap();
-
if (parties != null){
JsonTools json3 = new JsonTools<>(new TypeReference(){});
Users us = new Users();
@@ -139,7 +144,7 @@ public String edit(ContractEntity c, @HeaderParam(Authentifier.PARAM_NAME) Strin
partiesNames.put(id, u.getNick());
}
}
-
+
SyncManager em = new ContractSyncManagerImpl();
em.begin();
@@ -148,7 +153,10 @@ public String edit(ContractEntity c, @HeaderParam(Authentifier.PARAM_NAME) Strin
for (ContractEntity contract : contracts){
if (contract.getParties().contains(c.getUserid())){
if (contract.getWish().equals(Wish.NEUTRAL)){
- contract.setClauses(c.getClauses());
+ contract.setImplementing(c.getImplementing());
+ contract.setExchange(c.getExchange());
+ contract.setTermination(c.getTermination());
+ contract.setStatus(Status.MODIFIED);
contract.setParties(parties);
contract.setTitle(c.getTitle());
contract.setPartiesNames(partiesNames);
@@ -159,8 +167,9 @@ public String edit(ContractEntity c, @HeaderParam(Authentifier.PARAM_NAME) Strin
}
em.end();
em.close();
-
+ updateContract(token,cRes.getId(),Wish.NEUTRAL);
JsonTools json = new JsonTools<>(new TypeReference(){});
+
return json.toJson(cRes);
}
@@ -220,32 +229,71 @@ public String sign(@PathParam("id")String id, @HeaderParam(Authentifier.PARAM_NA
em.end();
em.close();
-
+ updateContract(token,id,Wish.ACCEPT);
return ret;
}
@PUT
@Path("/cancel/{id}")
- public String cancel(@PathParam("id")String id){
+ public String cancel(@PathParam("id")String id,@HeaderParam(Authentifier.PARAM_NAME) String token){
UserSyncManager users = new UserSyncManagerImpl();
users.close();
-
+
String ret = "false";
SyncManager em = new ContractSyncManagerImpl();
em.begin();
ContractEntity c = em.findOneById(id);
if (c.getStatus() == Status.NOWHERE){
- c.setWish(Wish.REFUSE);
- c.setStatus(Status.CANCELLED);
+ c.setWish(Wish.REFUSE);c.setStatus(Status.CANCELLED);
ret="true";
}else if (c.getStatus() == Status.SIGNING){
c.setWish(Wish.REFUSE);
ret="true";
}
-
+
em.end();
em.close();
-
+ updateContract(token,id,Wish.REFUSE);
return ret;
}
+ private void updateContract(String token,String id,Wish aWish){
+ Authentifier auth = Application.getInstance().getAuth();
+ UserSyncManager users = new UserSyncManagerImpl();
+ User currentUser = users.getUser(auth.getLogin(token), auth.getPassword(token));
+ users.close();
+ SyncManager em = new ContractSyncManagerImpl();
+ em.begin();
+ ContractEntity c = em.findOneById(id);
+ ArrayList parties = c.getParties();
+ HashMap partiesNames = new HashMap();
+ if (parties != null) {
+ JsonTools json3 = new JsonTools<>(new TypeReference() {
+ });
+ Users us = new Users();
+ for (String id1 : parties) {
+ User u = json3.toEntity(us.get(id1));
+ partiesNames.put(id1, u.getNick());
+ }
+ }
+ HashMap wishes = c.getpartiesWish();
+ wishes.put(currentUser.getNick(), aWish);
+ Collection contracts = em.findAllByAttribute("title", c.getTitle());
+ for (ContractEntity contract : contracts) {
+ if (contract.getParties().contains(c.getUserid())) {
+ c.setTermination(contract.getTermination());
+ c.setImplementing(contract.getImplementing());
+ c.setExchange(contract.getExchange());
+ contract.setParties(parties);
+ contract.setTitle(c.getTitle());
+ contract.setPartiesNames(partiesNames);
+ contract.setpartiesWish(wishes);
+
+ }
+ }
+
+ em.end();
+ em.close();
+
+
+ }
}
diff --git a/src/main/java/controller/CryptCommander.java b/src/main/java/controller/CryptCommander.java
index 1ca07a97..7d521fd7 100644
--- a/src/main/java/controller/CryptCommander.java
+++ b/src/main/java/controller/CryptCommander.java
@@ -10,7 +10,7 @@
@ServletPath("/command/hash/*") //url path. PREFIX WITH COMMAND/ !!!
@Path("/")
-public class CryptCommander {
+public class CryptCommander {
@GET
@Path("/{input}") //a way to name the pieces of the query
public String hash(@PathParam("input") String input) { //this argument will be initialized with the piece of the query
diff --git a/src/main/java/controller/Items.java b/src/main/java/controller/Items.java
index d6a12dbe..a616b3af 100644
--- a/src/main/java/controller/Items.java
+++ b/src/main/java/controller/Items.java
@@ -87,11 +87,29 @@ public String get(@HeaderParam(Authentifier.PARAM_NAME) String token) {
ItemSyncManager em = SyncManagerFactory.createItemSyncManager();
JsonTools> json = new JsonTools<>(new TypeReference>(){});
String ret = json.toJson(em.findAllByAttribute("userid", currentUser.getId()));
+ System.err.println("USER="+currentUser.getId());
users.close();
em.close();
return ret;
}
+
+ @GET
+ @Path("/all")
+ @Produces(MediaType.APPLICATION_JSON)
+ public String getAll(@HeaderParam(Authentifier.PARAM_NAME) String token) {
+
+ Authentifier auth = Application.getInstance().getAuth();
+ UserSyncManager users = SyncManagerFactory.createUserSyncManager();
+ User currentUser = users.getUser(auth.getLogin(token), auth.getPassword(token));
+ ItemSyncManager em = SyncManagerFactory.createItemSyncManager();
+ JsonTools> json = new JsonTools<>(new TypeReference>(){});
+ String ret = json.toJson(em.findAll());
+ System.err.println("USER="+currentUser.getId());
+ users.close();
+ em.close();
+ return ret;
+ }
@PUT
@Path("/{id}")
@Consumes(MediaType.APPLICATION_JSON)
diff --git a/src/main/java/controller/Messages.java b/src/main/java/controller/Messages.java
index 2272bab9..4da248a5 100644
--- a/src/main/java/controller/Messages.java
+++ b/src/main/java/controller/Messages.java
@@ -2,11 +2,7 @@
import java.io.IOException;
import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Hashtable;
-import java.util.Iterator;
+import java.util.*;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -51,191 +47,280 @@
@ServletPath("/api/messages/*")
@Path("/")
public class Messages {
- private final static Logger log = LogManager.getLogger(Message.class);
- @POST
- @Path("/")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public ChunkedOutput add(final Message message, @HeaderParam(Authentifier.PARAM_NAME) final String token) {
-
- Authentifier auth = Application.getInstance().getAuth();
- UserSyncManager users = SyncManagerFactory.createUserSyncManager();
- final User sender = users.getUser(auth.getLogin(token), auth.getPassword(token));
-
- final ChunkedOutput output = new ChunkedOutput(String.class);
- new Thread(new Runnable() {
-
- @Override
- public void run() {
-
- final ArrayList asyncResult = new ArrayList<>();
-
- Manager usem = ManagerFactory.createNetworkResilianceUserManager(Application.getInstance().getPeer(), token);
-
- usem.findAllByAttribute("nick",message.getReceiverName(), new ManagerListener() {
- @Override
- public void notify(Collection results) {
-
- for (Iterator iterator = results.iterator(); iterator.hasNext();) {
- User user = (User) iterator.next();
- asyncResult.add(user);
- break;
- }
- }
- });
-
- try {
- Thread.sleep(3000);
- usem.close();
- } catch (InterruptedException e) {
- LoggerUtilities.logStackTrace(e);
- }
-
- User reciever = asyncResult.size()>0? asyncResult.get(0):null;
-
- if (reciever != null && !(reciever.getId().equals(sender.getId())) ){
-
- message.setSendingDate(new Date());
- message.setSender(sender.getId(), sender.getNick());
- message.setPbkey(sender.getKey().getPublicKey());
- message.setReceiver(reciever.getId(), reciever.getNick());
- Manager em = ManagerFactory.createNetworkResilianceMessageManager(Application.getInstance().getPeer(), token,reciever,sender);
-
- boolean pushDbOk = em.begin();
- pushDbOk &= em.persist(message);
- pushDbOk &= em.end();
- pushDbOk &= em.close();
- if (!pushDbOk){
- log.warn("Message might not have been sent.");
- try {
- output.write("{\"error\": \"Message might not have been sent.\"}");
- } catch (IOException e) {
- LoggerUtilities.logStackTrace(e);
- }
- }
-
- em.close();
-
- JsonTools json = new JsonTools<>(new TypeReference(){});
- try {
- output.write(json.toJson(message));
- } catch (IOException e) {
- LoggerUtilities.logStackTrace(e);
- }
-
- }else{
-
- try {
- output.write("{\"error\": \"No receiver specified.\"}");
- } catch (IOException e) {
- LoggerUtilities.logStackTrace(e);
- }
-
- }
-
- try {
- output.write("[]");
- output.close();
- } catch (IOException e) {
- LoggerUtilities.logStackTrace(e);
- }
-
- }
- }).start();
-
- return output;
- }
-
- @GET
- @Path("/")
- @Produces(MediaType.APPLICATION_JSON)
- public ChunkedOutput get(@HeaderParam(Authentifier.PARAM_NAME) final String token) {
-
- Authentifier auth = Application.getInstance().getAuth();
- UserSyncManager users = SyncManagerFactory.createUserSyncManager();
- final User currentUser = users.getUser(auth.getLogin(token), auth.getPassword(token));
- users.close();
-
- final ChunkedOutput output = new ChunkedOutput(String.class);
-
- new Thread(new Runnable() {
-
- @Override
- public void run() {
-
- JsonTools> json = new JsonTools<>(new TypeReference>(){});
-
- Manager em = ManagerFactory.createNetworkResilianceMessageManager(Application.getInstance().getPeer(), token, currentUser,null);
-
- final Hashtable hashtableMessage = new Hashtable<>();
-
- em.findAllByAttribute("receiverId", currentUser.getId(), new ManagerListener() {
- @Override
- public void notify(Collection results) {
-
- for (Iterator iterator = results.iterator(); iterator.hasNext();) {
- Message message = (Message) iterator.next();
- if(hashtableMessage.get(message.getId())==null){
- hashtableMessage.put(message.getId(), message);
- }
- }
- }
- });
-
- em.findAllByAttribute("senderId", currentUser.getId(), new ManagerListener() {
- @Override
- public void notify(Collection results) {
- for (Iterator iterator = results.iterator(); iterator.hasNext();) {
- Message message = (Message) iterator.next();
- if(hashtableMessage.get(message.getId())==null){
- hashtableMessage.put(message.getId(), message);
- }
- }
- }
- });
-
- try {
-
- Thread.sleep(3000);
-
- output.write(json.toJson(hashtableMessage.values()));
-
- } catch (InterruptedException e) {
- LoggerUtilities.logStackTrace(e);
- } catch (IOException e) {
- e.printStackTrace();
- }
- finally {
- try {
- output.write("[]");
- output.close();
- } catch (IOException e) {
- LoggerUtilities.logStackTrace(e);
- }
- }
- em.close();
- }
- }).start();
-
- return output;
- }
-
- @PUT
- @Path("/{id}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public String edit(Message message) {
- return null;
- }
-
- @DELETE
- @Path("/{id}")
- @Produces(MediaType.APPLICATION_JSON)
- public String delete(
- @PathParam("id") long id) {
- return null;
- }
-
-
-
+ private final static Logger log = LogManager.getLogger(Message.class);
+
+ @POST
+ @Path("/")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public ChunkedOutput add(final Message message, @HeaderParam(Authentifier.PARAM_NAME) final String token) {
+
+ Authentifier auth = Application.getInstance().getAuth();
+ UserSyncManager users = SyncManagerFactory.createUserSyncManager();
+ final User sender = users.getUser(auth.getLogin(token), auth.getPassword(token));
+
+ final ChunkedOutput output = new ChunkedOutput(String.class);
+ new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+
+ final ArrayList usernames = new ArrayList<>();
+
+ final Manager usem = ManagerFactory.createNetworkResilianceUserManager(Application.getInstance().getPeer(), token);
+
+
+ usem.findAllById(message.getReceivers(), new ManagerListener() {
+ @Override
+ public void notify(Collection results) {
+ for (Iterator iterator = results.iterator(); iterator.hasNext(); ) {
+ User user = (User) iterator.next();
+ usernames.add(user);
+ }
+ }
+ });
+ try {
+ Thread.sleep(3000);
+ usem.close();
+ } catch (InterruptedException e) {
+ LoggerUtilities.logStackTrace(e);
+ }
+
+
+ /**
+ * Because we have to actually send a message to each member of a chat/forum we copy the message
+ * And to keep track of each forum a new ID was put in place. the Chat ID.
+ * This distinction could be use in the future to implement a read receipt like in fb/whatsapp
+ */
+ if (usernames != null) {
+ Date sendDate = new Date();
+ String uuid ;
+ if(message.getChatID()==null){
+ uuid = UUID.randomUUID().toString();
+ }else{
+ uuid = message.getChatID();
+ }
+
+
+ for(User user : usernames){
+ if(!Objects.equals(user.getId(), sender.getId())){
+ Message aMessage = new Message();
+ aMessage.setSendingDate(sendDate);
+ aMessage.setSender(sender.getId(), sender.getNick());
+ aMessage.setPbkey(sender.getKey().getPublicKey());
+ aMessage.setReceivers(message.getReceivers());
+ aMessage.setMessageContent(message.getMessageContent());
+ aMessage.setReceiver(user.getId(),user.getNick());
+ aMessage.setContractTitle(message.getContractTitle());
+ aMessage.setContractID(message.getContractID());
+ aMessage.setChatID(uuid);
+ aMessage.setReceiversNicks(message.getReceiversNicks());
+ aMessage.setContractID(message.getContractID());
+ Manager em = ManagerFactory.createNetworkResilianceMessageManager(Application.getInstance().getPeer(), token, user, sender);
+ boolean pushDbOk = em.begin();
+ pushDbOk &= em.persist(aMessage);
+ pushDbOk &= em.end();
+ pushDbOk &= em.close();
+
+
+ if (!pushDbOk) {
+ log.warn("Message might not have been sent.");
+ try {
+ output.write("{\"error\": \"Message might not have been sent.\"}");
+ } catch (IOException e) {
+ LoggerUtilities.logStackTrace(e);
+ }
+ }
+
+ em.close();
+
+ JsonTools json = new JsonTools<>(new TypeReference() {
+ });
+ try {
+ output.write(json.toJson(message));
+ } catch (IOException e) {
+ LoggerUtilities.logStackTrace(e);
+ }
+ }
+
+ }
+
+ } else {
+
+ try {
+ output.write("{\"error\": \"No receiver specified.\"}");
+ } catch (IOException e) {
+ LoggerUtilities.logStackTrace(e);
+ }
+
+ }
+
+ try {
+ output.write("[]");
+ output.close();
+ } catch (IOException e) {
+ LoggerUtilities.logStackTrace(e);
+ }
+
+ }
+ }).start();
+
+ return output;
+ }
+
+ @GET
+ @Path("/")
+ @Produces(MediaType.APPLICATION_JSON)
+ public ChunkedOutput get(@HeaderParam(Authentifier.PARAM_NAME) final String token) {
+
+ Authentifier auth = Application.getInstance().getAuth();
+ UserSyncManager users = SyncManagerFactory.createUserSyncManager();
+ final User currentUser = users.getUser(auth.getLogin(token), auth.getPassword(token));
+ users.close();
+
+ final ChunkedOutput output = new ChunkedOutput(String.class);
+
+ new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+
+ JsonTools> json = new JsonTools<>(new TypeReference>() {
+ });
+
+ Manager em = ManagerFactory.createNetworkResilianceMessageManager(Application.getInstance().getPeer(), token, currentUser, null);
+
+ final Hashtable hashtableMessage = new Hashtable<>();
+
+ em.findAllByAttribute("receiverId", currentUser.getId(), new ManagerListener() {
+ @Override
+ public void notify(Collection results) {
+
+ for (Iterator iterator = results.iterator(); iterator.hasNext(); ) {
+ Message message = (Message) iterator.next();
+ if (hashtableMessage.get(message.getId()) == null) {
+ hashtableMessage.put(message.getId(), message);
+ }
+ }
+ }
+ });
+
+ em.findAllByAttribute("senderId", currentUser.getId(), new ManagerListener() {
+ @Override
+ public void notify(Collection results) {
+ for (Iterator iterator = results.iterator(); iterator.hasNext(); ) {
+ Message message = (Message) iterator.next();
+ if (hashtableMessage.get(message.getChatID()) == null) {
+ hashtableMessage.put(message.getChatID(), message);
+ }
+ }
+ }
+ });
+
+ try {
+
+ Thread.sleep(3000);
+
+ output.write(json.toJson(hashtableMessage.values()));
+
+ } catch (InterruptedException e) {
+ LoggerUtilities.logStackTrace(e);
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ output.write("[]");
+ output.close();
+ } catch (IOException e) {
+ LoggerUtilities.logStackTrace(e);
+ }
+ }
+ em.close();
+ }
+ }).start();
+
+ return output;
+ }
+
+ @PUT
+ @Path("/{id}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public String edit(Message message) {
+ return null;
+ }
+
+ @DELETE
+ @Path("/{id}")
+ @Produces(MediaType.APPLICATION_JSON)
+ public String delete(
+ @PathParam("id") long id) {
+ return null;
+ }
+
+
+ @GET
+ @Path("/{id}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public ChunkedOutput getByContractID(@HeaderParam(Authentifier.PARAM_NAME) final String token,@PathParam("id") final String id) {
+
+ Authentifier auth = Application.getInstance().getAuth();
+ UserSyncManager users = SyncManagerFactory.createUserSyncManager();
+ final User currentUser = users.getUser(auth.getLogin(token), auth.getPassword(token));
+ users.close();
+
+ final ChunkedOutput output = new ChunkedOutput(String.class);
+
+ new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+
+ JsonTools> json = new JsonTools<>(new TypeReference>() {
+ });
+
+ Manager em = ManagerFactory.createNetworkResilianceMessageManager(Application.getInstance().getPeer(), token, currentUser, null);
+
+ final Hashtable hashtableMessage = new Hashtable<>();
+
+ em.findAllByAttribute("contractID", id, new ManagerListener() {
+ @Override
+ public void notify(Collection results) {
+
+ for (Iterator iterator = results.iterator(); iterator.hasNext(); ) {
+ Message message = (Message) iterator.next();
+ if (hashtableMessage.get(message.getId()) == null) {
+ hashtableMessage.put(message.getId(), message);
+ }
+ }
+ }
+ });
+
+
+ try {
+
+ Thread.sleep(3000);
+
+ output.write(json.toJson(hashtableMessage.values()));
+
+ } catch (InterruptedException e) {
+ LoggerUtilities.logStackTrace(e);
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ output.write("[]");
+ output.close();
+ } catch (IOException e) {
+ LoggerUtilities.logStackTrace(e);
+ }
+ }
+ em.close();
+ }
+ }).start();
+
+ return output;
+ }
+
}
diff --git a/src/main/java/controller/Search.java b/src/main/java/controller/Search.java
index 0a44a017..fe5a76b6 100644
--- a/src/main/java/controller/Search.java
+++ b/src/main/java/controller/Search.java
@@ -127,5 +127,10 @@ public void notify(Collection results) {
}).start();
return output;
+
}
+
+
+
+
}
diff --git a/src/main/java/controller/Users.java b/src/main/java/controller/Users.java
index 464df2c7..98ec90b6 100644
--- a/src/main/java/controller/Users.java
+++ b/src/main/java/controller/Users.java
@@ -1,231 +1,219 @@
package controller;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Date;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import org.apache.log4j.LogManager;
-import org.apache.log4j.Logger;
-
import com.fasterxml.jackson.core.type.TypeReference;
-
-import controller.managers.CryptoUserManagerDecorator;
import controller.tools.JsonTools;
import crypt.api.hashs.Hasher;
import crypt.factories.ElGamalAsymKeyFactory;
import crypt.factories.HasherFactory;
import model.api.Manager;
-import model.api.SyncManager;
import model.api.UserSyncManager;
import model.entity.ElGamalSignEntity;
import model.entity.LoginToken;
import model.entity.User;
import model.factory.ManagerFactory;
import model.factory.SyncManagerFactory;
-import model.manager.ManagerAdapter;
-import model.syncManager.UserSyncManagerImpl;
-import network.api.advertisement.UserAdvertisementInterface;
-import network.factories.AdvertisementFactory;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
import rest.api.Authentifier;
import rest.api.ServletPath;
+import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
+import java.util.Collection;
+import java.util.Date;
+
@ServletPath("/api/users/*")
@Path("/")
public class Users {
- private final static Logger log = LogManager.getLogger(Users.class);
-
- //@GET
- @POST
- @Path("/login")
- @Produces(MediaType.APPLICATION_JSON)
- public String login(String jsonCredentials) {
-
- String[] credentials = jsonCredentials.split("&");
-
- String login = credentials[0].split("=")[1];
- String password = credentials[1].split("=")[1];
-
- Authentifier auth = Application.getInstance().getAuth();
-
- UserSyncManager em = SyncManagerFactory.createUserSyncManager();
-
- User u = em.getUser(login, password);
-
- log.info(login + " - " + password);
- if(u != null) {
- LoginToken token = new LoginToken();
- token.setToken(auth.getToken(login, password));
- token.setUserid(u.getId());
- JsonTools json = new JsonTools<>(new TypeReference(){});
- em.close();
- return json.toJson(token);
- }
- em.close();
- return "{\"error\": \"true\"}";
- }
-
- @GET
- @Path("/logout")
- public String logout(@HeaderParam(Authentifier.PARAM_NAME) String token) {
- Authentifier auth = Application.getInstance().getAuth();
- auth.deleteToken(token);
- return null;
- }
-
- //@GET
- @POST
- @Path("/subscribe")
- @Produces(MediaType.APPLICATION_JSON)
- public String subscribe(String jsonCredentials) {
- String[] credentials = jsonCredentials.split("&");
- String login = credentials[0].split("=")[1];
- String password = credentials[1].split("=")[1];
-
- User u = new User();
- u.setNick(login);
- u.setSalt(HasherFactory.generateSalt());
- u.setPasswordHash(password.getBytes());
- u.setCreatedAt(new Date());
- u.setKey(ElGamalAsymKeyFactory.create(false));
- u.setSignature(new ElGamalSignEntity());
-
- Manager hasherDecoratorManager = ManagerFactory.createCryptoNetworkUserManager(Application.getInstance().getPeer(), null, u);
-
- hasherDecoratorManager.begin();
- hasherDecoratorManager.persist(u);
- hasherDecoratorManager.end();
- hasherDecoratorManager.close();
-
- Authentifier auth = Application.getInstance().getAuth();
- LoginToken token = new LoginToken();
- token.setToken(auth.getToken(login, password));
- token.setUserid(u.getId());
-
- JsonTools json = new JsonTools<>(new TypeReference(){});
- return json.toJson(token);
- }
-
- @POST
- @Path("/")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public String add(User user) {
-
- return null;
- }
-
- @GET
- @Path("/{id}")
- @Produces(MediaType.APPLICATION_JSON)
- public String get(
- @PathParam("id") String id) {
-
- UserSyncManager em = SyncManagerFactory.createUserSyncManager();
-
- JsonTools json = new JsonTools<>(new TypeReference(){});
- return json.toJson(em.findOneById(id));
- }
-
- @GET
- @Path("/")
- @Produces(MediaType.APPLICATION_JSON)
- public String get() {
-
- UserSyncManager em = SyncManagerFactory.createUserSyncManager();
-
- JsonTools> json = new JsonTools<>(new TypeReference>(){});
- return json.toJson(em.findAll());
- //return JsonUtils.collectionStringify(em.findAll());
- }
-
- @PUT
- @Path("/{id}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public String edit(User user) {
-
- return null;
- }
-
- @POST
- @Path("/password")
- @Produces(MediaType.APPLICATION_JSON)
- public String changePassword(@HeaderParam(Authentifier.PARAM_NAME) String token, String jsonCredentials) {
-
- String[] credentials = jsonCredentials.split("&");
- String passwordOld = credentials[0].split("=")[1];
- String passwordNew = credentials[1].split("=")[1];
- String passwordNewConfirm = credentials[2].split("=")[1];
-
- if(!passwordNew.equals(passwordNewConfirm)){
- return "{\"error\": \"true\"}";
- }
-
- Authentifier auth = Application.getInstance().getAuth();
-
- UserSyncManager em = SyncManagerFactory.createUserSyncManager();
-
- User u = em.getUser(auth.getLogin(token), passwordOld); //search in local
-
- Manager decoratorUserMg = ManagerFactory.createCryptoUserManager(em,u); // encapsulation of UserSyncManager to hash the new password using decorator pattern
-
- if(u != null) {
-
- decoratorUserMg.begin();
-
- LoginToken newToken = new LoginToken();
- newToken.setToken(auth.getToken(u.getNick(), passwordNew));
- newToken.setUserid(u.getId());
-
- Hasher hasher = HasherFactory.createDefaultHasher();
- u.setSalt(HasherFactory.generateSalt());
- u.setPasswordHash(passwordNew.getBytes());
-
- if (decoratorUserMg.end()){
- decoratorUserMg.close();
- JsonTools json = new JsonTools<>(new TypeReference(){});
- return json.toJson(newToken);
- }
- }
-
- decoratorUserMg.close();
- return null;
- }
-
- /**
- * This only deletes users from local base.
- * TO DO : connect to jxta
- * @param id
- * @param token
- * @return
- */
- @DELETE
- @Path("/{id}")
- @Produces(MediaType.APPLICATION_JSON)
- public String delete(@PathParam("id") String id, @HeaderParam(Authentifier.PARAM_NAME) String token) {
- Authentifier auth = Application.getInstance().getAuth();
-
- UserSyncManager users = SyncManagerFactory.createUserSyncManager();
-
- User currentUser = users.getUser(auth.getLogin(token), auth.getPassword(token));
- if (currentUser == null){
- users.close();
- return "{\"deleted\": \"false\"}";
- }
- Boolean ret = users.begin();
- User us = users.findOneById(id);
- return "{\"deleted\": \"" + (ret && users.remove(us) && users.end() && users.close()) + "\"}";
- }
-
+ private final static Logger log = LogManager.getLogger(Users.class);
+
+ //@GET
+ @POST
+ @Path("/login")
+ @Produces(MediaType.APPLICATION_JSON)
+ public String login(String jsonCredentials) {
+
+ String[] credentials = jsonCredentials.split("&");
+
+ String login = credentials[0].split("=")[1];
+ String password = credentials[1].split("=")[1];
+
+ Authentifier auth = Application.getInstance().getAuth();
+
+ UserSyncManager em = SyncManagerFactory.createUserSyncManager();
+
+ User u = em.getUser(login, password);
+
+ log.info(login + " - " + password);
+ if (u != null) {
+ LoginToken token = new LoginToken();
+ token.setToken(auth.getToken(login, password));
+ token.setUserid(u.getId());
+ JsonTools json = new JsonTools<>(new TypeReference() {
+ });
+ em.close();
+ return json.toJson(token);
+ }
+ em.close();
+ return "{\"error\": \"true\"}";
+ }
+
+ @GET
+ @Path("/logout")
+ public String logout(@HeaderParam(Authentifier.PARAM_NAME) String token) {
+ Authentifier auth = Application.getInstance().getAuth();
+ auth.deleteToken(token);
+ return null;
+ }
+
+ //@GET
+ @POST
+ @Path("/subscribe")
+ @Produces(MediaType.APPLICATION_JSON)
+ public String subscribe(String jsonCredentials) {
+ String[] credentials = jsonCredentials.split("&");
+ String login = credentials[0].split("=")[1];
+ String password = credentials[1].split("=")[1];
+
+ User u = new User();
+ u.setNick(login);
+ u.setSalt(HasherFactory.generateSalt());
+ u.setPasswordHash(password.getBytes());
+ u.setCreatedAt(new Date());
+ u.setKey(ElGamalAsymKeyFactory.create(false));
+ u.setSignature(new ElGamalSignEntity());
+
+ Manager hasherDecoratorManager = ManagerFactory.createCryptoNetworkUserManager(Application.getInstance().getPeer(), null, u);
+
+ hasherDecoratorManager.begin();
+ hasherDecoratorManager.persist(u);
+ hasherDecoratorManager.end();
+ hasherDecoratorManager.close();
+
+ Authentifier auth = Application.getInstance().getAuth();
+ LoginToken token = new LoginToken();
+ token.setToken(auth.getToken(login, password));
+ token.setUserid(u.getId());
+
+ JsonTools json = new JsonTools<>(new TypeReference() {
+ });
+ return json.toJson(token);
+ }
+
+ @POST
+ @Path("/")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public String add(User user) {
+
+ return null;
+ }
+
+ @GET
+ @Path("/{id}")
+ @Produces(MediaType.APPLICATION_JSON)
+ public String get(
+ @PathParam("id") String id) {
+
+ UserSyncManager em = SyncManagerFactory.createUserSyncManager();
+
+ JsonTools json = new JsonTools<>(new TypeReference() {
+ });
+ return json.toJson(em.findOneById(id));
+ }
+
+ @GET
+ @Path("/")
+ @Produces(MediaType.APPLICATION_JSON)
+ public String get() {
+
+ UserSyncManager em = SyncManagerFactory.createUserSyncManager();
+
+ JsonTools> json = new JsonTools<>(new TypeReference>() {
+ });
+ return json.toJson(em.findAll());
+ //return JsonUtils.collectionStringify(em.findAll());
+ }
+
+ @PUT
+ @Path("/{id}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public String edit(User user) {
+
+ return null;
+ }
+
+ @POST
+ @Path("/password")
+ @Produces(MediaType.APPLICATION_JSON)
+ public String changePassword(@HeaderParam(Authentifier.PARAM_NAME) String token, String jsonCredentials) {
+
+ String[] credentials = jsonCredentials.split("&");
+ String passwordOld = credentials[0].split("=")[1];
+ String passwordNew = credentials[1].split("=")[1];
+ String passwordNewConfirm = credentials[2].split("=")[1];
+
+ if (!passwordNew.equals(passwordNewConfirm)) {
+ return "{\"error\": \"true\"}";
+ }
+
+ Authentifier auth = Application.getInstance().getAuth();
+
+ UserSyncManager em = SyncManagerFactory.createUserSyncManager();
+
+ User u = em.getUser(auth.getLogin(token), passwordOld); //search in local
+
+ Manager decoratorUserMg = ManagerFactory.createCryptoUserManager(em, u); // encapsulation of UserSyncManager to hash the new password using decorator pattern
+
+ if (u != null) {
+
+ decoratorUserMg.begin();
+
+ LoginToken newToken = new LoginToken();
+ newToken.setToken(auth.getToken(u.getNick(), passwordNew));
+ newToken.setUserid(u.getId());
+
+ Hasher hasher = HasherFactory.createDefaultHasher();
+ u.setSalt(HasherFactory.generateSalt());
+ u.setPasswordHash(passwordNew.getBytes());
+
+ if (decoratorUserMg.end()) {
+ decoratorUserMg.close();
+ JsonTools json = new JsonTools<>(new TypeReference() {
+ });
+ return json.toJson(newToken);
+ }
+ }
+
+ decoratorUserMg.close();
+ return null;
+ }
+
+ /**
+ * This only deletes users from local base.
+ * TO DO : connect to jxta
+ *
+ * @param id
+ * @param token
+ * @return
+ */
+ @DELETE
+ @Path("/{id}")
+ @Produces(MediaType.APPLICATION_JSON)
+ public String delete(@PathParam("id") String id, @HeaderParam(Authentifier.PARAM_NAME) String token) {
+ Authentifier auth = Application.getInstance().getAuth();
+
+ UserSyncManager users = SyncManagerFactory.createUserSyncManager();
+
+ User currentUser = users.getUser(auth.getLogin(token), auth.getPassword(token));
+ if (currentUser == null) {
+ users.close();
+ return "{\"deleted\": \"false\"}";
+ }
+ Boolean ret = users.begin();
+ User us = users.findOneById(id);
+ return "{\"deleted\": \"" + (ret && users.remove(us) && users.end() && users.close()) + "\"}";
+ }
+
}
diff --git a/src/main/java/controller/managers/CryptoItemManagerDecorator.java b/src/main/java/controller/managers/CryptoItemManagerDecorator.java
index 437ed9bf..b3716064 100644
--- a/src/main/java/controller/managers/CryptoItemManagerDecorator.java
+++ b/src/main/java/controller/managers/CryptoItemManagerDecorator.java
@@ -1,141 +1,138 @@
package controller.managers;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
import crypt.api.annotation.ParserAction;
import crypt.api.annotation.ParserAnnotation;
import crypt.factories.ParserFactory;
import model.api.Manager;
import model.api.ManagerDecorator;
import model.api.ManagerListener;
-import model.entity.ElGamalSignEntity;
import model.entity.Item;
import model.entity.User;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
/**
- *
* @author Radoua Abderrahim
- *
*/
-public class CryptoItemManagerDecorator extends ManagerDecorator- {
-
- private User user;
-
- public CryptoItemManagerDecorator(Manager
- em,User user) {
- super(em);
- this.user = user;
- }
-
- @Override
- public boolean persist(Item entity) {
- return super.persist(entity);
- }
-
- @Override
- public void findOneById(String id, final ManagerListener
- l) {
-
- super.findOneById(id,new ManagerListener
- () {
-
- @Override
- public void notify(Collection
- results) {
-
- ArrayList
- rest = new ArrayList<>();
-
- Item item = results.iterator().next();
-
- if(item != null){
-
- ParserAnnotation parser = ParserFactory.createDefaultParser(item, null);
-
- item = (Item) parser.parseAnnotation(ParserAction.CheckAction);
-
- if(item != null){
- rest.add(item);
- }
- }
-
- l.notify(rest);
- }
- });
- }
-
- @Override
- public void findAllByAttribute(String attribute, String value, final ManagerListener
- l) {
-
- super.findAllByAttribute(attribute, value, new ManagerListener
- () {
-
- @Override
- public void notify(Collection
- results) {
-
- ArrayList
- rest = new ArrayList<>();
-
- for (Iterator iterator = results.iterator(); iterator.hasNext();) {
-
- Item item = (Item) iterator.next();
-
- ParserAnnotation parser = ParserFactory.createDefaultParser(item, null);
-
- item = (Item) parser.parseAnnotation(ParserAction.CheckAction);
-
- if(item != null){
- rest.add(item);
- }
- }
-
- l.notify(rest);
- }
- });
-
- }
-
- @Override
- public void findOneByAttribute(String attribute, String value, final ManagerListener
- l) {
-
- super.findOneByAttribute(attribute, value, new ManagerListener
- () {
-
- @Override
- public void notify(Collection
- results) {
-
- ArrayList
- rest = new ArrayList<>();
-
- Item item = results.iterator().next();
-
- if(item != null){
-
- ParserAnnotation parser = ParserFactory.createDefaultParser(item, null);
-
- item = (Item) parser.parseAnnotation(ParserAction.CheckAction);
-
- if(item != null){
- rest.add(item);
- }
- }
-
- l.notify(rest);
- }
- });
- }
-
-
- @Override
- public boolean end() {
-
- Collection
- collection = this.changesInWatchlist();
-
- for (Item item : collection) {
-
- if(item.getUserid() == user.getId()){
-
- ParserAnnotation
- parser = ParserFactory.createDefaultParser(item, user.getKey());
-
- item = (Item) parser.parseAnnotation(ParserAction.SigneAction);
- }
- }
-
- return super.end();
- }
-
-
+public class CryptoItemManagerDecorator extends ManagerDecorator
- {
+
+ private User user;
+
+ public CryptoItemManagerDecorator(Manager
- em, User user) {
+ super(em);
+ this.user = user;
+ }
+
+ @Override
+ public boolean persist(Item entity) {
+ return super.persist(entity);
+ }
+
+ @Override
+ public void findOneById(String id, final ManagerListener
- l) {
+
+ super.findOneById(id, new ManagerListener
- () {
+
+ @Override
+ public void notify(Collection
- results) {
+
+ ArrayList
- rest = new ArrayList<>();
+
+ Item item = results.iterator().next();
+
+ if (item != null) {
+
+ ParserAnnotation parser = ParserFactory.createDefaultParser(item, null);
+
+ item = (Item) parser.parseAnnotation(ParserAction.CheckAction);
+
+ if (item != null) {
+ rest.add(item);
+ }
+ }
+
+ l.notify(rest);
+ }
+ });
+ }
+
+ @Override
+ public void findAllByAttribute(String attribute, String value, final ManagerListener
- l) {
+
+ super.findAllByAttribute(attribute, value, new ManagerListener
- () {
+
+ @Override
+ public void notify(Collection
- results) {
+
+ ArrayList
- rest = new ArrayList<>();
+
+ for (Iterator iterator = results.iterator(); iterator.hasNext(); ) {
+
+ Item item = (Item) iterator.next();
+
+ ParserAnnotation parser = ParserFactory.createDefaultParser(item, null);
+
+ item = (Item) parser.parseAnnotation(ParserAction.CheckAction);
+
+ if (item != null) {
+ rest.add(item);
+ }
+ }
+
+ l.notify(rest);
+ }
+ });
+
+ }
+
+ @Override
+ public void findOneByAttribute(String attribute, String value, final ManagerListener
- l) {
+
+ super.findOneByAttribute(attribute, value, new ManagerListener
- () {
+
+ @Override
+ public void notify(Collection
- results) {
+
+ ArrayList
- rest = new ArrayList<>();
+
+ Item item = results.iterator().next();
+
+ if (item != null) {
+
+ ParserAnnotation parser = ParserFactory.createDefaultParser(item, null);
+
+ item = (Item) parser.parseAnnotation(ParserAction.CheckAction);
+
+ if (item != null) {
+ rest.add(item);
+ }
+ }
+
+ l.notify(rest);
+ }
+ });
+ }
+
+
+ @Override
+ public boolean end() {
+
+ Collection
- collection = this.changesInWatchlist();
+
+ for (Item item : collection) {
+
+ if (item.getUserid() == user.getId()) {
+
+ ParserAnnotation
- parser = ParserFactory.createDefaultParser(item, user.getKey());
+
+ item = (Item) parser.parseAnnotation(ParserAction.SigneAction);
+ }
+ }
+
+ return super.end();
+ }
+
+
}
diff --git a/src/main/java/controller/managers/CryptoMessageManagerDecorator.java b/src/main/java/controller/managers/CryptoMessageManagerDecorator.java
index 0d24cfaa..7f2f8448 100644
--- a/src/main/java/controller/managers/CryptoMessageManagerDecorator.java
+++ b/src/main/java/controller/managers/CryptoMessageManagerDecorator.java
@@ -1,97 +1,83 @@
package controller.managers;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import javax.persistence.Entity;
-
-import org.eclipse.persistence.internal.jpa.metadata.structures.ArrayAccessor;
-
-import controller.Application;
import crypt.api.annotation.ParserAction;
import crypt.api.annotation.ParserAnnotation;
import crypt.factories.ParserFactory;
import model.api.Manager;
import model.api.ManagerDecorator;
import model.api.ManagerListener;
-import model.api.UserSyncManager;
-import model.entity.User;
-import model.factory.ManagerFactory;
-import model.syncManager.UserSyncManagerImpl;
-import network.api.Peer;
-import model.entity.ElGamalSignEntity;
-import model.entity.Item;
import model.entity.Message;
+import model.entity.User;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
/**
- *
* @author Radoua Abderrahim
- *
*/
-public class CryptoMessageManagerDecorator extends ManagerDecorator
{
-
- private User user,userSender;
- private String who;
-
- public CryptoMessageManagerDecorator(Manager em,String who,User reciever,User sender) {
- super(em);
- this.user = reciever;
- this.userSender = sender;
- this.who = who;
- }
-
- @Override
- public boolean persist(Message entity) {
-
- ParserAnnotation parser = ParserFactory.createDefaultParser(entity, userSender.getKey());
-
- entity = (Message) parser.parseAnnotation(ParserAction.SigneAction);
-
- parser.setKey(user.getKey());
-
- entity = (Message) parser.parseAnnotation(ParserAction.CryptAction);
-
- return super.persist(entity);
- }
-
- @Override
- public void findAllByAttribute(String attribute, String value, final ManagerListener l) {
-
- super.findAllByAttribute(attribute, value, new ManagerListener() {
- @Override
- public void notify(Collection results) {
-
- ArrayList res = new ArrayList<>();
-
- for (Iterator iterator = results.iterator(); iterator.hasNext();) {
-
- Message message = (Message) iterator.next();
-
- ParserAnnotation parser;
-
- parser = ParserFactory.createDefaultParser(message, user.getKey());
-
- message = (Message) parser.parseAnnotation(ParserAction.DecryptAction);
-
- parser.setKey(null);
-
- message = (Message) parser.parseAnnotation(ParserAction.CheckAction);
-
-
- if(message != null){
- res.add(message);
- }
- }
-
- l.notify(res);
- }
- });
- }
-
- @Override
- public boolean end() {
- return super.end();
- }
+public class CryptoMessageManagerDecorator extends ManagerDecorator {
+
+ private User user, userSender;
+ private String who;
+
+ public CryptoMessageManagerDecorator(Manager em, String who, User reciever, User sender) {
+ super(em);
+ this.user = reciever;
+ this.userSender = sender;
+ this.who = who;
+ }
+
+ @Override
+ public boolean persist(Message entity) {
+
+ ParserAnnotation parser = ParserFactory.createDefaultParser(entity, userSender.getKey());
+
+ entity = (Message) parser.parseAnnotation(ParserAction.SigneAction);
+
+ parser.setKey(user.getKey());
+
+ entity = (Message) parser.parseAnnotation(ParserAction.CryptAction);
+
+ return super.persist(entity);
+ }
+
+ @Override
+ public void findAllByAttribute(String attribute, String value, final ManagerListener l) {
+
+ super.findAllByAttribute(attribute, value, new ManagerListener() {
+ @Override
+ public void notify(Collection results) {
+
+ ArrayList res = new ArrayList<>();
+
+ for (Iterator iterator = results.iterator(); iterator.hasNext(); ) {
+
+ Message message = (Message) iterator.next();
+
+ ParserAnnotation parser;
+
+ parser = ParserFactory.createDefaultParser(message, user.getKey());
+
+ message = (Message) parser.parseAnnotation(ParserAction.DecryptAction);
+
+ parser.setKey(null);
+
+ message = (Message) parser.parseAnnotation(ParserAction.CheckAction);
+
+
+ if (message != null) {
+ res.add(message);
+ }
+ }
+
+ l.notify(res);
+ }
+ });
+ }
+
+ @Override
+ public boolean end() {
+ return super.end();
+ }
}
diff --git a/src/main/java/controller/managers/CryptoUserManagerDecorator.java b/src/main/java/controller/managers/CryptoUserManagerDecorator.java
index 961ace53..a06423e4 100644
--- a/src/main/java/controller/managers/CryptoUserManagerDecorator.java
+++ b/src/main/java/controller/managers/CryptoUserManagerDecorator.java
@@ -1,57 +1,48 @@
package controller.managers;
-import java.util.Collection;
-
-import javax.persistence.Entity;
-
import crypt.api.annotation.ParserAction;
import crypt.api.annotation.ParserAnnotation;
import crypt.factories.ParserFactory;
import model.api.Manager;
import model.api.ManagerDecorator;
-import model.api.ManagerListener;
-import model.entity.ElGamalSignEntity;
-import model.entity.Item;
import model.entity.User;
-import network.api.advertisement.UserAdvertisementInterface;
-import network.factories.AdvertisementFactory;
+
+import java.util.Collection;
/**
- *
* @author Radoua Abderrahim
- *
*/
-public class CryptoUserManagerDecorator extends ManagerDecorator{
-
- private User user;
-
- public CryptoUserManagerDecorator(Manager em,User user) {
- super(em);
- this.user = user;
- }
-
- @Override
- public boolean persist(User entity) {
- return super.persist(entity);
- }
-
- @Override
- public boolean end() {
-
- Collection collection = this.changesInWatchlist();
-
- for (User u : collection) {
-
- if(u.getId() == user.getId()){
-
- ParserAnnotation parser = ParserFactory.createDefaultParser(u, user.getKey());
-
- u =(User) parser.parseAnnotation(ParserAction.HasherAction,ParserAction.SigneAction);
-
- }
- }
-
- return super.end();
- }
-
+public class CryptoUserManagerDecorator extends ManagerDecorator {
+
+ private User user;
+
+ public CryptoUserManagerDecorator(Manager em, User user) {
+ super(em);
+ this.user = user;
+ }
+
+ @Override
+ public boolean persist(User entity) {
+ return super.persist(entity);
+ }
+
+ @Override
+ public boolean end() {
+
+ Collection collection = this.changesInWatchlist();
+
+ for (User u : collection) {
+
+ if (u.getId() == user.getId()) {
+
+ ParserAnnotation parser = ParserFactory.createDefaultParser(u, user.getKey());
+
+ u = (User) parser.parseAnnotation(ParserAction.HasherAction, ParserAction.SigneAction);
+
+ }
+ }
+
+ return super.end();
+ }
+
}
diff --git a/src/main/java/controller/managers/NetworkContractManagerDecorator.java b/src/main/java/controller/managers/NetworkContractManagerDecorator.java
index a9f1c412..3d2ea08d 100644
--- a/src/main/java/controller/managers/NetworkContractManagerDecorator.java
+++ b/src/main/java/controller/managers/NetworkContractManagerDecorator.java
@@ -1,125 +1,120 @@
package controller.managers;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
import com.fasterxml.jackson.core.type.TypeReference;
-
import controller.tools.JsonTools;
import model.api.Manager;
import model.api.ManagerDecorator;
import model.api.ManagerListener;
import model.entity.ContractEntity;
-import model.entity.Item;
import model.syncManager.ContractSyncManagerImpl;
-import network.api.EstablisherService;
-import network.api.Messages;
-import network.api.Peer;
-import network.api.SearchListener;
-import network.api.ServiceListener;
+import network.api.*;
import network.api.advertisement.EstablisherAdvertisementInterface;
import network.api.service.Service;
import network.factories.AdvertisementFactory;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
public class NetworkContractManagerDecorator extends ManagerDecorator {
- private Peer peer;
- private String who;
-
- /**
- *
- * @param em Contract async manager
- * @param peer Peer instance, started
- * @param who who own this instance
- */
- public NetworkContractManagerDecorator(Manager em, Peer peer, String who) {
- super(em);
- this.peer = peer;
- this.who = who;
- }
-
- @Override
- public void findOneById(final String id, final ManagerListener l) {
- super.findOneById(id, l);
- //TODO
- }
-
- @Override
- public void findAllByAttribute(String attribute, final String value, final ManagerListener l) {
- super.findAllByAttribute(attribute, value, l);
- final EstablisherService establisher = (EstablisherService) peer.getService(EstablisherService.NAME);
- Service service = peer.getService(EstablisherService.NAME);
-
- establisher.removeListener(who);
- establisher.addListener(new ServiceListener() {
-
- @Override
- public void notify(Messages messages) {
- JsonTools> json = new JsonTools<>(new TypeReference>(){});
- ArrayList contracts = json.toEntity(messages.getMessage("contract"));
- System.out.println("contract found !");
- System.out.println(messages.getMessage("contract"));
- for(ContractEntity c : contracts) {
- System.out.println(c.getId());
- }
- l.notify(json.toEntity(messages.getMessage("contract")));
- }
-
- }, who == null ? "test":who);
-
- service.search(attribute, value, new SearchListener() {
- @Override
- public void notify(Collection result) {
- ArrayList uids = new ArrayList<>();
- for(EstablisherAdvertisementInterface i: result) {
- uids.add(i.getSourceURI());
- }
- ContractSyncManagerImpl co = new ContractSyncManagerImpl();
- Collection c = co.findAllByAttribute("id", value);
- JsonTools> json = new JsonTools<>(new TypeReference>(){});
- establisher.sendContract(value, who == null ? "test":who, "",json.toJson(c) , uids.toArray(new String[1]));
- }
-
- });
- }
-
- @Override
- public void findOneByAttribute(String attribute, String value, ManagerListener l) {
- super.findOneByAttribute(attribute, value, l);
- //TODO
- }
-
- @Override
- public boolean persist(ContractEntity entity) {
- return super.persist(entity);
- }
-
- @Override
- public boolean begin() {
- return super.begin();
- }
-
- @Override
- public boolean end() {
-
- if(super.end()){
-
- Collection collection = this.watchlist();
-
- for (Iterator iterator = collection.iterator(); iterator.hasNext();) {
-
- ContractEntity contractEntity = (ContractEntity) iterator.next();
-
- EstablisherAdvertisementInterface iadv = AdvertisementFactory.createEstablisherAdvertisement();
-
- iadv.setTitle(contractEntity.getId());
-
- iadv.publish(peer);
- }
-
- return true;
- }
-
- return false;
- }
+ private Peer peer;
+ private String who;
+
+ /**
+ * @param em Contract async manager
+ * @param peer Peer instance, started
+ * @param who who own this instance
+ */
+ public NetworkContractManagerDecorator(Manager em, Peer peer, String who) {
+ super(em);
+ this.peer = peer;
+ this.who = who;
+ }
+
+ @Override
+ public void findOneById(final String id, final ManagerListener l) {
+ super.findOneById(id, l);
+ //TODO
+ }
+
+ @Override
+ public void findAllByAttribute(String attribute, final String value, final ManagerListener l) {
+ super.findAllByAttribute(attribute, value, l);
+ final EstablisherService establisher = (EstablisherService) peer.getService(EstablisherService.NAME);
+ Service service = peer.getService(EstablisherService.NAME);
+
+ establisher.removeListener(who);
+ establisher.addListener(new ServiceListener() {
+
+ @Override
+ public void notify(Messages messages) {
+ JsonTools> json = new JsonTools<>(new TypeReference>() {
+ });
+ ArrayList contracts = json.toEntity(messages.getMessage("contract"));
+ System.out.println("contract found !");
+ System.out.println(messages.getMessage("contract"));
+ for (ContractEntity c : contracts) {
+ System.out.println(c.getId());
+ }
+ l.notify(json.toEntity(messages.getMessage("contract")));
+ }
+
+ }, who == null ? "test" : who);
+
+ service.search(attribute, value, new SearchListener() {
+ @Override
+ public void notify(Collection result) {
+ ArrayList uids = new ArrayList<>();
+ for (EstablisherAdvertisementInterface i : result) {
+ uids.add(i.getSourceURI());
+ }
+ ContractSyncManagerImpl co = new ContractSyncManagerImpl();
+ Collection c = co.findAllByAttribute("id", value);
+ JsonTools> json = new JsonTools<>(new TypeReference>() {
+ });
+ establisher.sendContract(value, who == null ? "test" : who, "", json.toJson(c), uids.toArray(new String[1]));
+ }
+
+ });
+ }
+
+ @Override
+ public void findOneByAttribute(String attribute, String value, ManagerListener l) {
+ super.findOneByAttribute(attribute, value, l);
+ //TODO
+ }
+
+ @Override
+ public boolean persist(ContractEntity entity) {
+ return super.persist(entity);
+ }
+
+ @Override
+ public boolean begin() {
+ return super.begin();
+ }
+
+ @Override
+ public boolean end() {
+
+ if (super.end()) {
+
+ Collection collection = this.watchlist();
+
+ for (Iterator iterator = collection.iterator(); iterator.hasNext(); ) {
+
+ ContractEntity contractEntity = (ContractEntity) iterator.next();
+
+ EstablisherAdvertisementInterface iadv = AdvertisementFactory.createEstablisherAdvertisement();
+
+ iadv.setTitle(contractEntity.getId());
+
+ iadv.publish(peer);
+ }
+
+ return true;
+ }
+
+ return false;
+ }
}
diff --git a/src/main/java/controller/managers/NetworkItemManagerDecorator.java b/src/main/java/controller/managers/NetworkItemManagerDecorator.java
index 3c7904d6..f1aef457 100644
--- a/src/main/java/controller/managers/NetworkItemManagerDecorator.java
+++ b/src/main/java/controller/managers/NetworkItemManagerDecorator.java
@@ -1,50 +1,40 @@
package controller.managers;
-import java.util.ArrayList;
-import java.util.Collection;
-
import com.fasterxml.jackson.core.type.TypeReference;
-
import controller.tools.JsonTools;
-import crypt.api.annotation.ParserAction;
-import crypt.api.annotation.ParserAnnotation;
-import crypt.factories.ParserFactory;
import model.api.Manager;
import model.api.ManagerDecorator;
import model.api.ManagerListener;
import model.entity.Item;
-import network.api.ItemRequestService;
-import network.api.ItemService;
-import network.api.Messages;
-import network.api.Peer;
-import network.api.SearchListener;
-import network.api.ServiceListener;
+import network.api.*;
import network.api.advertisement.ItemAdvertisementInterface;
import network.api.service.Service;
import network.factories.AdvertisementFactory;
-public class NetworkItemManagerDecorator extends ManagerDecorator- {
-
- private Peer peer;
- private String who;
-
- /**
- *
- * @param em Item async manager
- * @param peer Peer instance, started
- * @param who who own this instance
- */
- public NetworkItemManagerDecorator(Manager
- em, Peer peer, String who) {
- super(em);
- this.peer = peer;
- this.who = who;
- }
-
- @Override
- public void findOneById(final String id, final ManagerListener
- l) {
- super.findOneById(id, l);
- //TODO
- /*final ItemRequestService itemSender = (ItemRequestService) Application.getInstance().getPeer().getService(JxtaItemsSenderService.NAME);
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class NetworkItemManagerDecorator extends ManagerDecorator
- {
+
+ private Peer peer;
+ private String who;
+
+ /**
+ * @param em Item async manager
+ * @param peer Peer instance, started
+ * @param who who own this instance
+ */
+ public NetworkItemManagerDecorator(Manager
- em, Peer peer, String who) {
+ super(em);
+ this.peer = peer;
+ this.who = who;
+ }
+
+ @Override
+ public void findOneById(final String id, final ManagerListener
- l) {
+ super.findOneById(id, l);
+ //TODO
+ /*final ItemRequestService itemSender = (ItemRequestService) Application.getInstance().getPeer().getService(JxtaItemsSenderService.NAME);
Service items = Application.getInstance().getPeer().getService(JxtaItemService.NAME);
itemSender.addListener(new ServiceListener() {
@@ -69,95 +59,95 @@ public void notify(Collection
result) {
}
});*/
-
- }
- @Override
- public void findAllByAttribute(String attribute, final String value, final ManagerListener- l) {
- super.findAllByAttribute(attribute, value, l);
- final ItemRequestService itemSender = (ItemRequestService) peer.getService(ItemRequestService.NAME);
- Service items = peer.getService(ItemService.NAME);
-
- itemSender.removeListener(who);
- itemSender.addListener(new ServiceListener() {
-
- @Override
- public void notify(Messages messages) {
- JsonTools
> json = new JsonTools<>(new TypeReference>(){});
+ }
+
+ @Override
+ public void findAllByAttribute(String attribute, final String value, final ManagerListener- l) {
+ super.findAllByAttribute(attribute, value, l);
+ final ItemRequestService itemSender = (ItemRequestService) peer.getService(ItemRequestService.NAME);
+ Service items = peer.getService(ItemService.NAME);
+
+ itemSender.removeListener(who);
+ itemSender.addListener(new ServiceListener() {
+
+ @Override
+ public void notify(Messages messages) {
+ JsonTools
> json = new JsonTools<>(new TypeReference>() {
+ });
// ArrayList- items = json.toEntity(messages.getMessage("items"));
// System.out.println("items found !");
// System.out.println(messages.getMessage("items"));
// for(Item i : items) {
// System.out.println(i.getTitle());
// }
- l.notify(json.toEntity(messages.getMessage("items")));
- }
-
- }, who == null ? "test":who);
-
- items.search(attribute, value, new SearchListener
() {
- @Override
- public void notify(Collection result) {
- ArrayList uids = new ArrayList<>();
- for(ItemAdvertisementInterface i: result) {
- uids.add(i.getSourceURI());
- }
- itemSender.sendRequest(value, who == null ? "test":who, uids.toArray(new String[1]));
- }
-
- });
- }
-
- @Override
- public void findOneByAttribute(String attribute, String value, ManagerListener- l) {
- super.findOneByAttribute(attribute, value, l);
- //TODO
- }
-
- @Override
- public boolean persist(Item entity) {
- if (super.persist(entity)){
- //ItemAdvertisementInterface iadv = AdvertisementFactory.createItemAdvertisement();
- //iadv.setTitle(entity.getTitle());
- //iadv.publish(peer);
- return true;
- }
- return false;
- }
-
- @Override
- public boolean begin() {
- return super.begin();
- }
-
- @Override
- public boolean end() {
-
- Collection
- collection = this.changesInWatchlist();
-
- for (Item item : collection) {
-
- ItemAdvertisementInterface iadv = AdvertisementFactory.createItemAdvertisement();
-
- iadv.setTitle(item.getTitle());
-
- iadv.publish(peer);
-
- }
-
- return super.end();
- }
-
- @Override
- public boolean check(){
- return super.check();
- }
-
- @Override
- public boolean close(){
- return super.close();
- }
-
-
-
+ l.notify(json.toEntity(messages.getMessage("items")));
+ }
+
+ }, who == null ? "test" : who);
+
+ items.search(attribute, value, new SearchListener
() {
+ @Override
+ public void notify(Collection result) {
+ ArrayList uids = new ArrayList<>();
+ for (ItemAdvertisementInterface i : result) {
+ uids.add(i.getSourceURI());
+ }
+ itemSender.sendRequest(value, who == null ? "test" : who, uids.toArray(new String[1]));
+ }
+
+ });
+ }
+
+ @Override
+ public void findOneByAttribute(String attribute, String value, ManagerListener- l) {
+ super.findOneByAttribute(attribute, value, l);
+ //TODO
+ }
+
+ @Override
+ public boolean persist(Item entity) {
+ if (super.persist(entity)) {
+ //ItemAdvertisementInterface iadv = AdvertisementFactory.createItemAdvertisement();
+ //iadv.setTitle(entity.getTitle());
+ //iadv.publish(peer);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean begin() {
+ return super.begin();
+ }
+
+ @Override
+ public boolean end() {
+
+ Collection
- collection = this.changesInWatchlist();
+
+ for (Item item : collection) {
+
+ ItemAdvertisementInterface iadv = AdvertisementFactory.createItemAdvertisement();
+
+ iadv.setTitle(item.getTitle());
+
+ iadv.publish(peer);
+
+ }
+
+ return super.end();
+ }
+
+ @Override
+ public boolean check() {
+ return super.check();
+ }
+
+ @Override
+ public boolean close() {
+ return super.close();
+ }
+
+
}
diff --git a/src/main/java/controller/managers/NetworkMessageManagerDecorator.java b/src/main/java/controller/managers/NetworkMessageManagerDecorator.java
index 07659dd3..9b71948a 100644
--- a/src/main/java/controller/managers/NetworkMessageManagerDecorator.java
+++ b/src/main/java/controller/managers/NetworkMessageManagerDecorator.java
@@ -1,99 +1,89 @@
package controller.managers;
-import java.util.ArrayList;
-import java.util.Collection;
-
import com.fasterxml.jackson.core.type.TypeReference;
-
import controller.tools.JsonTools;
import model.api.Manager;
import model.api.ManagerDecorator;
import model.api.ManagerListener;
import model.entity.Message;
-import model.entity.User;
-import network.api.MessageRequestService;
-import network.api.MessageService;
-import network.api.Messages;
-import network.api.Peer;
-import network.api.SearchListener;
-import network.api.ServiceListener;
-import network.api.UserRequestService;
-import network.api.UserService;
+import network.api.*;
import network.api.advertisement.MessageAdvertisementInterface;
-import network.api.advertisement.UserAdvertisementInterface;
import network.api.service.Service;
import network.factories.AdvertisementFactory;
-public class NetworkMessageManagerDecorator extends ManagerDecorator
{
-
- private Peer peer;
- private String who;
-
- /**
- *
- * @param em Message async manager
- * @param peer Peer instance, started
- * @param who who own this instance
- */
- public NetworkMessageManagerDecorator(Manager em, Peer peer, String who) {
- super(em);
- this.peer = peer;
- this.who = who;
- }
-
-
- @Override
- public void findAllByAttribute(String attribute, final String value, final ManagerListener l) {
-
- super.findAllByAttribute(attribute, value, l);
-
- final MessageRequestService messagesSender = (MessageRequestService) peer.getService(MessageRequestService.NAME);
- Service messages = peer.getService(MessageService.NAME);
-
- messagesSender.removeListener(who);
- messagesSender.addListener(new ServiceListener() {
- @Override
- public void notify(Messages messages) {
- JsonTools> json = new JsonTools<>(new TypeReference>(){});
-
- Collection collections = json.toEntity(messages.getMessage("messages"));
-
- l.notify(collections);
- }
- }, who);
-
- messages.search(attribute, value, new SearchListener() {
- @Override
- public void notify(Collection result) {
- ArrayList uids = new ArrayList<>();
- for(MessageAdvertisementInterface i: result) {
- uids.add(i.getSourceURI());
- }
-
- messagesSender.sendRequest(value,value, who, uids.toArray(new String[1]));
- }
- });
- }
-
-
- @Override
- public boolean end() {
-
- Collection collection = this.changesInWatchlist();
-
- for (Message m : collection) {
-
- MessageAdvertisementInterface madv = AdvertisementFactory.createMessageAdvertisement();
-
- madv.setSenderId(m.getSenderId());
-
- madv.setReceiverId(m.getReceiverId());
-
- madv.publish(peer);
- System.out.println("message publish");
- }
-
- return super.end();
- }
-
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class NetworkMessageManagerDecorator extends ManagerDecorator {
+
+ private Peer peer;
+ private String who;
+
+ /**
+ * @param em Message async manager
+ * @param peer Peer instance, started
+ * @param who who own this instance
+ */
+ public NetworkMessageManagerDecorator(Manager em, Peer peer, String who) {
+ super(em);
+ this.peer = peer;
+ this.who = who;
+ }
+
+
+ @Override
+ public void findAllByAttribute(String attribute, final String value, final ManagerListener l) {
+
+ super.findAllByAttribute(attribute, value, l);
+
+ final MessageRequestService messagesSender = (MessageRequestService) peer.getService(MessageRequestService.NAME);
+ Service messages = peer.getService(MessageService.NAME);
+
+ messagesSender.removeListener(who);
+ messagesSender.addListener(new ServiceListener() {
+ @Override
+ public void notify(Messages messages) {
+ JsonTools> json = new JsonTools<>(new TypeReference>() {
+ });
+
+ Collection collections = json.toEntity(messages.getMessage("messages"));
+
+ l.notify(collections);
+ }
+ }, who);
+
+ messages.search(attribute, value, new SearchListener() {
+ @Override
+ public void notify(Collection result) {
+ ArrayList uids = new ArrayList<>();
+ for (MessageAdvertisementInterface i : result) {
+ uids.add(i.getSourceURI());
+ }
+
+ messagesSender.sendRequest(value, value, who, uids.toArray(new String[1]));
+ }
+ });
+ }
+
+
+ @Override
+ public boolean end() {
+
+ Collection collection = this.changesInWatchlist();
+
+ for (Message m : collection) {
+
+ MessageAdvertisementInterface madv = AdvertisementFactory.createMessageAdvertisement();
+
+ madv.setSenderId(m.getSenderId());
+
+ //madv.setReceiverId(m.getReceiverId());
+
+ madv.publish(peer);
+ System.out.println("message publish");
+ }
+
+ return super.end();
+ }
+
}
diff --git a/src/main/java/controller/managers/NetworkUserManagerDecorator.java b/src/main/java/controller/managers/NetworkUserManagerDecorator.java
index 2c3b1a63..c3da295b 100644
--- a/src/main/java/controller/managers/NetworkUserManagerDecorator.java
+++ b/src/main/java/controller/managers/NetworkUserManagerDecorator.java
@@ -1,122 +1,121 @@
package controller.managers;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Hashtable;
-
import com.fasterxml.jackson.core.type.TypeReference;
-
import controller.tools.JsonTools;
import model.api.Manager;
import model.api.ManagerDecorator;
import model.api.ManagerListener;
import model.entity.User;
-import network.api.Messages;
-import network.api.Peer;
-import network.api.SearchListener;
-import network.api.ServiceListener;
-import network.api.UserRequestService;
-import network.api.UserService;
+import network.api.*;
import network.api.advertisement.UserAdvertisementInterface;
import network.api.service.Service;
import network.factories.AdvertisementFactory;
-public class NetworkUserManagerDecorator extends ManagerDecorator{
-
- private Peer peer;
- private String who;
-
- /**
- *
- * @param em User async manager
- * @param peer Peer instance, started
- * @param who who own this instance
- */
- public NetworkUserManagerDecorator(Manager em, Peer peer, String who) {
- super(em);
- this.peer = peer;
- this.who = who;
- }
-
- @Override
- public void findOneByAttribute(String attribute, final String value, final ManagerListener l) {
-
- super.findOneByAttribute(attribute, value, l);
-
- final UserRequestService usersSender = (UserRequestService) peer.getService(UserRequestService.NAME);
- Service users = peer.getService(UserService.NAME);
-
- usersSender.removeListener(who);
- usersSender.addListener(new ServiceListener() {
- @Override
- public void notify(Messages messages) {
- JsonTools> json = new JsonTools<>(new TypeReference>(){});
- Collection collections = json.toEntity(messages.getMessage("users"));
- l.notify(collections);
- }
- }, who == null ? "test":who);
-
- users.search(attribute, value, new SearchListener() {
- @Override
- public void notify(Collection result) {
- ArrayList uids = new ArrayList<>();
- for(UserAdvertisementInterface i: result) {
- uids.add(i.getSourceURI());
- }
- usersSender.sendRequest(value, who == null ? "test":who, uids.toArray(new String[1]));
- }
- });
- }
-
- @Override
- public void findAllByAttribute(String attribute, final String value, final ManagerListener l) {
-
- super.findAllByAttribute(attribute, value, l);
-
- final UserRequestService usersSender = (UserRequestService) peer.getService(UserRequestService.NAME);
- Service users = peer.getService(UserService.NAME);
-
- usersSender.removeListener(who);
- usersSender.addListener(new ServiceListener() {
- @Override
- public void notify(Messages messages) {
- JsonTools> json = new JsonTools<>(new TypeReference>(){});
- Collection collections = json.toEntity(messages.getMessage("users"));
- l.notify(collections);
- }
- }, who == null ? "test":who);
-
- users.search(attribute, value, new SearchListener() {
- @Override
- public void notify(Collection result) {
- ArrayList uids = new ArrayList<>();
- for(UserAdvertisementInterface i: result) {
- uids.add(i.getSourceURI());
- }
- usersSender.sendRequest(value, who == null ? "test":who, uids.toArray(new String[1]));
- }
- });
- }
-
- @Override
- public boolean end() {
-
- Collection collection = this.changesInWatchlist();
-
- for (User u : collection) {
-
- UserAdvertisementInterface uadv = AdvertisementFactory.createUserAdvertisement();
-
- uadv.setNick(u.getNick());
-
- uadv.setPbkey(String.valueOf(u.getKey().getPublicKey()));
-
- uadv.publish(peer);
-
- }
-
- return super.end();
- }
-
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class NetworkUserManagerDecorator extends ManagerDecorator {
+
+ private Peer peer;
+ private String who;
+
+ /**
+ * @param em User async manager
+ * @param peer Peer instance, started
+ * @param who who own this instance
+ */
+ public NetworkUserManagerDecorator(Manager em, Peer peer, String who) {
+ super(em);
+ this.peer = peer;
+ this.who = who;
+ }
+
+ @Override
+ public void findOneByAttribute(String attribute, final String value, final ManagerListener l) {
+
+ super.findOneByAttribute(attribute, value, l);
+
+ final UserRequestService usersSender = (UserRequestService) peer.getService(UserRequestService.NAME);
+ Service users = peer.getService(UserService.NAME);
+
+ usersSender.removeListener(who);
+ usersSender.addListener(new ServiceListener() {
+ @Override
+ public void notify(Messages messages) {
+ JsonTools> json = new JsonTools<>(new TypeReference>() {
+ });
+ Collection collections = json.toEntity(messages.getMessage("users"));
+ l.notify(collections);
+ }
+ }, who == null ? "test" : who);
+
+ users.search(attribute, value, new SearchListener() {
+ @Override
+ public void notify(Collection result) {
+ ArrayList uids = new ArrayList<>();
+ for (UserAdvertisementInterface i : result) {
+ uids.add(i.getSourceURI());
+ }
+ usersSender.sendRequest(value, who == null ? "test" : who, uids.toArray(new String[1]));
+ }
+ });
+ }
+
+
+ @Override
+ public void findAll(final ManagerListener l){
+ super.findAll(l);
+ }
+
+ @Override
+ public void findAllByAttribute(String attribute, final String value, final ManagerListener