public class UsernamePasswordHandler extends Object implements HttpRequestHandler
Constructor and Description |
---|
UsernamePasswordHandler(String repositoryId,
String username,
String password,
String baseUrl,
TokenClient client)
Creates a username and password authorization handler for the Laserfiche Self-Hosted API server
|
Modifier and Type | Method and Description |
---|---|
boolean |
afterSend(Response response)
Invoked after an HTTP response is received and will determine if a new access token should be retrieved.
|
BeforeSendResult |
beforeSend(Request request)
Invoked before an HTTP request is sent.
|
void |
close()
An implementation of
AutoCloseable that does not throw any checked exceptions. |
public UsernamePasswordHandler(String repositoryId, String username, String password, String baseUrl, TokenClient client)
repositoryId
- Repository ID.username
- The username used with "password" grant type.password
- The password used with "password" grant type.baseUrl
- APIServer Base Url e.g. https://{APIServerName}/LFRepositoryAPI.client
- OPTIONALpublic BeforeSendResult beforeSend(Request request)
HttpRequestHandler
beforeSend
in interface HttpRequestHandler
request
- The HTTP request.BeforeSendResult
public boolean afterSend(Response response)
HttpRequestHandler
afterSend
in interface HttpRequestHandler
response
- The HTTP response.public void close()
HttpRequestHandler
AutoCloseable
that does not throw any checked exceptions.
close
in interface HttpRequestHandler
close
in interface AutoCloseable
Copyright © 2024. All rights reserved.