Made things compile after ClientDetailsEntity refactoring

pull/165/merge
Amanda Anganes 2012-08-08 09:55:44 -04:00
parent a68a4f9796
commit 780839dbf9
3 changed files with 9 additions and 6 deletions

View File

@ -27,7 +27,7 @@ public interface ClientDetailsEntityService extends ClientDetailsService {
public ClientDetailsEntity loadClientByClientId(String clientId) throws OAuth2Exception;
public ClientDetailsEntity createClient(String clientId, String clientSecret, Set<String> scope, Set<String> grantTypes, String redirectUri, Set<GrantedAuthority> authorities, Set<String> resourceIds, String name, String description, boolean allowRefresh, Integer accessTokenTimeout, Integer refreshTokenTimeout, String owner);
public ClientDetailsEntity createClient(String clientId, String clientSecret, Set<String> scope, Set<String> grantTypes, String redirectUri, Set<GrantedAuthority> authorities, Set<String> resourceIds, String name, String description, boolean allowRefresh, Integer accessTokenTimeout, Integer refreshTokenTimeout, Set<String> contacts);
public ClientDetailsEntity createClient(ClientDetailsEntity client);

View File

@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.common.base.Strings;
import com.google.common.collect.Sets;
@Service
@Transactional
@ -84,7 +85,7 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
Set<String> scope, Set<String> grantTypes, String redirectUri, Set<GrantedAuthority> authorities,
Set<String> resourceIds,
String name, String description, boolean allowRefresh, Integer accessTokenTimeout,
Integer refreshTokenTimeout, String owner) {
Integer refreshTokenTimeout, Set<String> contacts) {
// TODO: check "owner" locally?
@ -96,13 +97,13 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
redirectUris.add(redirectUri);
client.setRegisteredRedirectUri(redirectUris);
client.setAuthorities(authorities);
client.setClientName(name);
client.setApplicationName(name);
client.setClientDescription(description);
client.setAllowRefresh(allowRefresh);
client.setAccessTokenValiditySeconds(accessTokenTimeout);
client.setRefreshTokenValiditySeconds(refreshTokenTimeout);
client.setResourceIds(resourceIds);
client.setOwner(owner);
client.setContacts(contacts);
clientRepository.saveClient(client);

View File

@ -66,7 +66,8 @@ public class ClientAPI {
ClientDetailsEntity client = new Gson().fromJson(json, ClientDetailsEntity.class);
// set owners as current logged in user
client.setOwner(principal.getName());
//client.setOwner(principal.getName());
//TODO: owner has been replaced by a list of contacts, which should be styled as email addresses.
m.addAttribute("entity", clientService.saveClient(client));
return "jsonClientView";
@ -78,7 +79,8 @@ public class ClientAPI {
ClientDetailsEntity client = new Gson().fromJson(json, ClientDetailsEntity.class);
client.setClientId(id);
// set owners as current logged in user
client.setOwner(principal.getName());
// client.setOwner(principal.getName());
//TODO: owner has been replaced by a list of contacts, which should be styled as email addresses.
m.addAttribute("entity", clientService.saveClient(client));