Index: /branches/OKBJavaConnector/AdministrationService/src/com/heuristiclab/okb/service/administration/AdministrationServiceUtil.java
===================================================================
--- /branches/OKBJavaConnector/AdministrationService/src/com/heuristiclab/okb/service/administration/AdministrationServiceUtil.java	(revision 6326)
+++ /branches/OKBJavaConnector/AdministrationService/src/com/heuristiclab/okb/service/administration/AdministrationServiceUtil.java	(revision 6327)
@@ -4,5 +4,4 @@
  */
 package com.heuristiclab.okb.service.administration;
-
 
 import com.heuristiclab.services.administration.AdministrationService;
@@ -23,71 +22,71 @@
  */
 public final class AdministrationServiceUtil {
-    
+
+    /**
+     * workaround for getting the selfe signed certificates to work
+     **/
     static {
-		// Create a trust manager that does not validate certificate chains
-		TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
-			public java.security.cert.X509Certificate[] getAcceptedIssuers() {
-				return new java.security.cert.X509Certificate[] {};
-			}
+        // Create a trust manager that does not validate certificate chains
+        TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
 
-			public void checkClientTrusted(
-					java.security.cert.X509Certificate[] certs, String authType) {
-			}
+        public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+            return new java.security.cert.X509Certificate[]{};
+        }
 
-			public void checkServerTrusted(
-					java.security.cert.X509Certificate[] certs, String authType) {
-			}
-		} };
+        public void checkClientTrusted(
+                java.security.cert.X509Certificate[] certs, String authType) {
+        }
 
-		SSLContext sc;
-		try {
-			sc = SSLContext.getInstance("SSL");
-			sc.init(null, trustAllCerts, new java.security.SecureRandom());
-			HttpsURLConnection
-					.setDefaultSSLSocketFactory(sc.getSocketFactory());
-		} catch (NoSuchAlgorithmException e) {
-			throw new RuntimeException(e);
-		} catch (KeyManagementException e) {
-			throw new RuntimeException(e);
-		}
+        public void checkServerTrusted(
+                java.security.cert.X509Certificate[] certs, String authType) {
+        }
+    }};
 
