summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Schwabe2014-04-08 14:47:39 +0200
committerNils Schwabe2014-04-08 14:47:39 +0200
commita423f9f5dc6abce0c26124e9df9dfc35c6469028 (patch)
tree6ef83ea12cf8b69cb12ad7543bd9b8bf0835a5bf
parentLDAP functionallity (diff)
downloadmasterserver-a423f9f5dc6abce0c26124e9df9dfc35c6469028.tar.gz
masterserver-a423f9f5dc6abce0c26124e9df9dfc35c6469028.tar.xz
masterserver-a423f9f5dc6abce0c26124e9df9dfc35c6469028.zip
added ftp server for testing
-rw-r--r--config/ftp.properties7
-rw-r--r--pom.xml7
-rw-r--r--src/main/java/org/openslx/imagemaster/App.java10
-rw-r--r--src/main/java/org/openslx/imagemaster/db/DbSatellite.java4
-rw-r--r--src/main/properties/log4j.properties4
-rw-r--r--src/test/java/org/openslx/imagemaster/AppTest.java2
6 files changed, 26 insertions, 8 deletions
diff --git a/config/ftp.properties b/config/ftp.properties
new file mode 100644
index 0000000..e870be4
--- /dev/null
+++ b/config/ftp.properties
@@ -0,0 +1,7 @@
+#Generated file - don't edit (please)
+#Tue Apr 08 14:43:38 CEST 2014
+ftpserver.user.admin.writepermission=true
+ftpserver.user.admin.idletime=0
+ftpserver.user.admin.enableflag=true
+ftpserver.user.admin.homedirectory=/home/nils/ftp
+ftpserver.user.admin.userpassword=7089682\:A20FCF1EF2A9697A3A35401529CF5953
diff --git a/pom.xml b/pom.xml
index 5fa8390..6c90053 100644
--- a/pom.xml
+++ b/pom.xml
@@ -100,5 +100,12 @@
<version>1.0.0-M21</version>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.ftpserver</groupId>
+ <artifactId>ftpserver</artifactId>
+ <version>1.0.6</version>
+ <type>pom</type>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/src/main/java/org/openslx/imagemaster/App.java b/src/main/java/org/openslx/imagemaster/App.java
index 8040d35..9a5fd15 100644
--- a/src/main/java/org/openslx/imagemaster/App.java
+++ b/src/main/java/org/openslx/imagemaster/App.java
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
+import org.openslx.imagemaster.server.MasterFtpServer;
import org.openslx.imagemaster.thrift.server.BinaryListener;
/**
@@ -19,13 +20,20 @@ public class App
public static void main( String[] args )
{
// Init logging
- log.info( "Starting Application" );
+ log.info( "Starting Application" );
// Create binary listener
Thread t;
t = new Thread(new BinaryListener(), "BinaryListener");
servers.add(t);
t.start();
+
+ // Create Ftp Server
+ Thread f;
+ f = new Thread(new MasterFtpServer(2221, "admin", "admin", "/home/nils/ftp"), "FtpServer");
+ servers.add(f);
+ f.start();
+
// Run more servers
// ...
// Wait for all servers to die
diff --git a/src/main/java/org/openslx/imagemaster/db/DbSatellite.java b/src/main/java/org/openslx/imagemaster/db/DbSatellite.java
index da20fbc..037dfaa 100644
--- a/src/main/java/org/openslx/imagemaster/db/DbSatellite.java
+++ b/src/main/java/org/openslx/imagemaster/db/DbSatellite.java
@@ -1,10 +1,6 @@
package org.openslx.imagemaster.db;
public class DbSatellite {
- /*
- * Get row from mysql db and
- */
-
private String organization, address, name;
// needs to be public in order to be found by MySQL
diff --git a/src/main/properties/log4j.properties b/src/main/properties/log4j.properties
index 4ef8d15..ced1f8d 100644
--- a/src/main/properties/log4j.properties
+++ b/src/main/properties/log4j.properties
@@ -7,5 +7,5 @@ log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.logger.org.apache.directory=ERROR
-log4j.logger.org.apache.mina.filter.codec.ProtocolCodecFilter=ERROR
-log4j.logger.org.apache.mina.filter.ssl=ERROR \ No newline at end of file
+log4j.logger.org.apache.mina=ERROR
+log4j.logger.org.apache.ftpserver=ERROR \ No newline at end of file
diff --git a/src/test/java/org/openslx/imagemaster/AppTest.java b/src/test/java/org/openslx/imagemaster/AppTest.java
index 775d5c8..0add740 100644
--- a/src/test/java/org/openslx/imagemaster/AppTest.java
+++ b/src/test/java/org/openslx/imagemaster/AppTest.java
@@ -66,7 +66,7 @@ public class AppTest
assertTrue("Could not ping server", false);
}
try {
- SessionData sessionData = client.authenticate("ns202", "xxxxxxxxxx");
+ SessionData sessionData = client.authenticate("ns202", "xxxxxxxxxxx");
UserInfo userInfo = client.getUserFromToken(sessionData.getAuthToken());
System.out.println("User info: " + userInfo);
System.out.println("Server address from MySQL: " + sessionData.serverAddress);