use of org.orcid.jaxb.model.clientgroup.RedirectUri in project ORCID-Source by ORCID.
the class Jpa2JaxbAdapterImpl method toOrcidClient.
@Override
public OrcidClient toOrcidClient(ClientDetailsEntity clientDetailsEntity) {
OrcidClient client = new OrcidClient();
client.setClientId(clientDetailsEntity.getId());
client.setType(clientDetailsEntity.getClientType());
if (clientDetailsEntity != null) {
client.setClientSecret(clientDetailsEntity.getClientSecretForJpa());
client.setDisplayName(clientDetailsEntity.getClientName());
client.setShortDescription(clientDetailsEntity.getClientDescription());
client.setWebsite(clientDetailsEntity.getClientWebsite());
client.setPersistentTokenEnabled(clientDetailsEntity.isPersistentTokensEnabled());
client.setIdp(clientDetailsEntity.getAuthenticationProviderId());
client.setAllowAutoDeprecate(clientDetailsEntity.isAllowAutoDeprecate());
Set<ClientRedirectUriEntity> redirectUriEntities = clientDetailsEntity.getClientRegisteredRedirectUris();
RedirectUris redirectUris = new RedirectUris();
client.setRedirectUris(redirectUris);
for (ClientRedirectUriEntity redirectUriEntity : redirectUriEntities) {
RedirectUri redirectUri = new RedirectUri(redirectUriEntity.getRedirectUri());
redirectUri.setType(RedirectUriType.fromValue(redirectUriEntity.getRedirectUriType()));
String predefinedScope = redirectUriEntity.getPredefinedClientScope();
if (StringUtils.isNotBlank(predefinedScope)) {
List<ScopePathType> scopePathType = new ArrayList<ScopePathType>(ScopePathType.getScopesFromSpaceSeparatedString(predefinedScope));
redirectUri.setScope(scopePathType);
}
redirectUri.setActType(redirectUriEntity.getUriActType());
redirectUri.setGeoArea(redirectUriEntity.getUriGeoArea());
redirectUris.getRedirectUri().add(redirectUri);
}
}
return client;
}
Aggregations