Class UIServices


  • public abstract class UIServices
    extends Object
    Service used for prompting for user information from within lower level code. Implementors of this service are responsible for registering the service. It is possible that the UIServices service is requested very early in the startup sequence for an application. For example, applications that check for updates during startup will trigger the service lookup if a server requiring authentication is detected. For this reason, implementors of UIServices should ensure that the bundle providing the service is partitioned appropriately.
    Since:
    2.0
    • Field Detail

      • SERVICE_NAME

        public static final String SERVICE_NAME
        Service name constant for the UI service.
      • AUTHENTICATION_PROMPT_CANCELED

        public static final UIServices.AuthenticationInfo AUTHENTICATION_PROMPT_CANCELED
        This constant may be returned by the getUsernamePassword methods if the user explicitly canceled the authentication prompt.
        Since:
        2.2
    • Constructor Detail

      • UIServices

        public UIServices()
    • Method Detail

      • getUsernamePassword

        public abstract UIServices.AuthenticationInfo getUsernamePassword​(String location,
                                                                          UIServices.AuthenticationInfo previousInfo)
        Opens a UI prompt for authentication details when cached or remembered details where not accepted.
        Parameters:
        location - the location requiring login details
        previousInfo - - the previously used authentication details - may not be null.
        Returns:
        The authentication result, or null, or AUTHENTICATION_PROMPT_CANCELED
      • getTrustInfo

        public abstract UIServices.TrustInfo getTrustInfo​(Certificate[][] untrustedChain,
                                                          String[] unsignedDetail)
        Opens a UI prompt to capture information about trusted content.
        Parameters:
        untrustedChain - - an array of certificate chains for which there is no current trust anchor. May be null, which means there are no untrusted certificate chains.
        unsignedDetail - - an array of strings, where each String describes content that is not signed. May be null, which means there is no unsigned content
        Returns:
        the TrustInfo that describes the user's choices for trusting certificates and unsigned content.
      • showInformationMessage

        public void showInformationMessage​(String title,
                                           String text,
                                           String linkText)
        Shows the given message to the user. It depends on the concrete implementation how this is done, e.g. in a dialog, on the console, or in other ways.
        Parameters:
        title - - a title if the message is shown in a dialog
        text - - the message to be shown
        linkText - - an optional text to be rendered as hyperlink on the UI
        Since:
        2.4