public void clearTokenCache() throws GadgetException { final boolean isLogging = BasicOAuth2Store.LOG.isLoggable(); if (isLogging) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "clearTokenCache"); } try { this.cache.clearTokens(); } catch (final OAuth2CacheException e) { if (isLogging) { BasicOAuth2Store.LOG.log("Error clearing OAuth2 Token cache", e); } throw new GadgetException(Code.OAUTH_STORAGE_ERROR, "Error clearing OAuth2Token cache", e); } if (isLogging) { BasicOAuth2Store.LOG.exiting(BasicOAuth2Store.LOG_CLASS, "clearTokenCache"); } }
public boolean clearCache() throws GadgetException { final boolean isLogging = BasicOAuth2Store.LOG.isLoggable(); if (isLogging) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "clearCache"); } try { this.cache.clearClients(); this.cache.clearTokens(); this.cache.clearAccessors(); } catch (final OAuth2PersistenceException e) { if (isLogging) { BasicOAuth2Store.LOG.log("Error clearing OAuth2 cache", e); } throw new GadgetException(Code.OAUTH_STORAGE_ERROR, "Error clearing OAuth2 cache", e); } if (isLogging) { BasicOAuth2Store.LOG.exiting(BasicOAuth2Store.LOG_CLASS, "clearCache", true); } return true; }