001    /* 
002        Licensed to the Apache Software Foundation (ASF) under one
003        or more contributor license agreements.  See the NOTICE file
004        distributed with this work for additional information
005        regarding copyright ownership.  The ASF licenses this file
006        to you under the Apache License, Version 2.0 (the
007        "License"); you may not use this file except in compliance
008        with the License.  You may obtain a copy of the License at
009    
010           http://www.apache.org/licenses/LICENSE-2.0
011    
012        Unless required by applicable law or agreed to in writing,
013        software distributed under the License is distributed on an
014        "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015        KIND, either express or implied.  See the License for the
016        specific language governing permissions and limitations
017        under the License.  
018     */
019    package org.apache.wiki.auth.login;
020    
021    import javax.security.auth.callback.Callback;
022    import javax.servlet.http.HttpServletRequest;
023    
024    /**
025     * Callback for requesting and supplying a HttpServletRequest required by a
026     * LoginModule. This Callback is used by LoginModules needing access to the
027     * servlet request.
028     * @see javax.servlet.http.HttpServletRequest#getUserPrincipal() or
029     * @see javax.servlet.http.HttpServletRequest#getRemoteUser() methods.
030     * @since 2.3
031     */
032    public class HttpRequestCallback implements Callback
033    {
034    
035        private HttpServletRequest m_request;
036    
037        /**
038         * Sets the request object. CallbackHandler objects call this method..
039         * @param request the servlet request
040         */
041        public void setRequest( HttpServletRequest request )
042        {
043            m_request = request;
044        }
045    
046        /**
047         * Returns the request object. LoginModules call this method after a
048         * CallbackHandler sets the request.
049         * @return the servlet request
050         */
051        public HttpServletRequest getRequest()
052        {
053            return m_request;
054        }
055    
056    }