public static boolean runImport(final OAuth2Persister source, final OAuth2Persister target, final boolean clean) { if (BasicOAuth2Store.LOG.isLoggable()) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "runImport", new Object[] { source, target, clean }); } // No import for default persistence return false; }
@Override protected void configure() { if (OAuth2HandlerModule.LOG.isLoggable()) { OAuth2HandlerModule.LOG.entering(OAuth2HandlerModule.class.getName(), "configure"); } }
public void storeOAuth2Accessor(final OAuth2Accessor accessor) { final boolean isLogging = BasicOAuth2Store.LOG.isLoggable(); if (isLogging) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "storeOAuth2Accessor", accessor); } this.cache.storeOAuth2Accessor(accessor); if (isLogging) { BasicOAuth2Store.LOG.exiting(BasicOAuth2Store.LOG_CLASS, "storeOAuth2Accessor"); } }
public OAuth2Accessor getOAuth2Accessor(final OAuth2CallbackState state) { final boolean isLogging = BasicOAuth2Store.LOG.isLoggable(); if (isLogging) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "getOAuth2Accessor", state); } final OAuth2Accessor ret = this.cache.getOAuth2Accessor(state); if (isLogging) { BasicOAuth2Store.LOG.exiting(BasicOAuth2Store.LOG_CLASS, "getOAuth2Accessor", ret); } return ret; }
public OAuth2Token createToken() { final boolean isLogging = BasicOAuth2Store.LOG.isLoggable(); if (isLogging) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "createToken"); } final OAuth2Token ret = this.internalCreateToken(); if (isLogging) { BasicOAuth2Store.LOG.exiting(BasicOAuth2Store.LOG_CLASS, "clearCache", ret); } return ret; }
public OAuth2Accessor removeOAuth2Accessor(final OAuth2Accessor accessor) { final boolean isLogging = BasicOAuth2Store.LOG.isLoggable(); if (isLogging) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "removeOAuth2Accessor", accessor); } final OAuth2Accessor ret = null; if (accessor != null) { return this.cache.removeOAuth2Accessor(accessor); } if (isLogging) { BasicOAuth2Store.LOG.exiting(BasicOAuth2Store.LOG_CLASS, "removeOAuth2Accessor", ret); } return ret; }
@Test public void testEntering_2() throws Exception { final FilteredLogger fixture = FilteredLogger.getFilteredLogger(""); final String sourceClass = ""; final String sourceMethod = ""; final Object param = new Object(); fixture.entering(sourceClass, sourceMethod, param); }
@Test public void testEntering_2() throws Exception { final FilteredLogger fixture = FilteredLogger.getFilteredLogger(""); final String sourceClass = ""; final String sourceMethod = ""; final Object param = new Object(); fixture.entering(sourceClass, sourceMethod, param); }
private static String buildRefreshTokenUrl(final OAuth2Accessor accessor) { final boolean isLogging = BasicOAuth2Request.LOG.isLoggable(); if (isLogging) { BasicOAuth2Request.LOG.entering(BasicOAuth2Request.LOG_CLASS, "buildRefreshTokenUrl", accessor); } String ret = null; final String refreshUrl = accessor.getTokenUrl(); if (refreshUrl != null) { ret = BasicOAuth2Request.getCompleteRefreshUrl(refreshUrl); } if (isLogging) { BasicOAuth2Request.LOG.exiting(BasicOAuth2Request.LOG_CLASS, "buildRefreshTokenUrl", ret); } return ret; }
@Test public void testEntering_3() throws Exception { final FilteredLogger fixture = FilteredLogger.getFilteredLogger(""); final String sourceClass = ""; final String sourceMethod = ""; final Object[] params = new Object[] {}; fixture.entering(sourceClass, sourceMethod, params); }
@Test public void testEntering_1() throws Exception { final FilteredLogger fixture = FilteredLogger.getFilteredLogger(""); final String sourceClass = ""; final String sourceMethod = ""; fixture.entering(sourceClass, sourceMethod); }
@Test public void testEntering_1() throws Exception { final FilteredLogger fixture = FilteredLogger.getFilteredLogger(""); final String sourceClass = ""; final String sourceMethod = ""; fixture.entering(sourceClass, sourceMethod); }
@Test public void testEntering_3() throws Exception { final FilteredLogger fixture = FilteredLogger.getFilteredLogger(""); final String sourceClass = ""; final String sourceMethod = ""; final Object[] params = new Object[] {}; fixture.entering(sourceClass, sourceMethod, params); }
public void clearAccessorCache() throws GadgetException { final boolean isLogging = BasicOAuth2Store.LOG.isLoggable(); if (isLogging) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "clearAccessorCache"); } try { this.cache.clearAccessors(); } catch (final OAuth2CacheException e) { if (isLogging) { BasicOAuth2Store.LOG.log("Error clearing OAuth2 Accessor cache", e); } throw new GadgetException(Code.OAUTH_STORAGE_ERROR, "Error clearing OAuth2Accessor cache", e); } if (isLogging) { BasicOAuth2Store.LOG.exiting(BasicOAuth2Store.LOG_CLASS, "clearAccessorCache"); } }
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 void clearClientCache() throws GadgetException { final boolean isLogging = BasicOAuth2Store.LOG.isLoggable(); if (isLogging) { BasicOAuth2Store.LOG.entering(BasicOAuth2Store.LOG_CLASS, "clearClientCache"); } try { this.cache.clearClients(); } catch (final OAuth2CacheException e) { if (isLogging) { BasicOAuth2Store.LOG.log("Error clearing OAuth2 Client cache", e); } throw new GadgetException(Code.OAUTH_STORAGE_ERROR, "Error clearing OAuth2Client cache", e); } if (isLogging) { BasicOAuth2Store.LOG.exiting(BasicOAuth2Store.LOG_CLASS, "clearClientCache"); } } }
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; }
private boolean checkCanAuthorize(final OAuth2Accessor accessor) { final boolean isLogging = BasicOAuth2Request.LOG.isLoggable(); if (isLogging) { BasicOAuth2Request.LOG.entering(BasicOAuth2Request.LOG_CLASS, "checkCanAuthorize", accessor); } boolean ret = true; if (BasicOAuth2Request.LOG.isLoggable()) { BasicOAuth2Request.LOG.log("securityToken = {0}", this.securityToken); } final String pageOwner = this.securityToken.getOwnerId(); final String pageViewer = this.securityToken.getViewerId(); if (BasicOAuth2Request.LOG.isLoggable()) { BasicOAuth2Request.LOG.log("pageOwner = {0}", pageOwner); BasicOAuth2Request.LOG.log("pageViewer = {0}", pageViewer); } if (pageOwner == null || pageViewer == null) { accessor.setErrorResponse(null, OAuth2Error.AUTHORIZE_PROBLEM, "pageOwner or pageViewer is null", ""); ret = false; } else if (!this.fetcherConfig.isViewerAccessTokensEnabled() && !pageOwner.equals(pageViewer)) { accessor.setErrorResponse(null, OAuth2Error.AUTHORIZE_PROBLEM, "pageViewer is not pageOwner", ""); ret = false; } if (isLogging) { BasicOAuth2Request.LOG.exiting(BasicOAuth2Request.LOG_CLASS, "checkCanAuthorize", ret); } return ret; }
private HttpResponseBuilder fetchData(final OAuth2Accessor accessor, final boolean lastAttempt) { final boolean isLogging = BasicOAuth2Request.LOG.isLoggable(); if (isLogging) { BasicOAuth2Request.LOG.entering(BasicOAuth2Request.LOG_CLASS, "fetchData", accessor); } HttpResponseBuilder ret = null; try { final HttpResponse response = this.fetchFromServer(accessor, this.realRequest, lastAttempt); if (response != null) { ret = new HttpResponseBuilder(response); if (response.getHttpStatusCode() != HttpResponse.SC_OK && this.sendTraceToClient) { this.responseParams.addRequestTrace(this.realRequest, response); } } } catch (final OAuth2RequestException e) { ret = this.getErrorResponseBuilder(e, e.getError(), e.getErrorText(), e.getErrorUri(), e.getErrorDescription()); } if (isLogging) { BasicOAuth2Request.LOG.exiting(BasicOAuth2Request.LOG_CLASS, "fetchData", ret); } return ret; }
private HttpResponse processResponse(final OAuth2Accessor accessor, final HttpResponseBuilder responseBuilder) { final boolean isLogging = BasicOAuth2Request.LOG.isLoggable(); if (isLogging) { BasicOAuth2Request.LOG.entering(BasicOAuth2Request.LOG_CLASS, "processResponse", new Object[] { accessor, responseBuilder == null }); } if (accessor.isErrorResponse() || responseBuilder == null) { return this.sendErrorResponse(accessor.getErrorException(), accessor.getError(), accessor.getErrorContextMessage(), accessor.getErrorUri(), ""); } if (this.responseParams.getAuthorizationUrl() != null) { responseBuilder.setMetadata(OAuth2ResponseParams.APPROVAL_URL, this.responseParams.getAuthorizationUrl()); accessor.setRedirecting(true); } else { accessor.setRedirecting(false); } final HttpResponse ret = responseBuilder.create(); if (isLogging) { BasicOAuth2Request.LOG.exiting(BasicOAuth2Request.LOG_CLASS, "processResponse", "response logged in fetch()"); } return ret; }