Skip to content
Browse files

initial jetty7->8 mods

  • Loading branch information...
1 parent a595500 commit 56cff7ec5ace3ea5a140890ee3caee04412e67df @pdmack pdmack committed Feb 22, 2014
View
9 ambari-project/pom.xml
@@ -27,6 +27,7 @@
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <jetty.version>8.1.14.v20131031</jetty.version>
</properties>
<pluginRepositories>
<pluginRepository>
@@ -216,22 +217,22 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
- <version>7.6.7.v20120910</version>
+ <version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-security</artifactId>
- <version>7.6.7.v20120910</version>
+ <version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
- <version>7.6.7.v20120910</version>
+ <version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
- <version>7.6.7.v20120910</version>
+ <version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
View
13 ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
@@ -22,8 +22,10 @@
import java.io.File;
import java.net.BindException;
import java.util.Map;
+import java.util.EnumSet;
import javax.crypto.BadPaddingException;
+import javax.servlet.DispatcherType;
import org.apache.ambari.eventdb.webservice.WorkflowJsonService;
import org.apache.ambari.server.AmbariException;
@@ -61,6 +63,7 @@
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
+import org.eclipse.jetty.server.session.AbstractSessionManager;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlet.ServletContextHandler;
@@ -156,7 +159,7 @@ public void run() throws Exception {
ServletContextHandler.SECURITY | ServletContextHandler.SESSIONS);
//Changing session cookie name to avoid conflicts
- root.getSessionHandler().getSessionManager().setSessionCookie("AMBARISESSIONID");
+ ((AbstractSessionManager)root.getSessionHandler().getSessionManager()).setSessionCookie("AMBARISESSIONID");
GenericWebApplicationContext springWebAppContext = new GenericWebApplicationContext();
springWebAppContext.setServletContext(root.getServletContext());
@@ -185,13 +188,13 @@ public void run() throws Exception {
springSecurityFilter.setTargetBeanName("springSecurityFilterChain");
//session-per-request strategy for api and agents
- root.addFilter(new FilterHolder(injector.getInstance(AmbariPersistFilter.class)), "/api/*", 1);
- agentroot.addFilter(new FilterHolder(injector.getInstance(AmbariPersistFilter.class)), "/agent/*", 1);
+ root.addFilter(new FilterHolder(injector.getInstance(AmbariPersistFilter.class)), "/api/*", EnumSet.of(DispatcherType.REQUEST));
+ agentroot.addFilter(new FilterHolder(injector.getInstance(AmbariPersistFilter.class)), "/agent/*", EnumSet.of(DispatcherType.REQUEST));
- agentroot.addFilter(SecurityFilter.class, "/*", 1);
+ agentroot.addFilter(SecurityFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
if (configs.getApiAuthentication()) {
- root.addFilter(new FilterHolder(springSecurityFilter), "/api/*", 1);
+ root.addFilter(new FilterHolder(springSecurityFilter), "/api/*", EnumSet.of(DispatcherType.REQUEST));
}

0 comments on commit 56cff7e

Please sign in to comment.
Something went wrong with that request. Please try again.