@Override public void addAccessToken(String accessToken, String account, String clientId) { OAuthObject authObject = new OAuthObject(); authObject.setAccount(accessToken); authObject.setAccount(account); authObject.setClientId(clientId); this.cache.put(accessToken, account); }
@Override public void addAuthCode(String authCode, String account, String clientId) { OAuthObject authObject = new OAuthObject(); authObject.setAccessCode(authCode); authObject.setAccount(account); authObject.setClientId(clientId); this.cache.put(authCode, authObject); }
@Override public String getAccountByAccessToken(String accessToken) { OAuthObject authObject = (OAuthObject) cache.get(accessToken).get(); return authObject == null ? null : authObject.getAccount(); }
@Override public String getAccountByAuthCode(String authCode) { OAuthObject authObject = (OAuthObject) cache.get(authCode).get(); return authObject == null ? null : authObject.getAccount(); }