Class DefaultWbeHostManager

    • Constructor Detail

      • DefaultWbeHostManager

        protected DefaultWbeHostManager()
    • Method Detail

      • init

        @PostConstruct
        protected void init()
      • getClientAdministrationAccesses

        public List<org.silverpeas.kernel.util.Pair<String,​String>> getClientAdministrationAccesses​(String language)
        Description copied from interface: WbeHostManager
        Provides the data that permits to access administrations of Web Browser Edition clients.
        Specified by:
        getClientAdministrationAccesses in interface WbeHostManager
        Parameters:
        language - the user language.
        Returns:
        an optional URL as string.
      • notifyEditionWith

        public void notifyEditionWith​(WbeFile file,
                                      Set<String> userIds)
        Description copied from interface: WbeHostManager
        Notifies the manager of the number of users which are editing the given file at an instant.
        Specified by:
        notifyEditionWith in interface WbeHostManager
        Parameters:
        file - a WbeFile a file.
        userIds - set of WBE user identifiers.
      • enable

        public void enable​(boolean enable)
        Description copied from interface: WbeHostManager
        Enables the services.

        This usable only in the case of WBE is enable by setting property file.
        When enabled by setting file, it is possible the enable/disable the services in order to get as fast as possible control on WBE exchanges.

        Specified by:
        enable in interface WbeHostManager
        Parameters:
        enable - true to enable, false to disable.
      • isEnabled

        public boolean isEnabled()
        Description copied from interface: WbeHostManager
        Indicates if the Web Browser Edition is enabled.
        Specified by:
        isEnabled in interface WbeHostManager
        Returns:
        true if enabled, false otherwise.
      • isHandled

        public boolean isHandled​(WbeFile file)
        Description copied from interface: WbeHostManager
        Indicates if given WbeFile is handled by WBE client.
        Specified by:
        isHandled in interface WbeHostManager
        Parameters:
        file - the WBE file to check.
        Returns:
        true if handled, false otherwise.
      • prepareEditionWith

        public <T extends WbeEditionOptional<T> prepareEditionWith​(SilverpeasUserSession spUserSession,
                                                                     WbeFile anyFile)
        Description copied from interface: WbeHostManager
        Prepares a WBE edition from given data.

        If WBE is enabled and if the file is handled by the WBE client, a WbeEdition instance is returned. It contains the necessary data to initialize an edition from the WEB services.

        Specified by:
        prepareEditionWith in interface WbeHostManager
        Type Parameters:
        T - a WbeEdition type.
        Parameters:
        spUserSession - the silverpeas session from which the edition is needed.
        anyFile - a Silverpeas's WBE file.
        Returns:
        an optional WbeEdition instance.
      • getEditionContextFrom

        public <R> R getEditionContextFrom​(String fileId,
                                           String accessToken,
                                           BiFunction<Optional<WbeUser>,​Optional<WbeFile>,​R> contextInitializer)
        Description copied from interface: WbeHostManager
        Gets the edition context from a WBE file identifier and an access token.

        If no file exists into context against the given file identifier, then the given optional WBE file to context initializer is empty.

        If no user exists into context against the given access token, then the given optional WBE user to context initializer is empty.

        Specified by:
        getEditionContextFrom in interface WbeHostManager
        Type Parameters:
        R - the type of the context.
        Parameters:
        fileId - a file identifier as string.
        accessToken - an access token as string.
        contextInitializer - the context initializer.
        Returns:
        an initialized context.
      • revokeUser

        public void revokeUser​(WbeUser user)
        Description copied from interface: WbeHostManager
        Revokes from the WBE context the given WBE user.

        The revocation is done from instance data and not directly from the instance reference.

        Specified by:
        revokeUser in interface WbeHostManager
        Parameters:
        user - a WbeUser instance.
      • revokeFile

        public void revokeFile​(WbeFile file)
        Description copied from interface: WbeHostManager
        Revokes from the WBE edition context the given WBE file.

        The revocation is done from instance data and not directly from the instance reference.

        Specified by:
        revokeFile in interface WbeHostManager
        Parameters:
        file - a WbeFile instance.
      • clear

        public void clear()
        Description copied from interface: WbeHostManager
        Clears all the context of the Web Browser Edition.

        Client implementations will also be cleared.

        Specified by:
        clear in interface WbeHostManager