Commits

Sebastian Sdorra committed ef1aa9d

use new ProxyServlet

Comments (0)

Files changed (4)

scm-plugin-backend/src/main/java/sonia/scm/plugin/BackendConfiguration.java

 
 //~--- non-JDK imports --------------------------------------------------------
 
+import sonia.scm.web.proxy.ProxyConfiguration;
 import sonia.scm.xml.XmlIntervalAdapter;
 
 //~--- JDK imports ------------------------------------------------------------
 
 import java.io.File;
 
-import java.net.URL;
 
 import java.util.Set;
 
    *
    * @return
    */
-  public URL getNewsUrl()
+  public ProxyConfiguration getNewsConfiguration()
   {
-    return newsUrl;
+    return newsConfiguration;
   }
 
   /**
     return multithreaded;
   }
 
-  //~--- set methods ----------------------------------------------------------
-
-  /**
-   * Method description
-   *
-   *
-   * @param directories
-   */
-  public void setDirectories(Set<File> directories)
-  {
-    this.directories = directories;
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @param excludes
-   */
-  public void setExcludes(Set<String> excludes)
-  {
-    this.excludes = excludes;
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @param multithreaded
-   */
-  public void setMultithreaded(boolean multithreaded)
-  {
-    this.multithreaded = multithreaded;
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @param newsUrl
-   */
-  public void setNewsUrl(URL newsUrl)
-  {
-    this.newsUrl = newsUrl;
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @param repositories
-   */
-  public void setRepositories(Set<PluginRepository> repositories)
-  {
-    this.repositories = repositories;
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @param scannInterval
-   */
-  public void setScannInterval(long scannInterval)
-  {
-    this.scannInterval = scannInterval;
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @param trackingCode
-   */
-  public void setTrackingCode(String trackingCode)
-  {
-    this.trackingCode = trackingCode;
-  }
-
   //~--- fields ---------------------------------------------------------------
 
   /** Field description */
   private boolean multithreaded = true;
 
   /** Field description */
-  @XmlElement(name = "news-url")
-  private URL newsUrl;
+  @XmlElement(name = "news-settings")
+  private ProxyConfiguration newsConfiguration;
 
   /** Field description */
   @XmlElement(name = "repository")

scm-plugin-backend/src/main/java/sonia/scm/plugin/NewsProxyURLProvider.java

 
 import com.google.inject.Inject;
 
-import sonia.scm.web.proxy.ProxyURLProvider;
+import sonia.scm.web.proxy.ProxyConfiguration;
+import sonia.scm.web.proxy.ProxyConfigurationProvider;
 
 //~--- JDK imports ------------------------------------------------------------
 
-import java.net.URL;
+import javax.servlet.http.HttpServletRequest;
 
 /**
  *
  * @author Sebastian Sdorra
  */
-public class NewsProxyURLProvider implements ProxyURLProvider
+public class NewsProxyURLProvider implements ProxyConfigurationProvider
 {
 
   /**
    * Method description
    *
    *
+   * @param request
+   *
    * @return
    */
   @Override
-  public URL getProxyURL()
+  public ProxyConfiguration getConfiguration(HttpServletRequest request)
   {
-    return configuration.getNewsUrl();
+    return configuration.getNewsConfiguration();
   }
 
   //~--- fields ---------------------------------------------------------------

scm-plugin-backend/src/main/java/sonia/scm/plugin/ScmBackendModule.java

 import sonia.scm.plugin.scanner.PluginScannerScheduler;
 import sonia.scm.plugin.scanner.TimerPluginScannerScheduler;
 import sonia.scm.util.Util;
-import sonia.scm.web.proxy.ProxyServet;
-import sonia.scm.web.proxy.ProxyURLProvider;
 
 //~--- JDK imports ------------------------------------------------------------
 
 import java.util.Map;
 
 import javax.xml.bind.JAXB;
+import sonia.scm.web.proxy.ProxyConfigurationProvider;
+import sonia.scm.web.proxy.ProxyServlet;
 
 /**
  *
     bind(UrlBuilderFactory.class);
 
     // news proxy
-    bind(ProxyURLProvider.class).to(NewsProxyURLProvider.class);
-    serve("/news*").with(ProxyServet.class);
+    bind(ProxyConfigurationProvider.class).to(NewsProxyURLProvider.class);
+    serve("/news*").with(ProxyServlet.class);
 
     Map<String, String> params = new HashMap<String, String>();
 

scm-plugin-backend/src/main/resources/logback.xml

         Purpose of the document follows.
 -->
 
-<configuration>
+<configuration scan="true" scanPeriod="30 seconds">
 
   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
     <!-- encoders are  by default assigned the type
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.