Interface SecureDeliveryServiceAPI


  • public interface SecureDeliveryServiceAPI
    Author:
    Luis Camargo (lcamargo@respondus.com)
    • Method Detail

      • isSecureDeliveryAvaliable

        boolean isSecureDeliveryAvaliable()
        Returns:
        true if at least one secure delivery module (other than NONE_ID) is available. A secure delivery module is available if the plugin that provides it was successfully loaded.
      • isSecureDeliveryModuleAvailable

        boolean isSecureDeliveryModuleAvailable​(String moduleId)
        Parameters:
        moduleId -
        Returns:
        true if the module with moduleId is available. NONE_ID is always available.
      • getSecureDeliveryModules

        SortedSet<RegisteredSecureDeliveryModuleIfc> getSecureDeliveryModules​(Locale locale)
        Returns:
        A set of RegisteredSecureDeliveryModuleIfc entries with the module name internationalized for the given locale. The list always includes NONE_ID as its first element. Others are ordered alphabetically by their name.
      • getTitleDecoration

        String getTitleDecoration​(String moduleId,
                                  Locale locale)
        Parameters:
        moduleId -
        locale -
        Returns:
        The title decoration for the given module and locale. Returns empty string if moduleId is NONE_ID, null, not available or disabled. The title decoration provides a visual indication that the assesment requires a particular secure delivery module.
      • getInitialHTMLFragments

        String getInitialHTMLFragments​(HttpServletRequest request,
                                       Locale locale)
        Returns the initial HTML fragments for all active modules. The fragments are inserted into the assessment list.
        Parameters:
        request -
        locale -
        Returns:
      • encryptPassword

        String encryptPassword​(String moduleId,
                               String password)
        Uses the module specified to encrypt the exit password before storing it on the assessment settings. The encryption method used is up to the module implementation. Returns the same password if module id is null or NONE_ID or if the module is no longer available.
        Parameters:
        moduleId -
        password -
        Returns:
        the encrypted password
      • decryptPassword

        String decryptPassword​(String moduleId,
                               String password)
        Uses the module specified to decrypt the exit password. The encryption method used is up to the module implementation. Returns the same password if module id is null or NONE_ID or if the module is no longer available.
        Parameters:
        moduleId -
        password -
        Returns:
        the plain text password
      • getModuleReference

        SecureDeliveryModuleIfc getModuleReference​(String moduleId,
                                                   Object context)
        Helper method to obtain a reference to the runtime instance of the module specified. The context object provided is passed to the module itself for validation and the reference is only returned if the module validation is successful. How the actual context type and how it's validated is up to each module implementation.
        Parameters:
        moduleId -
        context -
        Returns:
        the reference. null if the module is not avaliable or if the module rejected the context
      • isSecureDeliveryAvaliable

        boolean isSecureDeliveryAvaliable​(Long publishedAssessmentId)
      • getSecureDeliveryServiceNameForModule

        Optional<String> getSecureDeliveryServiceNameForModule​(String moduleId,
                                                               Locale locale)
        Gets the name of the secure delivery service associated with the specified module