@PreAuthorize("hasRole('ROLE_CAN_MANAGE_REMOTE_PROVIDERS')")
@RequestMapping(value="/{typeId}/clearConfiguration", method = RequestMethod.POST)
public @ResponseBody RestResponse<RemoteProviderType> clearConfiguration(@PathVariable("typeId") int typeId,
HttpServletRequest request) {
RemoteProviderType type = remoteProviderTypeService.load(typeId);
if (type != null) {
remoteProviderTypeService.clearConfiguration(typeId);
ControllerUtils.addSuccessMessage(request, type.getName() + " configuration was cleared successfully.");
return RestResponse.success(remoteProviderTypeService.load(typeId));
} else {
return RestResponse.failure("Unable to find that Remote Provider Type");
}
}