Skip to content

Commit

Permalink
KAA-521: Added possibility to get endpoint profile data based on endp…
Browse files Browse the repository at this point in the history
…oint key and endpoint group id.
  • Loading branch information
sashadidukh committed Oct 31, 2015
1 parent 3e5c74a commit 1397805
Show file tree
Hide file tree
Showing 62 changed files with 8,869 additions and 3,274 deletions.
Expand Up @@ -45,9 +45,9 @@
import org.kaaproject.kaa.client.persistence.KaaClientPropertiesState; import org.kaaproject.kaa.client.persistence.KaaClientPropertiesState;
import org.kaaproject.kaa.client.persistence.KaaClientState; import org.kaaproject.kaa.client.persistence.KaaClientState;
import org.kaaproject.kaa.client.persistence.PersistentStorage; import org.kaaproject.kaa.client.persistence.PersistentStorage;
import org.kaaproject.kaa.client.profile.ProfileContainer;
import org.kaaproject.kaa.client.profile.ProfileRuntimeException; import org.kaaproject.kaa.client.profile.ProfileRuntimeException;
import org.kaaproject.kaa.client.schema.SchemaRuntimeException; import org.kaaproject.kaa.client.schema.SchemaRuntimeException;
import org.kaaproject.kaa.client.profile.ProfileContainer;
import org.kaaproject.kaa.client.transport.TransportException; import org.kaaproject.kaa.client.transport.TransportException;
import org.kaaproject.kaa.client.util.CommonsBase64; import org.kaaproject.kaa.client.util.CommonsBase64;
import org.kaaproject.kaa.common.endpoint.gen.ProtocolMetaData; import org.kaaproject.kaa.common.endpoint.gen.ProtocolMetaData;
Expand Down
Expand Up @@ -18,19 +18,26 @@


import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;

import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.kaaproject.kaa.common.dto.ApplicationDto; import org.kaaproject.kaa.common.dto.ApplicationDto;
import org.kaaproject.kaa.common.dto.ConfigurationDto; import org.kaaproject.kaa.common.dto.ConfigurationDto;
import org.kaaproject.kaa.common.dto.ConfigurationRecordDto; import org.kaaproject.kaa.common.dto.ConfigurationRecordDto;
import org.kaaproject.kaa.common.dto.ConfigurationSchemaDto; import org.kaaproject.kaa.common.dto.ConfigurationSchemaDto;
import org.kaaproject.kaa.common.dto.EndpointGroupDto; import org.kaaproject.kaa.common.dto.EndpointGroupDto;
import org.kaaproject.kaa.common.dto.EndpointNotificationDto; import org.kaaproject.kaa.common.dto.EndpointNotificationDto;
import org.kaaproject.kaa.common.dto.EndpointProfileBodyDto;
import org.kaaproject.kaa.common.dto.EndpointProfileDto;
import org.kaaproject.kaa.common.dto.EndpointProfilesBodyDto;
import org.kaaproject.kaa.common.dto.EndpointProfilesPageDto;
import org.kaaproject.kaa.common.dto.EndpointUserConfigurationDto; import org.kaaproject.kaa.common.dto.EndpointUserConfigurationDto;
import org.kaaproject.kaa.common.dto.KaaAuthorityDto; import org.kaaproject.kaa.common.dto.KaaAuthorityDto;
import org.kaaproject.kaa.common.dto.NotificationDto; import org.kaaproject.kaa.common.dto.NotificationDto;
import org.kaaproject.kaa.common.dto.NotificationSchemaDto; import org.kaaproject.kaa.common.dto.NotificationSchemaDto;
import org.kaaproject.kaa.common.dto.PageLinkDto;
import org.kaaproject.kaa.common.dto.ProfileFilterDto; import org.kaaproject.kaa.common.dto.ProfileFilterDto;
import org.kaaproject.kaa.common.dto.ProfileFilterRecordDto; import org.kaaproject.kaa.common.dto.ProfileFilterRecordDto;
import org.kaaproject.kaa.common.dto.ProfileSchemaDto; import org.kaaproject.kaa.common.dto.ProfileSchemaDto;
Expand Down Expand Up @@ -81,6 +88,8 @@
import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;


import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

