Package com.vaadin.flow.server
Class PwaRegistry
java.lang.Object
com.vaadin.flow.server.PwaRegistry
- All Implemented Interfaces:
Serializable
Registry for PWA data.
Includes:
PwaConfiguration
- basic info- List of
PwaIcon
:s - different sizes of icons for header and manifest - Offline page
- Manifest json
- Service worker
- Since:
- 1.2
- See Also:
-
Constructor Summary
ConstructorDescriptionPwaRegistry
(PWA pwa, jakarta.servlet.ServletContext servletContext) Creates a new PwaRegistry instance. -
Method Summary
Modifier and TypeMethodDescriptionList ofPwaIcon
:s that should be added to header.getIcons()
List of all icons managed byPwaRegistry
.static PwaRegistry
getInstance
(jakarta.servlet.ServletContext servletContext) Gets the pwa registry for the given servlet context.List ofPwaIcon
:s that should be added to manifest.webmanifest.manifest.webmanifest contents as a String.Static offline page as String.sw-runtime.js (service worker JavaScript for precaching runtime generated resources) as a String.
-
Constructor Details
-
PwaRegistry
Creates a new PwaRegistry instance.- Parameters:
pwa
- the pwa annotationservletContext
- the context- Throws:
IOException
- when icon or offline resources are not found.
-
-
Method Details
-
getInstance
Gets the pwa registry for the given servlet context. If the servlet context has no pwa registry, a new instance is created and assigned to the context.- Parameters:
servletContext
- the servlet context for which to get a route registry, notnull
- Returns:
- a registry instance for the given servlet context, not
null
-
getOfflineHtml
Static offline page as String.- Returns:
- contents of offline page
-
getManifestJson
manifest.webmanifest contents as a String.- Returns:
- contents of manifest.webmanifest
-
getRuntimeServiceWorkerJs
sw-runtime.js (service worker JavaScript for precaching runtime generated resources) as a String.- Returns:
- contents of sw-runtime.js
-
getHeaderIcons
List ofPwaIcon
:s that should be added to header.- Returns:
- List of
PwaIcon
:s that should be added to header
-
getManifestIcons
List ofPwaIcon
:s that should be added to manifest.webmanifest.- Returns:
- List of
PwaIcon
:s that should be added to manifest.webmanifest
-
getIcons
List of all icons managed byPwaRegistry
.- Returns:
- List of all icons managed by
PwaRegistry
-
getPwaConfiguration
-