Package org.eclipse.equinox.p2.core
Class UIServices
- java.lang.Object
-
- org.eclipse.equinox.p2.core.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UIServices.AuthenticationInfo
Authentication information returned from an authentication prompt request.static class
UIServices.TrustInfo
Trust information returned from a trust request.
-
Field Summary
Fields Modifier and Type Field Description static UIServices.AuthenticationInfo
AUTHENTICATION_PROMPT_CANCELED
This constant may be returned by thegetUsernamePassword
methods if the user explicitly canceled the authentication prompt.static String
SERVICE_NAME
Service name constant for the UI service.
-
Constructor Summary
Constructors Constructor Description UIServices()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract UIServices.TrustInfo
getTrustInfo(Certificate[][] untrustedChain, String[] unsignedDetail)
Opens a UI prompt to capture information about trusted content.UIServices.TrustInfo
getTrustInfo(Certificate[][] unTrustedCertificateChains, Collection<org.bouncycastle.openpgp.PGPPublicKey> untrustedPGPKeys, String[] unsignedDetail)
Opens a UI prompt to capture information about trusted content.abstract UIServices.AuthenticationInfo
getUsernamePassword(String location)
Opens a UI prompt for authentication detailsabstract UIServices.AuthenticationInfo
getUsernamePassword(String location, UIServices.AuthenticationInfo previousInfo)
Opens a UI prompt for authentication details when cached or remembered details where not accepted.void
showInformationMessage(String title, String text, String linkText)
Shows the given message to the user.
-
-
-
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 thegetUsernamePassword
methods if the user explicitly canceled the authentication prompt.- Since:
- 2.2
-
-
Method Detail
-
getUsernamePassword
public abstract UIServices.AuthenticationInfo getUsernamePassword(String location)
Opens a UI prompt for authentication details- Parameters:
location
- - the location requiring login details, may benull
.- Returns:
- The authentication result, or
null
, orAUTHENTICATION_PROMPT_CANCELED
-
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 detailspreviousInfo
- - the previously used authentication details - may not be null.- Returns:
- The authentication result, or
null
, orAUTHENTICATION_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 benull
, which means there are no untrusted certificate chains.unsignedDetail
- - an array of strings, where each String describes content that is not signed. May benull
, which means there is no unsigned content- Returns:
- the TrustInfo that describes the user's choices for trusting certificates and unsigned content.
- Implementation Requirements:
- Implementors should also override
getTrustInfo(Certificate[][], Collection, String[])
.
-
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 dialogtext
- - the message to be shownlinkText
- - an optional text to be rendered as hyperlink on the UI- Since:
- 2.4
-
getTrustInfo
public UIServices.TrustInfo getTrustInfo(Certificate[][] unTrustedCertificateChains, Collection<org.bouncycastle.openpgp.PGPPublicKey> untrustedPGPKeys, String[] unsignedDetail)
Opens a UI prompt to capture information about trusted content.- Parameters:
unTrustedCertificateChains
- - an array of certificate chains for which there is no current trust anchor. May benull
, which means there are no untrusted certificate chains.untrustedPGPKeys
- Collection of PGP signer keys that are not trustedunsignedDetail
- - an array of strings, where each String describes content that is not signed. May benull
, which means there is no unsigned content- Returns:
- the TrustInfo that describes the user's choices for trusting certificates and unsigned content.
- Since:
- 2.8
-
-