/** /**
* The Class KaaAdminController. * The Class KaaAdminController.
*/ */
Expand All @@ -94,6 +103,18 @@ public class KaaAdminController {
/** The Constant BUFFER. */ /** The Constant BUFFER. */
private static final int BUFFER = 1024 * 100; private static final int BUFFER = 1024 * 100;


/** The Constant DEFAULT_LIMIT. */
private static final String DEFAULT_LIMIT = "20";

/** The Constant DEFAULT_OFFSET. */
private static final String DEFAULT_OFFSET = "0";

/** The Constant HTTPS_PORT. */
public static final int HTTPS_PORT = 443;

/** The Constant HTTP_PORT. */
public static final int HTTP_PORT = 80;

/** The kaa admin service. */ /** The kaa admin service. */
@Autowired @Autowired
KaaAdminService kaaAdminService; KaaAdminService kaaAdminService;
Expand Down Expand Up @@ -149,6 +170,77 @@ public void handleKaaAdminServiceException(KaaAdminServiceException ex, HttpServ
} }
} }


/**
* Gets the endpoint profile by endpoint group id.
*/
@RequestMapping(value = "endpointProfileByGroupId", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE)
@ResponseBody
public EndpointProfilesPageDto getEndpointProfileByEndpointGroupId(
@RequestParam(value = "endpointGroupId") String endpointGroupId,
@RequestParam(value = "limit", defaultValue = DEFAULT_LIMIT) String limit,
@RequestParam(value = "offset", defaultValue = DEFAULT_OFFSET) String offset,
HttpServletRequest request) throws KaaAdminServiceException {
EndpointProfilesPageDto endpointProfilesPageDto = kaaAdminService.getEndpointProfileByEndpointGroupId(endpointGroupId, limit, offset);
if (endpointProfilesPageDto.hasEndpointProfiles()) {
PageLinkDto pageLinkDto = createNext(endpointProfilesPageDto.getPageLinkDto(), request);
endpointProfilesPageDto.setNext(pageLinkDto.getNext());
}
return endpointProfilesPageDto;
}

/**
* Gets the endpoint profile body by endpoint group id.
*/
@RequestMapping(value = "endpointProfileBodyByGroupId", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE)
@ResponseBody
public EndpointProfilesBodyDto getEndpointProfileBodyByEndpointGroupId(
@RequestParam(value = "endpointGroupId") String endpointGroupId,
@RequestParam(value = "limit", defaultValue = DEFAULT_LIMIT) String limit,
@RequestParam(value = "offset", defaultValue = DEFAULT_OFFSET) String offset,
HttpServletRequest request) throws KaaAdminServiceException {
EndpointProfilesBodyDto endpointProfilesBodyDto = kaaAdminService.getEndpointProfileBodyByEndpointGroupId(endpointGroupId, limit, offset);
if (endpointProfilesBodyDto.hasEndpointBodies()) {
PageLinkDto pageLinkDto = createNext(endpointProfilesBodyDto.getPageLinkDto(), request);
endpointProfilesBodyDto.setNext(pageLinkDto.getNext());
}
return endpointProfilesBodyDto;
}

private PageLinkDto createNext(PageLinkDto pageLink, HttpServletRequest request) {
if (pageLink != null && pageLink.getNext() == null) {
StringBuilder nextUrl = new StringBuilder();
nextUrl.append(request.getScheme()).append("://").append(request.getServerName());
int port = request.getServerPort();
if (HTTP_PORT != port && HTTPS_PORT != port) {
nextUrl.append(":").append(port);
}
String next = nextUrl.append("/kaaAdmin/rest/api/endpointProfileByGroupId?").append(pageLink.getNextUrlPart()).toString();
pageLink.setNext(next);
logger.debug("Generated next url {}", next);
}
return pageLink;
}

/**
* Gets the endpoint profile by endpoint key.
*
*/
@RequestMapping(value="endpointProfile/{endpointProfileKey}", method=RequestMethod.GET)
@ResponseBody
public EndpointProfileDto getEndpointProfileByKeyHash(@PathVariable String endpointProfileKey) throws KaaAdminServiceException {
return kaaAdminService.getEndpointProfileByKeyHash(endpointProfileKey);
}

/**
* Gets the endpoint profile body by endpoint key.
*
*/
@RequestMapping(value="endpointProfileBody/{endpointProfileKey}", method=RequestMethod.GET)
@ResponseBody
public EndpointProfileBodyDto getEndpointProfileBodyByKeyHash(@PathVariable String endpointProfileKey) throws KaaAdminServiceException {
return kaaAdminService.getEndpointProfileBodyByKeyHash(endpointProfileKey);
}

