Create parser pool interface and move current pool to an implementation of this inter...
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / idp / provider / Shibboleth_StatusHandler.java
1 /*
2  * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package edu.internet2.middleware.shibboleth.idp.provider;
18
19 import java.io.IOException;
20
21 import javax.servlet.ServletException;
22 import javax.servlet.http.HttpServletRequest;
23 import javax.servlet.http.HttpServletResponse;
24
25 import org.w3c.dom.Element;
26
27 import edu.internet2.middleware.shibboleth.common.ShibbolethConfigurationException;
28 import edu.internet2.middleware.shibboleth.idp.IdPProtocolHandler;
29 import edu.internet2.middleware.shibboleth.idp.IdPProtocolSupport;
30 import edu.internet2.middleware.shibboleth.idp.RequestHandlingException;
31
32 /**
33  * Special handler that allows one to "ping" the IdP to make sure it is alive
34  * 
35  * @author Walter Hoehn
36  */
37 public class Shibboleth_StatusHandler extends BaseHandler implements IdPProtocolHandler {
38
39         public Shibboleth_StatusHandler(Element config) throws ShibbolethConfigurationException {
40
41                 super(config);
42         }
43
44         /**
45          * @see edu.internet2.middleware.shibboleth.idp.IdPProtocolHandler#getHandlerName()
46          */
47         public String getHandlerName() {
48
49                 return "Shibboleth Status";
50         }
51
52         /**
53          * @see edu.internet2.middleware.shibboleth.idp.IdPProtocolHandler#processRequest(javax.servlet.http.HttpServletRequest,
54          *      javax.servlet.http.HttpServletResponse, org.opensaml.SAMLRequest,
55          *      edu.internet2.middleware.shibboleth.idp.IdPProtocolSupport)
56          */
57         public void processRequest(HttpServletRequest request, HttpServletResponse response, IdPProtocolSupport support)
58                         throws RequestHandlingException, ServletException {
59
60                 try {
61                         response.setContentType("text/plain");
62                         response.getWriter().println("AVAILABLE");
63                 } catch (IOException e) {
64                         throw new ServletException(e);
65                 }
66         }
67
68 }