isAlive.jsp revision e8721886dbfd32e88cc7077cbee4b6bb1b44b443
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce The contents of this file are subject to the terms
fcc9f7f86c2fa2ceb8a5c16dc934fea7fa6887f2Andreas Gustafsson of the Common Development and Distribution License
fcc9f7f86c2fa2ceb8a5c16dc934fea7fa6887f2Andreas Gustafsson (the License). You may not use this file except in
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce compliance with the License.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce You can obtain a copy of the License at
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce https://opensso.dev.java.net/public/CDDLv1.0.html or
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce See the License for the specific language governing
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce permission and limitations under the License.
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce When distributing Covered Code, include this CDDL
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce Header Notice in each file and include the License file
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce If applicable, add the following below the CDDL Header,
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce with the fields enclosed by brackets [] replaced by
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce your own identifying information:
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce "Portions Copyrighted [year] [name of copyright owner]"
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce $Id: isAlive.jsp,v 1.9 2008/10/20 23:32:44 veiming Exp $
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce Portions Copyrighted 2010 ForgeRock AS
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce<%@ page language="java"
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce <title>OpenAM</title>
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce // Get valid SSOToken
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce SSOToken token = (SSOToken) AccessController.doPrivileged(
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce // Construct the name to lookup
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce String name = "ou=services," + ServiceManager.getBaseDN();
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce // Check if the configuration data store is up
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce Object attributes = null;
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce SMSEntry entry = new SMSEntry(token, name);
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce attributes = entry.getAttributes();
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce } catch (Exception e) {
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce attributes = null;
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce if (attributes == null) {
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce * Identity Server or directory is down, have failure message here
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce * or throw an exception. This currently throws an exception
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce * which will cause web server to return error code of 500,
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce * to return an error message, comment the "throw" line
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce out.println("<h1>Server is DOWN</h1>");
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce throw (new ServletException("directory is down"));
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce * Identity Server is alive, have success message below
f293a69bcd1c1dd7bdac8f4102fc2398b9e475c8Eric Luce out.println("<h1>Server is ALIVE: </h1>");