/** /**
* Check auth of kaa admin. * Check auth of kaa admin.
* *
Expand Down
Expand Up @@ -23,10 +23,19 @@
import static org.kaaproject.kaa.server.common.thrift.util.ThriftDtoConverter.toGenericDataStruct; import static org.kaaproject.kaa.server.common.thrift.util.ThriftDtoConverter.toGenericDataStruct;
import static org.kaaproject.kaa.server.common.thrift.util.ThriftDtoConverter.toGenericDto; import static org.kaaproject.kaa.server.common.thrift.util.ThriftDtoConverter.toGenericDto;
import static org.kaaproject.kaa.server.common.thrift.util.ThriftDtoConverter.toGenericDtoList; import static org.kaaproject.kaa.server.common.thrift.util.ThriftDtoConverter.toGenericDtoList;

import java.io.IOException; import java.io.IOException;
import java.security.InvalidParameterException; import java.security.InvalidParameterException;
import java.util.*; import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import net.iharder.Base64; import net.iharder.Base64;

import org.apache.avro.Schema; import org.apache.avro.Schema;
import org.apache.avro.SchemaParseException; import org.apache.avro.SchemaParseException;
import org.apache.avro.generic.GenericRecord; import org.apache.avro.generic.GenericRecord;
Expand All @@ -41,11 +50,16 @@
import org.kaaproject.kaa.common.dto.ConfigurationSchemaDto; import org.kaaproject.kaa.common.dto.ConfigurationSchemaDto;
import org.kaaproject.kaa.common.dto.EndpointGroupDto; import org.kaaproject.kaa.common.dto.EndpointGroupDto;
import org.kaaproject.kaa.common.dto.EndpointNotificationDto; import org.kaaproject.kaa.common.dto.EndpointNotificationDto;
import org.kaaproject.kaa.common.dto.EndpointProfileBodyDto;
import org.kaaproject.kaa.common.dto.EndpointProfileDto;
import org.kaaproject.kaa.common.dto.EndpointProfilesBodyDto;
import org.kaaproject.kaa.common.dto.EndpointProfilesPageDto;
import org.kaaproject.kaa.common.dto.EndpointUserConfigurationDto; import org.kaaproject.kaa.common.dto.EndpointUserConfigurationDto;
import org.kaaproject.kaa.common.dto.KaaAuthorityDto; import org.kaaproject.kaa.common.dto.KaaAuthorityDto;
import org.kaaproject.kaa.common.dto.NotificationDto; import org.kaaproject.kaa.common.dto.NotificationDto;
import org.kaaproject.kaa.common.dto.NotificationSchemaDto; import org.kaaproject.kaa.common.dto.NotificationSchemaDto;
import org.kaaproject.kaa.common.dto.NotificationTypeDto; import org.kaaproject.kaa.common.dto.NotificationTypeDto;
import org.kaaproject.kaa.common.dto.PageLinkDto;
import org.kaaproject.kaa.common.dto.ProfileFilterDto; import org.kaaproject.kaa.common.dto.ProfileFilterDto;
import org.kaaproject.kaa.common.dto.ProfileSchemaDto; import org.kaaproject.kaa.common.dto.ProfileSchemaDto;
import org.kaaproject.kaa.common.dto.SchemaDto; import org.kaaproject.kaa.common.dto.SchemaDto;
Expand Down Expand Up @@ -109,6 +123,7 @@
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

import com.google.common.base.Charsets; import com.google.common.base.Charsets;


@Service("kaaAdminService") @Service("kaaAdminService")
Expand All @@ -119,6 +134,11 @@ public class KaaAdminServiceImpl implements KaaAdminService, InitializingBean {
*/ */
private static final Logger LOG = LoggerFactory.getLogger(KaaAdminServiceImpl.class); private static final Logger LOG = LoggerFactory.getLogger(KaaAdminServiceImpl.class);


/**
* The Constant MAX_LIMIT.
*/
private static final int MAX_LIMIT = 500;

@Autowired @Autowired
private ControlThriftClientProvider clientProvider; private ControlThriftClientProvider clientProvider;


