public ConsumerToken getConsumerToken(final ApplicationLink applicationLink, final String username) { checkNotNull(username, "Username cannot be null!"); checkNotNull(applicationLink, "Application Link cannot be null!"); return consumerTokenStore.get(makeOAuthApplinksConsumerKey(username, applicationLink.getId().get())); }
public boolean removeConsumerToken(final ApplicationId applicationId, final String username) { Preconditions.checkNotNull(applicationId, "applicationLink"); verifyOAuthOutgoingEnabled(applicationId); final ConsumerTokenStore.Key key = makeOAuthApplinksConsumerKey(username, applicationId.get()); if (consumerTokenStore.get(key) != null) { consumerTokenStore.remove(key); return true; } return false; }
public ConsumerToken getConsumerToken(final ApplicationLink applicationLink, final String username) { Preconditions.checkNotNull(username, "Username cannot be null!"); Preconditions.checkNotNull(applicationLink, "Application Link cannot be null!"); verifyOAuthOutgoingEnabled(applicationLink.getId()); return consumerTokenStore.get(makeOAuthApplinksConsumerKey(username, applicationLink.getId().get())); }