Package com.sun.identity.setup
Class AMSetupServlet
- java.lang.Object
-
- jakarta.servlet.GenericServlet
-
- jakarta.servlet.http.HttpServlet
-
- com.sun.identity.setup.AMSetupServlet
-
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
public class AMSetupServlet extends jakarta.servlet.http.HttpServlet
This class is the first class to get loaded by the Servlet container. It has helper methods to determine the status of OpenAM configuration when deployed as a single web-application. If OpenAM is not deployed as single web-application then the configured status returned is always true.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AMSetupServlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
chmodFileReadOnly(File f)
Change a file to be read only for owner (eg password file on disk that we want to protect)void
doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
static void
enableDebug()
static String
getBaseDir()
static String
getErrorMessage()
static LicenseLocator
getLicenseLocator()
static String
getPresetConfigDir()
void
init(jakarta.servlet.ServletConfig config)
static boolean
isConfigured()
static boolean
isConfigured(jakarta.servlet.ServletContext servletctx)
Invoked from the filter to decide which page needs to be displayed.static boolean
isCurrentConfigurationValid()
static boolean
isOpenDJUpgraded()
static boolean
isUpgradeCompleted()
static boolean
processRequest(IHttpServletRequest request, IHttpServletResponse response)
static String
readFile(String file)
static void
upgradeCompleted()
-
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Method Detail
-
init
public void init(jakarta.servlet.ServletConfig config) throws jakarta.servlet.ServletException
- Specified by:
init
in interfacejakarta.servlet.Servlet
- Overrides:
init
in classjakarta.servlet.GenericServlet
- Throws:
jakarta.servlet.ServletException
-
getLicenseLocator
public static LicenseLocator getLicenseLocator()
-
isCurrentConfigurationValid
public static boolean isCurrentConfigurationValid()
-
isConfigured
public static boolean isConfigured()
-
upgradeCompleted
public static void upgradeCompleted()
-
isUpgradeCompleted
public static boolean isUpgradeCompleted()
-
isOpenDJUpgraded
public static boolean isOpenDJUpgraded()
-
enableDebug
public static void enableDebug()
-
isConfigured
public static boolean isConfigured(jakarta.servlet.ServletContext servletctx)
Invoked from the filter to decide which page needs to be displayed.- Parameters:
servletctx
- is the Servlet Context- Returns:
- true if AM is already configured, false otherwise
-
doPost
public void doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException, ConfiguratorException
- Overrides:
doPost
in classjakarta.servlet.http.HttpServlet
- Throws:
IOException
jakarta.servlet.ServletException
ConfiguratorException
-
processRequest
public static boolean processRequest(IHttpServletRequest request, IHttpServletResponse response)
-
getErrorMessage
public static String getErrorMessage()
-
getPresetConfigDir
public static String getPresetConfigDir() throws ConfiguratorException
- Throws:
ConfiguratorException
-
getBaseDir
public static String getBaseDir() throws ConfiguratorException
- Throws:
ConfiguratorException
-
readFile
public static String readFile(String file) throws IOException
- Throws:
IOException
-
chmodFileReadOnly
public static void chmodFileReadOnly(File f) throws IOException
Change a file to be read only for owner (eg password file on disk that we want to protect)- Parameters:
f
- - the File handle to the file- Throws:
IOException
- if the file does not exist or permissions can not be changed
-
-