Expand Down Expand Up @@ -151,15 +171,95 @@ public void setPasswordEncoder(PasswordEncoder passwordEncoder) {
this.passwordEncoder = passwordEncoder; this.passwordEncoder = passwordEncoder;
} }


private Map<PluginType, Map<String, PluginInfoDto>> pluginsInfo = private Map<PluginType, Map<String, PluginInfoDto>> pluginsInfo = new HashMap<>();
new HashMap<>();


{ {
for (PluginType type : PluginType.values()) { for (PluginType type : PluginType.values()) {
pluginsInfo.put(type, new HashMap<String, PluginInfoDto>()); pluginsInfo.put(type, new HashMap<String, PluginInfoDto>());
} }
} }


@Override
public EndpointProfilesPageDto getEndpointProfileByEndpointGroupId(String endpointGroupId, String limit, String offset) throws KaaAdminServiceException {
checkAuthority(KaaAuthorityDto.TENANT_DEVELOPER, KaaAuthorityDto.TENANT_USER);
try {
if (Integer.valueOf(limit) > MAX_LIMIT) {
throw new IllegalArgumentException("Incorrect limit parameter. You must enter value not more than " + MAX_LIMIT);
}
EndpointGroupDto endpointGroupDto = getEndpointGroup(endpointGroupId);
PageLinkDto pageLinkDto = new PageLinkDto(endpointGroupId, limit, offset);
if (endpointGroupDto.isGroupAll()) {
pageLinkDto.setApplicationId(endpointGroupDto.getApplicationId());
}
EndpointProfilesPageDto endpointProfilesPage = toGenericDto(clientProvider.getClient().getEndpointProfileByEndpointGroupId(toGenericDataStruct(pageLinkDto)));
if (endpointProfilesPage.getEndpointProfiles() == null || !endpointProfilesPage.hasEndpointProfiles()) {
throw new KaaAdminServiceException(
"Requested item was not found!",
ServiceErrorCode.ITEM_NOT_FOUND);
}
return endpointProfilesPage;
} catch (Exception e) {
throw Utils.handleException(e);
}
}

@Override
public EndpointProfilesBodyDto getEndpointProfileBodyByEndpointGroupId(String endpointGroupId, String limit, String offset) throws KaaAdminServiceException {
checkAuthority(KaaAuthorityDto.TENANT_DEVELOPER, KaaAuthorityDto.TENANT_USER);
try {
if (Integer.valueOf(limit) > MAX_LIMIT) {
throw new IllegalArgumentException("Incorrect limit parameter. You must enter value not more than " + MAX_LIMIT);
}
EndpointGroupDto endpointGroupDto = getEndpointGroup(endpointGroupId);
PageLinkDto pageLinkDto = new PageLinkDto(endpointGroupId, limit, offset);
if (endpointGroupDto.isGroupAll()) {
pageLinkDto.setApplicationId(endpointGroupDto.getApplicationId());
}
EndpointProfilesBodyDto endpointProfilesBodyDto = toGenericDto(clientProvider.getClient().getEndpointProfileBodyByEndpointGroupId(toGenericDataStruct(pageLinkDto)));
if (!endpointProfilesBodyDto.hasEndpointBodies()) {
throw new KaaAdminServiceException(
"Requested item was not found!",
ServiceErrorCode.ITEM_NOT_FOUND);
}
return endpointProfilesBodyDto;
} catch (Exception e) {
throw Utils.handleException(e);
}
}

@Override
public EndpointProfileDto getEndpointProfileByKeyHash(String endpointProfileKeyHash) throws KaaAdminServiceException {
checkAuthority(KaaAuthorityDto.TENANT_DEVELOPER, KaaAuthorityDto.TENANT_USER);
try {
EndpointProfileDto profileDto = toDto(clientProvider.getClient().getEndpointProfileByKeyHash(endpointProfileKeyHash));
if (profileDto == null) {
throw new KaaAdminServiceException(
"Requested item was not found!",
ServiceErrorCode.ITEM_NOT_FOUND);
}
checkApplicationId(profileDto.getApplicationId());
return profileDto;
} catch (Exception e) {
throw Utils.handleException(e);
}
}

