com.atlassian.confluence.plugins.crowdproxy
Class CrowdProxyServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.atlassian.confluence.plugins.crowdproxy.CrowdProxyServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class CrowdProxyServlet
extends javax.servlet.http.HttpServlet

Provide access to the Crowd REST API to system administrators in OnDemand. It's protected from access outside of the host. For testing purposes only.

See Also:
Serialized Form

Field Summary
protected static java.lang.String AUTHORIZATION_HTTP_HEADER_KEY
           
protected static java.lang.String CROWD_CREDENTIALS
           
protected static java.lang.String HTTP_REQUEST_HEADER_CONTENT_LENGTH
           
 
Constructor Summary
CrowdProxyServlet(PermissionManager permissionManager)
           
 
Method Summary
protected  org.apache.http.HttpRequest buildCrowdRequest(javax.servlet.http.HttpServletRequest incomingRequest)
          Builds the request to Crowd using the incoming request to the Crowd proxy.
protected  void buildResponse(org.apache.http.HttpResponse crowdResponse, javax.servlet.http.HttpServletResponse response)
          Sends an HTTP response based off the incoming response from Crowd.
protected  org.apache.http.HttpRequest createCrowdRequest(javax.servlet.http.HttpServletRequest incomingRequest, java.lang.String crowdUrl)
          Returns a request for Crowd, including its entity body if present.
protected  org.apache.http.HttpResponse executeCrowdRequest(org.apache.http.HttpRequest crowdRequest)
          Executes the request to Crowd.
 java.lang.String getServletInfo()
           
 void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void setCrowdRequestHeaders(javax.servlet.http.HttpServletRequest incomingRequest, org.apache.http.HttpRequest crowdRequest)
          Sets the required HTTP Headers in the request sent to Crowd resource.
protected  void setResponseHeaders(org.apache.http.HttpResponse crowdResponse, javax.servlet.http.HttpServletResponse response)
          Sets the response headers, based off the ones received in the Crowd response.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTHORIZATION_HTTP_HEADER_KEY

protected static final java.lang.String AUTHORIZATION_HTTP_HEADER_KEY
See Also:
Constant Field Values

CROWD_CREDENTIALS

protected static final java.lang.String CROWD_CREDENTIALS
See Also:
Constant Field Values

HTTP_REQUEST_HEADER_CONTENT_LENGTH

protected static final java.lang.String HTTP_REQUEST_HEADER_CONTENT_LENGTH
See Also:
Constant Field Values
Constructor Detail

CrowdProxyServlet

public CrowdProxyServlet(PermissionManager permissionManager)
Method Detail

getServletInfo

public java.lang.String getServletInfo()
Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class javax.servlet.GenericServlet

service

public void service(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response)
Overrides:
service in class javax.servlet.http.HttpServlet

buildCrowdRequest

protected org.apache.http.HttpRequest buildCrowdRequest(javax.servlet.http.HttpServletRequest incomingRequest)
                                                 throws java.io.IOException
Builds the request to Crowd using the incoming request to the Crowd proxy.

Throws:
java.io.IOException

createCrowdRequest

protected org.apache.http.HttpRequest createCrowdRequest(javax.servlet.http.HttpServletRequest incomingRequest,
                                                         java.lang.String crowdUrl)
                                                  throws java.io.IOException
Returns a request for Crowd, including its entity body if present.

Throws:
java.io.IOException

setCrowdRequestHeaders

protected void setCrowdRequestHeaders(javax.servlet.http.HttpServletRequest incomingRequest,
                                      org.apache.http.HttpRequest crowdRequest)
Sets the required HTTP Headers in the request sent to Crowd resource.


executeCrowdRequest

protected org.apache.http.HttpResponse executeCrowdRequest(org.apache.http.HttpRequest crowdRequest)
                                                    throws java.io.IOException
Executes the request to Crowd.

Throws:
java.io.IOException

buildResponse

protected void buildResponse(org.apache.http.HttpResponse crowdResponse,
                             javax.servlet.http.HttpServletResponse response)
                      throws java.io.IOException
Sends an HTTP response based off the incoming response from Crowd.

Throws:
java.io.IOException

setResponseHeaders

protected void setResponseHeaders(org.apache.http.HttpResponse crowdResponse,
                                  javax.servlet.http.HttpServletResponse response)
Sets the response headers, based off the ones received in the Crowd response.



Copyright © 2003-2014 Atlassian. All Rights Reserved.