public interface ServiceUsernameAndPasswordProvider
Used by Credential Manager when looking up the username and password for the service in its Keystore - if it cannot find anything it will loop through all providers until one can provide them. If none can, the service invocation will (most probably) fail.
A typical implementation of this class would pop up a dialog and ask the user
for the password. Such providers should check
GraphicsEnvironment#isHeadless()
before returning to avoid attempts
to pop up dialogues on server/headless installations.
CredentialManager
Modifier and Type | Method and Description |
---|---|
UsernamePassword |
getServiceUsernameAndPassword(URI serviceURI,
String requestMessage)
Get the username and password pair for the given service URI.
|
void |
setServiceUsernameAndPassword(URI serviceURI,
UsernamePassword usernamePassword)
Set the username and password pair for the given service URI.
|
UsernamePassword getServiceUsernameAndPassword(URI serviceURI, String requestMessage)
serviceURI
- The service we are looking username and password forrequestMessage
- The message to be presented to the user when asking for the
username and password, normally useful for UI providers that
pop up dialogs, can be ignored otherwisevoid setServiceUsernameAndPassword(URI serviceURI, UsernamePassword usernamePassword)
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.