-	}
-    
-    public static IAdministrationService createAdministrationService()
-    {
-        try
-        {
-     AdministrationService srv = new AdministrationService(new URL("https://services.heuristiclab.com/OKB.SPR.Java-3.3/AdministrationService.svc"));
+        SSLContext sc;
+        try {
+            sc = SSLContext.getInstance("SSL");
+            sc.init(null, trustAllCerts, new java.security.SecureRandom());
+            HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
+        } catch (NoSuchAlgorithmException e) {
+            throw new RuntimeException(e);
+        } catch (KeyManagementException e) {
+            throw new RuntimeException(e);
+        }
+
+    }
+
+
+    /**
+     * getting an instance of the service
+     * @return
+     */
+    protected static IAdministrationService createAdministrationService() {
+        try {
+            AdministrationService srv = new AdministrationService(new URL("https://services.heuristiclab.com/OKB.SPR.Java-3.3/AdministrationService.svc"));
             IAdministrationService port = srv.getAdministrationService();
             return port;
-            
-        }
-        catch(MalformedURLException mue)
-        {
+
+        } catch (MalformedURLException mue) {
             throw new IllegalStateException(mue);
         }
     }
 
+    /*
+     * fetching a platform from the service
+     */
+    public static Platform getPlattform(String platformName) {
+        Platform returnValue = null;
 
-  
-
-    public static Platform getPlattform(String platformName)
-    {
-        Platform returnValue = null;
-        
         IAdministrationService service = AdministrationServiceUtil.createAdministrationService();
-        for(com.heuristiclab.services.administration.Platform o : service.getPlatforms().getPlatform())
-        {
-            if(o.getName().getValue().equals(platformName))
-            {
+        for (com.heuristiclab.services.administration.Platform o : service.getPlatforms().getPlatform()) {
+            if (o.getName().getValue().equals(platformName)) {
                 returnValue = new Platform(o);
             }
         }
-        if(returnValue == null)
-        {
+        if (returnValue == null) {
             ObjectFactory of = new ObjectFactory();
             com.heuristiclab.services.administration.Platform p = of.createPlatform();
             p.setName(of.createString(platformName));
-           
+
             p.setDescription(of.createString(platformName));
             long id = createAdministrationService().addPlatform(p);
@@ -95,8 +94,6 @@
 
         }
-        
+
         return returnValue;
     }
-
-
 }
Index: /branches/OKBJavaConnector/AdministrationService/src/com/heuristiclab/okb/service/administration/Platform.java
===================================================================
--- /branches/OKBJavaConnector/AdministrationService/src/com/heuristiclab/okb/service/administration/Platform.java	(revision 6326)
+++ /branches/OKBJavaConnector/AdministrationService/src/com/heuristiclab/okb/service/administration/Platform.java	(revision 6327)
@@ -1,10 +1,7 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+
 package com.heuristiclab.okb.service.administration;
 
 /**
- *
+ * Value object for representing a platform
  * @author fab
  */
Index: /branches/OKBJavaConnector/ECJClient/src/com/heuristiclab/okb/ecj/OKBStatistics.java
===================================================================
--- /branches/OKBJavaConnector/ECJClient/src/com/heuristiclab/okb/ecj/OKBStatistics.java	(revision 6326)
+++ /branches/OKBJavaConnector/ECJClient/src/com/heuristiclab/okb/ecj/OKBStatistics.java	(revision 6327)
@@ -23,75 +23,118 @@
  *
  * @author fab
+ * Implementation of statics which are sending the parameters and results
+ * to the OKB Serverices
+ *
  */
-public class OKBStatistics extends Statistics{
+public class OKBStatistics extends Statistics {
 
+    /**
+     * Plattformname which has to be in already in the service
+     */
     public static final String ECJ_PLATFORM_NAME = "ECJ";
+    /**
+     * Name for parameters in the param file
+     */
     public static final String OKB_PARAMETER_NAME = "okb.parameter";
+    /**
+     * name of the seed paramter in the params file
+     */
     public static final String OKB_PARAMETER_SEED = "okb.parameter.seed";
+    /**
+     * username
+     */
+    public static final String OKB_USER = "okb.username";
+    /**
+     * password
+     */
+    public static final String OKB_PASSWORD = "okb.password";
+    /**
+     * current Platform
+     * */
     private Platform ecjPlatform;
-    
+    /**
+     * current Alogrithm
+     */
+    private Algorithm algorithm;
 
-
+    /**
+     * Setup of statistic, username and password are set
+     *
+     * platform an algorithm are fetched from the service
+     * if the platform or algorithm are missing a illegal arugement excption is thorwn
+     **/
     @Override
     public void setup(EvolutionState state, Parameter base) {
         super.setup(state, base);
-    
-        
+        handler.UserNameHandler.setUser(getUsername(state));
+        handler.UserNameHandler.setPassword(getPassword(state));
 
+
+        ecjPlatform = AdministrationServiceUtil.getPlattform(ECJ_PLATFORM_NAME);
+        algorithm = RunCreationUtil.getAlgorithm(state.evaluator.getClass().getName(), ecjPlatform.getName());
     }
 
-
-
-    @Override
-    public void postInitializationStatistics(EvolutionState state) {
-        super.postInitializationStatistics(state);
-    }
-
+    /**
+     * Submitting the results to the service
+     * @param state
+     * @param result
+     */
     @Override
     public void finalStatistics(EvolutionState state, int result) {
         super.finalStatistics(state, result);
 
-       ecjPlatform = AdministrationServiceUtil.getPlattform(ECJ_PLATFORM_NAME);
-       Algorithm algorithm = RunCreationUtil.getAlgorithm(state.evaluator.getClass().getName(), ecjPlatform.getName());
-       Map<String, String> parameters = getParametersToSend(state);
-       ByteArrayOutputStream o = new ByteArrayOutputStream();
-       new XMLEncoder(o).writeObject(state);
 
-
-        
-        RunCreationUtil.createRun(parameters,result,new String(o.toByteArray()),getSeed(state),algorithm.getId() , ecjPlatform.getId());
+        Map<String, String> parameters = getParametersToSend(state);
+        ByteArrayOutputStream o = new ByteArrayOutputStream();
+        new XMLEncoder(o).writeObject(state);
+        RunCreationUtil.createRun(parameters, result, new String(o.toByteArray()), getSeed(state), algorithm.getId(), ecjPlatform.getId());
 
     }
 
-    private int getSeed(EvolutionState state)
-    {
+    /**
+     * getting the username out of the config
+     **/
+    protected final String getUsername(EvolutionState state) {
+        return state.parameters.getString(new Parameter(OKB_USER), null);
+    }
+
+    /**
+     * getting the password out of the config
+     *
+     */
+    private String getPassword(EvolutionState state) {
+        return state.parameters.getString(new Parameter(OKB_PASSWORD), null);
+    }
+
+    /**
+     * getting the default seed out of the config
+     * @throws  IllegalArgumentException if the seed is missing
+     */
+    private int getSeed(EvolutionState state) {
         int returnValue = 0;
-        String seedName = state.parameters.getString(new Parameter(OKB_PARAMETER_SEED),null);
-        if(seedName == null)
+        String seedName = state.parameters.getString(new Parameter(OKB_PARAMETER_SEED), null);
+        if (seedName == null) {
             throw new IllegalArgumentException("no seed given!");
+        }
 
-        returnValue = state.parameters.getInt(new Parameter(seedName),null);
+        returnValue = state.parameters.getInt(new Parameter(seedName), null);
 
         return returnValue;
     }
 
-
-    private Map<String, String> getParametersToSend(EvolutionState state)
-    {
+    /**
+     * getting the parameters out of the config
+     **/
+    private Map<String, String> getParametersToSend(EvolutionState state) {
         Map<String, String> returnValue = new HashMap<String, String>();
-        for(String name : state.parameters.getString(new Parameter(OKB_PARAMETER_NAME),null).split(";"))
-        {
-            String tmp = state.parameters.getString(new Parameter(name.trim()),null);
-            if(tmp == null)
+        for (String name : state.parameters.getString(new Parameter(OKB_PARAMETER_NAME), null).split(";")) {
+            String tmp = state.parameters.getString(new Parameter(name.trim()), null);
+            if (tmp == null) {
                 returnValue.put(name, name);
-            else
+            } else {
                 returnValue.put(name, tmp);
-
+            }
         }
-
         return returnValue;
     }
-    
-    
-    
 }
Index: /branches/OKBJavaConnector/ECJClient/src/tutorial1.params
===================================================================
--- /branches/OKBJavaConnector/ECJClient/src/tutorial1.params	(revision 6326)
+++ /branches/OKBJavaConnector/ECJClient/src/tutorial1.params	(revision 6327)
@@ -53,5 +53,7 @@
 eval.problem		= ec.app.tutorial1.MaxOnes
 
-
+stat		= com.heuristiclab.okb.ecj.OKBStatistics
 okb.parameter = pop.subpop.0.size; pop.subpop.0.duplicate-retrie
 okb.parameter.seed = seed.0
+okb.user = okbtester
+okb.password = okbtester
Index: /branches/OKBJavaConnector/RunCreationService/nbproject/project.properties
===================================================================
--- /branches/OKBJavaConnector/RunCreationService/nbproject/project.properties	(revision 6326)
+++ /branches/OKBJavaConnector/RunCreationService/nbproject/project.properties	(revision 6327)
@@ -56,5 +56,5 @@
 javadoc.version=false
 javadoc.windowtitle=
-main.class=
+main.class=runcreationservice.Main
 manifest.file=manifest.mf
 meta.inf.dir=${src.dir}/META-INF
Index: /branches/OKBJavaConnector/RunCreationService/src/com/heurisitclab/okb/service/runcreation/Algorithm.java
===================================================================
--- /branches/OKBJavaConnector/RunCreationService/src/com/heurisitclab/okb/service/runcreation/Algorithm.java	(revision 6326)
+++ /branches/OKBJavaConnector/RunCreationService/src/com/heurisitclab/okb/service/runcreation/Algorithm.java	(revision 6327)
@@ -23,4 +23,8 @@
     }
 
+    public Long getId()
+    {
+        return id;
+    }
 
 }
Index: /branches/OKBJavaConnector/RunCreationService/src/com/heurisitclab/okb/service/runcreation/RunCreationUtil.java
===================================================================
--- /branches/OKBJavaConnector/RunCreationService/src/com/heurisitclab/okb/service/runcreation/RunCreationUtil.java	(revision 6326)
+++ /branches/OKBJavaConnector/RunCreationService/src/com/heurisitclab/okb/service/runcreation/RunCreationUtil.java	(revision 6327)
@@ -5,8 +5,19 @@
 package com.heurisitclab.okb.service.runcreation;
 
+import com.heuristiclab.services.runcreation.ArrayOfValue;
+import com.heuristiclab.services.runcreation.DataType;
 import com.heuristiclab.services.runcreation.IRunCreationService;
+import com.heuristiclab.services.runcreation.IntValue;
+import com.heuristiclab.services.runcreation.ObjectFactory;
 import com.heuristiclab.services.runcreation.RunCreationService;
+import com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl;
+
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Map;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
 
 /**
@@ -16,5 +27,5 @@
 public class RunCreationUtil {
 
-    public static IRunCreationService createRunCreationService() {
+    protected static IRunCreationService createRunCreationService() {
         try {
             RunCreationService srv = new RunCreationService(new URL("https://services.heuristiclab.com/OKB.SPR.Java-3.3/RunCreationService.svc"));
@@ -26,5 +37,8 @@
         }
     }
-
+    /**
+     * fetching an Algorithm by name and platformName from the service
+     *@throws  IllegalArgumentException if no algorithm is found
+     */
     public static Algorithm getAlgorithm(String name, String platformName)
     {
@@ -44,27 +58,58 @@
         }
 
-        return returnValue;
-
-
-    
+        return returnValue;   
     }
 
 
-    public static Run createRun()
+    /**
+     * submitting a run to the service
+     */
+    public static void createRun(Map<String, String> parameters, int result,String resultString,int seed, long algorithmId, long problemId)
     {
-       // Run returnValue = new Run();
-       // com.heuristiclab.services.runcreation.Run r = null;
-       // r.setAlgorithmId(Long.MIN_VALUE);
-       // r.setClientId(null);
-       // r.setProblemId(Long.MIN_VALUE);
-       // r.setUserId(null);
-       // createAdministrationService();
 
+        com.heuristiclab.services.runcreation.ObjectFactory of = new com.heuristiclab.services.runcreation.ObjectFactory();
+        
 
-        return null;
+        com.heuristiclab.services.runcreation.Run run = of.createRun();
+        
+        run.setAlgorithmId(algorithmId);
+        run.setClientId(System.getProperties().getProperty("java.version"));
+        run.setUserId("okbtester");
+        run.setProblemId(problemId);
+        Calendar cal = Calendar.getInstance();
+        
+        //of.createDateTime(XMLGregorianCalendarImpl.createDateTime(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND)));
+
+        run.setRandomSeed(seed);
+
+       ArrayOfValue values = of.createArrayOfValue();
+        for(Map.Entry<String, String> param : parameters.entrySet())
+        {
+            
+           com.heuristiclab.services.runcreation.StringValue v = of.createStringValue();
+           v.setName(of.createValueName(param.getKey()));
+           v.setValue(of.createStringValueValue(param.getValue()));
+          
+           values.getValue().add(v);
+        }
+      
+       
+
+        run.setParameterValues(of.createRunParameterValues(values));
+
+        ArrayOfValue resultValues = new ArrayOfValue();
+        IntValue value = new IntValue();
+        value.setValue(result);
+        value.setName(of.createValueName("integerResult"));
+        resultValues.getValue().add(value);
+        com.heuristiclab.services.runcreation.StringValue strValue = new com.heuristiclab.services.runcreation.StringValue();
+        strValue.setName(of.createValueName("result"));
+        strValue.setValue(of.createStringValueValue(resultString));
+        
+        resultValues.getValue().add(strValue);
+        
+        createRunCreationService().addRun(run);
     }
 
 
-
-
 }
