Package com.netscape.cms.servlet.common
Class CMSGateway
java.lang.Object
com.netscape.cms.servlet.common.CMSGateway
This class is to hold some general method for servlets.
- Version:
- $Revision$, $Date$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
static final String
static org.slf4j.Logger
protected static boolean
protected static CMSFileLoader
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IAuthToken
checkAuthManager
(javax.servlet.http.HttpServletRequest httpReq, IArgBlock httpParams, X509Certificate cert, String authMgrName) static void
static AuthCredentials
getAuthCreds
(AuthManager authMgr, IArgBlock argBlock, X509Certificate clientCert) construct a authentication credentials to pass into authentication manager.static boolean
static File
getLangFile
(javax.servlet.http.HttpServletRequest req, File realpathFile, Locale[] locale) static Locale
protected static CMSTemplate
getTemplate
(String templateName, javax.servlet.http.HttpServletRequest httpReq, javax.servlet.ServletConfig servletConfig, CMSFileLoader fileLoader, Locale[] locale) get a templatestatic boolean
modifiedSince
(javax.servlet.http.HttpServletRequest req, long lastModified) Get the If-Modified-Since header and compare it to the millisecond epoch value passed in.static void
renderTemplate
(String templateName, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, javax.servlet.ServletConfig servletConfig, CMSFileLoader fileLoader) static void
setEnableAdminEnroll
(boolean enableAdminEnroll) toHashtable
(javax.servlet.http.HttpServletRequest req)
-
Field Details
-
logger
public static org.slf4j.Logger logger -
PROP_CMSGATEWAY
- See Also:
-
CERT_ATTR
- See Also:
-
mFileLoader
-
mEnableFileServing
protected static boolean mEnableFileServing -
AUTHMGR_PARAM
- See Also:
-
-
Constructor Details
-
CMSGateway
public CMSGateway()
-
-
Method Details
-
toHashtable
-
getEnableAdminEnroll
public static boolean getEnableAdminEnroll() -
setEnableAdminEnroll
- Throws:
EBaseException
-
disableAdminEnroll
- Throws:
EBaseException
-
getAuthCreds
public static AuthCredentials getAuthCreds(AuthManager authMgr, IArgBlock argBlock, X509Certificate clientCert) throws EBaseException construct a authentication credentials to pass into authentication manager.- Throws:
EBaseException
-
checkAuthManager
public static IAuthToken checkAuthManager(javax.servlet.http.HttpServletRequest httpReq, IArgBlock httpParams, X509Certificate cert, String authMgrName) throws EBaseException - Throws:
EBaseException
-
renderTemplate
public static void renderTemplate(String templateName, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, javax.servlet.ServletConfig servletConfig, CMSFileLoader fileLoader) throws EBaseException, IOException - Throws:
EBaseException
IOException
-
getLocale
-
getLangFile
public static File getLangFile(javax.servlet.http.HttpServletRequest req, File realpathFile, Locale[] locale) throws IOException - Parameters:
req
- http servlet requestrealpathFile
- the file to get.locale
- array of at least one to be filled with locale found.- Throws:
IOException
-
getTemplate
protected static CMSTemplate getTemplate(String templateName, javax.servlet.http.HttpServletRequest httpReq, javax.servlet.ServletConfig servletConfig, CMSFileLoader fileLoader, Locale[] locale) throws EBaseException, IOException get a template- Throws:
EBaseException
IOException
-
modifiedSince
public static boolean modifiedSince(javax.servlet.http.HttpServletRequest req, long lastModified) Get the If-Modified-Since header and compare it to the millisecond epoch value passed in. If there is no header, or there is a problem parsing the value, or if the file has been modified this will return true, indicating the file has changed.- Parameters:
lastModified
- The time value in milliseconds past the epoch to compare the If-Modified-Since header to.
-