Class SecurityHeaderService

java.lang.Object
fr.paris.lutece.portal.service.securityheader.SecurityHeaderService

@ApplicationScoped public class SecurityHeaderService extends Object
This class provides a service that offers methods to manage security headers.
  • Constructor Details

    • SecurityHeaderService

      public SecurityHeaderService()
  • Method Details

    • find

      public List<SecurityHeader> find(String strName, String strType, String pageCategory)
      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 header
      strType - The type of the security header
      pageCategory - The page category of the security header
      Returns:
      list of security headers matching the criteria
    • findActive

      public Collection<SecurityHeader> 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).
      Parameters:
      strType -
      strPageCategory -
      Returns:
      collection on security headers
    • findAllSorted

      public List<SecurityHeader> findAllSorted(Locale locale)
      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

      public ReferenceList getTypeList()
      Returns the reference list of security headers types
      Returns:
      ReferenceList object with security headers types
    • getPageCategoryList

      public ReferenceList getPageCategoryList()
      Returns the reference list of security headers page categories
      Returns:
      ReferenceList object with security headers page categories
    • create

      public void create(SecurityHeader securityHeader)
      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

      public void update(SecurityHeader securityHeader)
      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

      public Lutece107Cache<String,SecurityHeader> 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 the ApplicationScoped context. It ensures that this CDI beans are instantiated at the application startup.

      This method is triggered automatically by CDI when the ApplicationScoped context is initialized, which typically occurs during the startup of the application server.

      Parameters:
      context - the ServletContext that is initialized. This parameter is observed and injected automatically by CDI when the ApplicationScoped context is initialized.