Package com.labs64.netlicensing.provider
Interface RestProvider
- All Known Implementing Classes:
AbstractRestProvider,RestProviderImpl
public interface RestProvider
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(Authentication authentication) authenticate(String token) authenticate(String username, String password) <REQ,RES> RestResponse<RES> call(String method, String urlTemplate, REQ request, Class<RES> responseType, Map<String, String> queryParams) Helper method for performing REST requests with optional REST parameter map.voidconfigure(RestProvider.Configuration configuration)
-
Method Details
-
call
<REQ,RES> RestResponse<RES> call(String method, String urlTemplate, REQ request, Class<RES> responseType, Map<String, String> queryParams) throws RestExceptionHelper method for performing REST requests with optional REST parameter map.This method has a long list of parameters. It is only intended for internal use.
- Type Parameters:
REQ- type of the request entityRES- type of the responseType entity- Parameters:
method- the HTTP method to be used, i.e. GET, PUT, POST.urlTemplate- the REST URL urlTemplate.request- optional: The request body to be sent to the server. May be null.responseType- optional: expected response type. In case no responseType body is expected, responseType may be null.queryParams- optional: The REST query parameters values. May be null.- Returns:
- the responseType entity received from the server, or null if responseType is null.
- Throws:
RestException
-
authenticate
- Parameters:
username- username used for authenticationpassword- password used for authentication- Returns:
- authenticated RESTful provider
-
authenticate
- Parameters:
token- token used for authentication- Returns:
- authenticated RESTful provider
-
authenticate
- Parameters:
authentication-Authenticationobject- Returns:
- authenticated RESTful provider
-
configure
- Parameters:
configuration-RestProvider.Configurationconfiguration to use for the provider
-