@Override
public EndpointProfileBodyDto getEndpointProfileBodyByKeyHash(String endpointProfileKeyHash) throws KaaAdminServiceException {
checkAuthority(KaaAuthorityDto.TENANT_DEVELOPER, KaaAuthorityDto.TENANT_USER);
try {
EndpointProfileBodyDto profileBodyDto = toGenericDto(clientProvider.getClient().getEndpointProfileBodyByKeyHash(endpointProfileKeyHash));
if (profileBodyDto == null) {
throw new KaaAdminServiceException(
"Requested item was not found!",
ServiceErrorCode.ITEM_NOT_FOUND);
}
return profileBodyDto;
} catch (Exception e) {
throw Utils.handleException(e);
}
}

@Override @Override
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
ClassPathScanningCandidateComponentProvider scanner = ClassPathScanningCandidateComponentProvider scanner =
Expand Down
Expand Up @@ -24,6 +24,10 @@
import org.kaaproject.kaa.common.dto.ConfigurationSchemaDto; import org.kaaproject.kaa.common.dto.ConfigurationSchemaDto;
import org.kaaproject.kaa.common.dto.EndpointGroupDto; import org.kaaproject.kaa.common.dto.EndpointGroupDto;
import org.kaaproject.kaa.common.dto.EndpointNotificationDto; import org.kaaproject.kaa.common.dto.EndpointNotificationDto;
import org.kaaproject.kaa.common.dto.EndpointProfileBodyDto;
import org.kaaproject.kaa.common.dto.EndpointProfileDto;
import org.kaaproject.kaa.common.dto.EndpointProfilesBodyDto;
import org.kaaproject.kaa.common.dto.EndpointProfilesPageDto;
import org.kaaproject.kaa.common.dto.EndpointUserConfigurationDto; import org.kaaproject.kaa.common.dto.EndpointUserConfigurationDto;
import org.kaaproject.kaa.common.dto.NotificationDto; import org.kaaproject.kaa.common.dto.NotificationDto;
import org.kaaproject.kaa.common.dto.NotificationSchemaDto; import org.kaaproject.kaa.common.dto.NotificationSchemaDto;
Expand Down Expand Up @@ -58,6 +62,14 @@
@RemoteServiceRelativePath("springGwtServices/kaaAdminService") @RemoteServiceRelativePath("springGwtServices/kaaAdminService")
public interface KaaAdminService extends RemoteService { public interface KaaAdminService extends RemoteService {


public EndpointProfilesPageDto getEndpointProfileByEndpointGroupId(String endpointGroupId, String limit, String offset) throws KaaAdminServiceException;

public EndpointProfileDto getEndpointProfileByKeyHash(String endpointProfileKeyHash) throws KaaAdminServiceException;

public EndpointProfilesBodyDto getEndpointProfileBodyByEndpointGroupId(String endpointGroupId, String limit, String offset) throws KaaAdminServiceException;

public EndpointProfileBodyDto getEndpointProfileBodyByKeyHash(String endpointProfileKeyHash) throws KaaAdminServiceException;

public List<TenantUserDto> getTenants() throws KaaAdminServiceException; public List<TenantUserDto> getTenants() throws KaaAdminServiceException;


public TenantUserDto getTenant(String userId) throws KaaAdminServiceException; public TenantUserDto getTenant(String userId) throws KaaAdminServiceException;
Expand Down
Expand Up @@ -80,6 +80,38 @@ public AdminClient(String host, int port) {
url = "http://"+host+":"+port + "/kaaAdmin/rest/api/"; url = "http://"+host+":"+port + "/kaaAdmin/rest/api/";
} }


public EndpointProfilesPageDto getEndpointProfileByEndpointGroupId(PageLinkDto pageLink) throws Exception {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
params.add("endpointGroupId", pageLink.getEndpointGroupId());
params.add("limit", pageLink.getLimit());
params.add("offset", pageLink.getOffset());
ParameterizedTypeReference<EndpointProfilesPageDto> typeRef = new ParameterizedTypeReference<EndpointProfilesPageDto>() {};
ResponseEntity<EndpointProfilesPageDto> entity = restTemplate.exchange(url + "endpointProfileByGroupId/" + params, HttpMethod.GET, null, typeRef);
return entity.getBody();
}

public EndpointProfilesBodyDto getEndpointProfileBodyByEndpointGroupId(PageLinkDto pageLink) throws Exception {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
params.add("endpointGroupId", pageLink.getEndpointGroupId());
params.add("limit", pageLink.getLimit());
params.add("offset", pageLink.getOffset());
ParameterizedTypeReference<EndpointProfilesBodyDto> typeRef = new ParameterizedTypeReference<EndpointProfilesBodyDto>() {};
ResponseEntity<EndpointProfilesBodyDto> entity = restTemplate.exchange(url + "endpointProfileBodyByGroupId/" + params, HttpMethod.GET, null, typeRef);
return entity.getBody();
}

public EndpointProfileDto getEndpointProfileByKeyHash(String endpointProfileKeyHash) throws Exception {
ParameterizedTypeReference<EndpointProfileDto> typeRef = new ParameterizedTypeReference<EndpointProfileDto>() {};
ResponseEntity<EndpointProfileDto> entity = restTemplate.exchange(url + "endpointProfile/" + endpointProfileKeyHash, HttpMethod.GET, null, typeRef);
return entity.getBody();
}

public EndpointProfileBodyDto getEndpointProfileBodyByKeyHash(String endpointProfileKeyHash) throws Exception {
ParameterizedTypeReference<EndpointProfileBodyDto> typeRef = new ParameterizedTypeReference<EndpointProfileBodyDto>() {};
ResponseEntity<EndpointProfileBodyDto> entity = restTemplate.exchange(url + "endpointProfileBody/" + endpointProfileKeyHash, HttpMethod.GET, null, typeRef);
return entity.getBody();
}

public AuthResultDto checkAuth() throws Exception { public AuthResultDto checkAuth() throws Exception {
return restTemplate.getForObject(url + "auth/checkAuth", AuthResultDto.class); return restTemplate.getForObject(url + "auth/checkAuth", AuthResultDto.class);
} }
Expand Down Expand Up @@ -321,7 +353,7 @@ public LogAppenderDto editLogAppenderDto(LogAppenderDto logAppenderDto) throws E
public UserVerifierDto editUserVerifierDto(UserVerifierDto userVerifierDto) throws Exception { public UserVerifierDto editUserVerifierDto(UserVerifierDto userVerifierDto) throws Exception {
return restTemplate.postForObject(url + "userVerifier", userVerifierDto, UserVerifierDto.class); return restTemplate.postForObject(url + "userVerifier", userVerifierDto, UserVerifierDto.class);
} }

public void downloadSdk(SdkPropertiesDto key, String destination) throws Exception { public void downloadSdk(SdkPropertiesDto key, String destination) throws Exception {
FileResponseExtractor extractor = new FileResponseExtractor( new File(destination)); FileResponseExtractor extractor = new FileResponseExtractor( new File(destination));
final List<MediaType> mediaTypes = Arrays.asList(MediaType.APPLICATION_JSON, final List<MediaType> mediaTypes = Arrays.asList(MediaType.APPLICATION_JSON,
Expand Down Expand Up @@ -354,7 +386,7 @@ public void doWithRequest(ClientHttpRequest httpRequest)
restTemplate.execute(url + "sdk", HttpMethod.POST, request, extractor); restTemplate.execute(url + "sdk", HttpMethod.POST, request, extractor);
logger.info("Downloaded sdk to file '{}'", extractor.getDestFile()); logger.info("Downloaded sdk to file '{}'", extractor.getDestFile());
} }

public FileData downloadSdk(SdkPropertiesDto key) throws Exception { public FileData downloadSdk(SdkPropertiesDto key) throws Exception {
FileDataResponseExtractor extractor = new FileDataResponseExtractor(); FileDataResponseExtractor extractor = new FileDataResponseExtractor();
final List<MediaType> mediaTypes = Arrays.asList(MediaType.APPLICATION_JSON, final List<MediaType> mediaTypes = Arrays.asList(MediaType.APPLICATION_JSON,
Expand Down
Expand Up @@ -326,6 +326,7 @@ public class DaoConstants {
public static final String SDK_TOKEN_TOKEN = "token"; public static final String SDK_TOKEN_TOKEN = "token";
public static final String SDK_TOKEN_RAW_DATA = "raw_data"; public static final String SDK_TOKEN_RAW_DATA = "raw_data";


public static final String LAST_PAGE_MESSAGE = "It is the last page";


private DaoConstants() { private DaoConstants() {
throw new UnsupportedOperationException("Not supported"); throw new UnsupportedOperationException("Not supported");
Expand Down

0 comments on commit 1397805

Please sign in to comment.