Class SecurityHeaderService
java.lang.Object
fr.paris.lutece.portal.service.securityheader.SecurityHeaderService
This class provides a service that offers methods to manage security headers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate(SecurityHeader securityHeader) Create the security header given in parameter.voiddisable(int nSecurityHeaderId) Disable the security header with the id given in parameter.voidenable(int nSecurityHeaderId) Enable the security header with the id given in parameter.Returns all the security headers that match specified name, type and page category (if not null for the latter).findActive(String strType, String strPageCategory) Returns all security headers from the specified type and the specified category (if not null) that are active (attribute is_enable = true).findAllSorted(Locale locale) Returns a list of all security headers used in manage security headers page.Returns the reference list of security headers page categoriesGet security header cacheReturns the reference list of security headers typesvoidinitializedService(jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext.voidremove(int nSecurityHeaderId) Remove the security header given in parameter.voidupdate(SecurityHeader securityHeader) Update the security header given in parameter.
-
Constructor Details
-
SecurityHeaderService
public SecurityHeaderService()
-
-
Method Details
-
find
Returns all the security headers that match specified name, type and page category (if not null for the latter). If page category is null (REST api case), this criterion is ignored.- Parameters:
strName- The name of the security headerstrType- The type of the security headerpageCategory- The page category of the security header- Returns:
- list of security headers matching the criteria
-
findActive
Returns all security headers from the specified type and the specified category (if not null) that are active (attribute is_enable = true).- Parameters:
strType-strPageCategory-- Returns:
- collection on security headers
-
findAllSorted
Returns a list of all security headers used in manage security headers page. They are sorted by type, page category and name.- Parameters:
locale- The locale- Returns:
- list of all security headers
-
getTypeList
Returns the reference list of security headers types- Returns:
- ReferenceList object with security headers types
-
getPageCategoryList
Returns the reference list of security headers page categories- Returns:
- ReferenceList object with security headers page categories
-
create
Create the security header given in parameter. Like all the actions, this one invalidates the map containing the security headers.- Parameters:
securityHeader- The security header to create
-
update
Update the security header given in parameter. Like all the actions, this one invalidates the map containing the security headers.- Parameters:
securityHeader- The security header to update
-
remove
public void remove(int nSecurityHeaderId) Remove the security header given in parameter. Like all the actions, this one invalidates the map containing the security headers.- Parameters:
securityHeader- The security header to remove
-
enable
public void enable(int nSecurityHeaderId) Enable the security header with the id given in parameter. Like all the actions, this one invalidates the map containing the security headers.- Parameters:
nSecurityHeaderId- The id of the security header to enable
-
disable
public void disable(int nSecurityHeaderId) Disable the security header with the id given in parameter. Like all the actions, this one invalidates the map containing the security headers.- Parameters:
nSecurityHeaderId- The id of the security header to disable
-
getSecurityHeaderCache
Get security header cache- Returns:
- security header cache
-
initializedService
public void initializedService(@Observes @Initialized(jakarta.enterprise.context.ApplicationScoped.class) jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext. It ensures that this CDI beans are instantiated at the application startup.This method is triggered automatically by CDI when the
ApplicationScopedcontext is initialized, which typically occurs during the startup of the application server.- Parameters:
context- theServletContextthat is initialized. This parameter is observed and injected automatically by CDI when theApplicationScopedcontext is initialized.
-