Conversation
| } | ||
| actionCacheByType.addToCache(cacheKey, new ActionCacheEntry(actions), tenantDomain); | ||
| actionCacheByType.addToCacheOnRead(cacheKey, new ActionCacheEntry(actions), tenantDomain); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 1
| } | |
| actionCacheByType.addToCache(cacheKey, new ActionCacheEntry(actions), tenantDomain); | |
| actionCacheByType.addToCacheOnRead(cacheKey, new ActionCacheEntry(actions), tenantDomain); | |
| } | |
| LOG.info("Cache updated with actions for Action Type: " + actionType); | |
| actionCacheByType.addToCacheOnRead(cacheKey, new ActionCacheEntry(actions), tenantDomain); |
| LOG.debug("Entry fetched from DB for API Resource " + apiId + ". Updating cache"); | ||
| } | ||
| apiResourceCacheById.addToCache(cacheKey, new APIResourceCacheEntry(apiResource), tenantId); | ||
| apiResourceCacheById.addToCacheOnRead(cacheKey, new APIResourceCacheEntry(apiResource), tenantId); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 2
| apiResourceCacheById.addToCacheOnRead(cacheKey, new APIResourceCacheEntry(apiResource), tenantId); | |
| if (LOG.isDebugEnabled()) { | |
| LOG.debug("Entry fetched from DB for API Resource " + apiId + ". Updating cache"); | |
| } | |
| if (LOG.isDebugEnabled()) { | |
| LOG.debug("Adding API Resource to cache with ID: " + apiId); | |
| } |
| LOG.debug("Entry fetched from DB for API Resource " + identifier + ". Updating cache"); | ||
| } | ||
| apiResourceCacheByIdentifier.addToCache(cacheKey, new APIResourceCacheEntry(apiResource), tenantId); | ||
| apiResourceCacheByIdentifier.addToCacheOnRead(cacheKey, new APIResourceCacheEntry(apiResource), tenantId); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 3
| apiResourceCacheByIdentifier.addToCacheOnRead(cacheKey, new APIResourceCacheEntry(apiResource), tenantId); | |
| if (LOG.isDebugEnabled()) { | |
| LOG.debug("Entry fetched from DB for API Resource " + identifier + ". Updating cache"); | |
| } | |
| if (LOG.isDebugEnabled()) { | |
| LOG.debug("Adding API Resource to cache with identifier: " + identifier); | |
| } |
| public void addToCacheOnRead(K key, V entry) { | ||
|
|
||
| if (!isEnabled()) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 4
| public void addToCacheOnRead(K key, V entry) { | |
| if (!isEnabled()) { | |
| return; | |
| } | |
| public void addToCacheOnRead(K key, V entry) { | |
| if (!isEnabled()) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Cache is disabled. Skipping cache population for key."); | |
| } | |
| return; | |
| } |
| Cache<K, V> cache = getBaseCache(); | ||
| if (cache != null) { | ||
| cache.putOnRead(key, entry); | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 5
| Cache<K, V> cache = getBaseCache(); | |
| if (cache != null) { | |
| cache.putOnRead(key, entry); | |
| } | |
| Cache<K, V> cache = getBaseCache(); | |
| if (cache != null) { | |
| cache.putOnRead(key, entry); | |
| if (log.isDebugEnabled()) { | |
| log.debug("Cache entry added during read operation."); | |
| } | |
| } else { | |
| log.warn("Base cache is null. Unable to add cache entry during read operation."); | |
| } |
| public void addToCacheOnRead(RandomPasswordContainerCacheKey key, RandomPasswordContainerCacheEntry entry) { | ||
|
|
||
| super.addToCacheOnRead(key, entry, CarbonContext.getThreadLocalCarbonContext().getTenantDomain()); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 6
| public void addToCacheOnRead(RandomPasswordContainerCacheKey key, RandomPasswordContainerCacheEntry entry) { | |
| super.addToCacheOnRead(key, entry, CarbonContext.getThreadLocalCarbonContext().getTenantDomain()); | |
| public void addToCacheOnRead(RandomPasswordContainerCacheKey key, RandomPasswordContainerCacheEntry entry) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Adding random password container to cache on read for key: " + key.getKey()); | |
| } | |
| super.addToCacheOnRead(key, entry, CarbonContext.getThreadLocalCarbonContext().getTenantDomain()); |
| authenticatorCache.addToCacheOnRead(cacheKey, new AuthenticatorCacheEntry(authenticatorConfig), tenantId); | ||
| LOG.debug("Entry fetched from DB for authenticator " + authenticatorConfigName + ". Adding cache entry."); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 7
| authenticatorCache.addToCacheOnRead(cacheKey, new AuthenticatorCacheEntry(authenticatorConfig), tenantId); | |
| LOG.debug("Entry fetched from DB for authenticator " + authenticatorConfigName + ". Adding cache entry."); | |
| authenticatorCache.addToCacheOnRead(cacheKey, new AuthenticatorCacheEntry(authenticatorConfig), tenantId); | |
| if (LOG.isDebugEnabled()) { | |
| LOG.debug("Entry fetched from DB for authenticator " + authenticatorConfigName + ". Adding cache entry."); | |
| } |
| } | ||
| ServiceProviderTemplateCache.getInstance().addToCache(templateCacheKey, spTemplate, tenantDomain); | ||
| ServiceProviderTemplateCache.getInstance().addToCacheOnRead(templateCacheKey, spTemplate, tenantDomain); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 8
| } | |
| ServiceProviderTemplateCache.getInstance().addToCache(templateCacheKey, spTemplate, tenantDomain); | |
| ServiceProviderTemplateCache.getInstance().addToCacheOnRead(templateCacheKey, spTemplate, tenantDomain); | |
| } | |
| if (log.isDebugEnabled()) { | |
| log.debug(String.format("Adding template with name: %s to cache for tenant: %s", templateName, tenantDomain)); | |
| } | |
| ServiceProviderTemplateCache.getInstance().addToCacheOnRead(templateCacheKey, spTemplate, tenantDomain); |
| ServiceProviderCacheInboundAuthKey clientKey = new ServiceProviderCacheInboundAuthKey(clientId, type); | ||
| ServiceProviderCacheInboundAuthEntry clientEntry = new ServiceProviderCacheInboundAuthEntry(appName, | ||
| tenantDomain); | ||
| appCacheByInboundAuth.addToCache(clientKey, clientEntry, tenantDomain); | ||
| appCacheByInboundAuth.addToCacheOnRead(clientKey, clientEntry, tenantDomain); | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 9
| ServiceProviderCacheInboundAuthKey clientKey = new ServiceProviderCacheInboundAuthKey(clientId, type); | |
| ServiceProviderCacheInboundAuthEntry clientEntry = new ServiceProviderCacheInboundAuthEntry(appName, | |
| tenantDomain); | |
| appCacheByInboundAuth.addToCache(clientKey, clientEntry, tenantDomain); | |
| appCacheByInboundAuth.addToCacheOnRead(clientKey, clientEntry, tenantDomain); | |
| } | |
| if (appName != null) { | |
| ServiceProviderCacheInboundAuthKey clientKey = new ServiceProviderCacheInboundAuthKey(clientId, type); | |
| ServiceProviderCacheInboundAuthEntry clientEntry = new ServiceProviderCacheInboundAuthEntry(appName, | |
| tenantDomain); | |
| if (log.isDebugEnabled()) { | |
| log.debug("Adding service provider to cache for client: " + clientId + ", type: " + type); | |
| } | |
| appCacheByInboundAuth.addToCacheOnRead(clientKey, clientEntry, tenantDomain); | |
| } |
| AuthorizedAPICacheEntry cacheEntry = new AuthorizedAPICacheEntry(authorizedAPI); | ||
| authorizedAPICache.addToCache(cacheKey, cacheEntry, tenantId); | ||
| authorizedAPICache.addToCacheOnRead(cacheKey, cacheEntry, tenantId); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 11
| AuthorizedAPICacheEntry cacheEntry = new AuthorizedAPICacheEntry(authorizedAPI); | |
| authorizedAPICache.addToCache(cacheKey, cacheEntry, tenantId); | |
| authorizedAPICache.addToCacheOnRead(cacheKey, cacheEntry, tenantId); | |
| AuthorizedAPICacheEntry cacheEntry = new AuthorizedAPICacheEntry(authorizedAPI); | |
| if (LOG.isDebugEnabled()) { | |
| LOG.debug("Adding authorized API to cache for appId: " + appId + ", apiId: " + apiId); | |
| } |
| private void addDefaultAuthSeqToCacheOnRead(DefaultAuthenticationSequence sequence, String tenantDomain) { | ||
|
|
||
| if (DefaultAuthSeqMgtCache.getInstance().isEnabled()) { |
There was a problem hiding this comment.
Log Improvement Suggestion No: 13
| private void addDefaultAuthSeqToCacheOnRead(DefaultAuthenticationSequence sequence, String tenantDomain) { | |
| if (DefaultAuthSeqMgtCache.getInstance().isEnabled()) { | |
| private void addDefaultAuthSeqToCacheOnRead(DefaultAuthenticationSequence sequence, String tenantDomain) { | |
| if (DefaultAuthSeqMgtCache.getInstance().isEnabled()) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Adding default authentication sequence: " + sequence.getName() + | |
| " to cache on read for tenant: " + tenantDomain); | |
| } |
| public void addToCacheOnRead(K key, V entry) { | ||
|
|
||
| addToCacheOnRead(key, entry, getLoginTenantDomainFromContext()); | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 14
| public void addToCacheOnRead(K key, V entry) { | |
| addToCacheOnRead(key, entry, getLoginTenantDomainFromContext()); | |
| } | |
| public void addToCacheOnRead(K key, V entry) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Adding cache entry on read for key: " + key); | |
| } | |
| addToCacheOnRead(key, entry, getLoginTenantDomainFromContext()); |
|
|
||
| if (entry.getContext() != null && entry.getContext().getProperties() != null) { | ||
| Iterator it = entry.getContext().getProperties().entrySet().iterator(); | ||
| while (it.hasNext()) { | ||
| Map.Entry<String, Object> item = (Map.Entry<String, Object>) it.next(); | ||
| if (!(item.getValue() instanceof Serializable)) { | ||
| it.remove(); | ||
| } | ||
| } | ||
| if (log.isDebugEnabled()) { | ||
| String message = "[ Context Id : " + key.getContextId() + | ||
| ", Cache type : " + AUTHENTICATION_CONTEXT_CACHE_NAME + | ||
| ", Operation : STORE ]"; | ||
| log.debug("Authentication context is stored with details " + message); | ||
| } | ||
| if (entry.getContext() != null) { | ||
| try { | ||
| AuthenticationContextLoader.getInstance().optimizeAuthenticationContext(entry.getContext()); | ||
| } catch (SessionDataStorageOptimizationClientException e) { | ||
| if (log.isDebugEnabled()) { | ||
| log.debug("Client error occurred while optimizing the Authentication context with " + | ||
| "context id: " + entry.getContext().getContextIdentifier(), e); | ||
| } | ||
| return; | ||
| } catch (SessionDataStorageOptimizationServerException e) { | ||
| log.error("Server error occurred while optimizing the Authentication context with " + | ||
| "context id: " + entry.getContext().getContextIdentifier(), e); | ||
| return; | ||
| } catch (SessionDataStorageOptimizationException e) { | ||
| if (log.isDebugEnabled()) { | ||
| log.debug("Error occurred while optimizing the Authentication context with " + | ||
| "context id: " + entry.getContext().getContextIdentifier(), e); | ||
| } | ||
| return; | ||
| } | ||
| } | ||
| SessionDataStore.getInstance().storeSessionData(key.getContextId(), AUTHENTICATION_CONTEXT_CACHE_NAME, | ||
| entry, tenantId); | ||
| try { | ||
| AuthenticationContextLoader.getInstance().loadAuthenticationContext(entry.getContext()); | ||
| } catch (SessionDataStorageOptimizationClientException e) { | ||
| if (log.isDebugEnabled()) { | ||
| log.debug("Client error occurred while loading optimized authentication context" | ||
| + " with context id: " + entry.getContext().getContextIdentifier(), e); | ||
| } | ||
| } catch (SessionDataStorageOptimizationServerException e) { | ||
| log.error("Server error occurred while loading optimized authentication " + | ||
| "context with context id: " + entry.getContext().getContextIdentifier(), e); | ||
| } catch (SessionDataStorageOptimizationException e) { | ||
| if (log.isDebugEnabled()) { | ||
| log.debug("Error occurred while loading optimized authentication " + | ||
| "context with context id: " + entry.getContext().getContextIdentifier(), e); | ||
| } | ||
| } | ||
| } | ||
| public void addToCacheOnRead(AuthenticationContextCacheKey key, AuthenticationContextCacheEntry entry) { | ||
|
|
There was a problem hiding this comment.
Log Improvement Suggestion No: 15
| if (entry.getContext() != null && entry.getContext().getProperties() != null) { | |
| Iterator it = entry.getContext().getProperties().entrySet().iterator(); | |
| while (it.hasNext()) { | |
| Map.Entry<String, Object> item = (Map.Entry<String, Object>) it.next(); | |
| if (!(item.getValue() instanceof Serializable)) { | |
| it.remove(); | |
| } | |
| } | |
| if (log.isDebugEnabled()) { | |
| String message = "[ Context Id : " + key.getContextId() + | |
| ", Cache type : " + AUTHENTICATION_CONTEXT_CACHE_NAME + | |
| ", Operation : STORE ]"; | |
| log.debug("Authentication context is stored with details " + message); | |
| } | |
| if (entry.getContext() != null) { | |
| try { | |
| AuthenticationContextLoader.getInstance().optimizeAuthenticationContext(entry.getContext()); | |
| } catch (SessionDataStorageOptimizationClientException e) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Client error occurred while optimizing the Authentication context with " + | |
| "context id: " + entry.getContext().getContextIdentifier(), e); | |
| } | |
| return; | |
| } catch (SessionDataStorageOptimizationServerException e) { | |
| log.error("Server error occurred while optimizing the Authentication context with " + | |
| "context id: " + entry.getContext().getContextIdentifier(), e); | |
| return; | |
| } catch (SessionDataStorageOptimizationException e) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Error occurred while optimizing the Authentication context with " + | |
| "context id: " + entry.getContext().getContextIdentifier(), e); | |
| } | |
| return; | |
| } | |
| } | |
| SessionDataStore.getInstance().storeSessionData(key.getContextId(), AUTHENTICATION_CONTEXT_CACHE_NAME, | |
| entry, tenantId); | |
| try { | |
| AuthenticationContextLoader.getInstance().loadAuthenticationContext(entry.getContext()); | |
| } catch (SessionDataStorageOptimizationClientException e) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Client error occurred while loading optimized authentication context" | |
| + " with context id: " + entry.getContext().getContextIdentifier(), e); | |
| } | |
| } catch (SessionDataStorageOptimizationServerException e) { | |
| log.error("Server error occurred while loading optimized authentication " + | |
| "context with context id: " + entry.getContext().getContextIdentifier(), e); | |
| } catch (SessionDataStorageOptimizationException e) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Error occurred while loading optimized authentication " + | |
| "context with context id: " + entry.getContext().getContextIdentifier(), e); | |
| } | |
| } | |
| } | |
| public void addToCacheOnRead(AuthenticationContextCacheKey key, AuthenticationContextCacheEntry entry) { | |
| public void addToCacheOnRead(AuthenticationContextCacheKey key, AuthenticationContextCacheEntry entry) { | |
| log.debug("Adding authentication context to cache on read for context id: " + key.getContextId()); | |
| super.addToCacheOnRead(key, entry); |
| return; | ||
| } | ||
| } | ||
| SessionDataStore.getInstance().storeSessionData(key.getContextId(), AUTHENTICATION_CONTEXT_CACHE_NAME, |
There was a problem hiding this comment.
Log Improvement Suggestion No: 16
| return; | |
| } | |
| } | |
| SessionDataStore.getInstance().storeSessionData(key.getContextId(), AUTHENTICATION_CONTEXT_CACHE_NAME, | |
| return; | |
| } | |
| } | |
| log.debug(logPrefix + "Storing session data for context id: " + key.getContextId() + ", tenant id: " + tenantId); | |
| SessionDataStore.getInstance().storeSessionData(key.getContextId(), AUTHENTICATION_CONTEXT_CACHE_NAME, | |
| entry, tenantId); |
| * @param key Key which the cache entry is indexed by. | ||
| * @param entry Value to be stored in the cache. | ||
| */ | ||
| public void addToCacheOnRead(AuthenticationErrorCacheKey key, AuthenticationErrorCacheEntry entry) { |
There was a problem hiding this comment.
Log Improvement Suggestion No: 17
| public void addToCacheOnRead(AuthenticationErrorCacheKey key, AuthenticationErrorCacheEntry entry) { | |
| public void addToCacheOnRead(AuthenticationErrorCacheKey key, AuthenticationErrorCacheEntry entry) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Adding authentication error cache entry on read for key: " + key.getErrorKey()); | |
| } |
| tenantId = IdentityTenantUtil.getTenantId(tenantDomain); | ||
| } | ||
| } | ||
| SessionDataStore.getInstance().storeSessionData(key.getErrorKey(), CACHE_NAME, entry, tenantId); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 18
| SessionDataStore.getInstance().storeSessionData(key.getErrorKey(), CACHE_NAME, entry, tenantId); | |
| SessionDataStore.getInstance().storeSessionData(key.getErrorKey(), CACHE_NAME, entry, tenantId); | |
| if (log.isDebugEnabled()) { | |
| log.debug("Persisted authentication error cache entry to session data store for tenant: " + tenantId); | |
| } |
| public void addToCacheOnRead(AuthenticationRequestCacheKey key, AuthenticationRequestCacheEntry entry) { | ||
| super.addToCacheOnRead(key, entry); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 19
| public void addToCacheOnRead(AuthenticationRequestCacheKey key, AuthenticationRequestCacheEntry entry) { | |
| super.addToCacheOnRead(key, entry); | |
| public void addToCacheOnRead(AuthenticationRequestCacheKey key, AuthenticationRequestCacheEntry entry) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Adding authentication request to cache on read for key: " + key.getResultId()); | |
| } | |
| super.addToCacheOnRead(key, entry); |
| SessionDataStore.getInstance().storeSessionData(key.getResultId(), AUTHENTICATION_REQUEST_CACHE_NAME, | ||
| entry, tenantId); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 20
| SessionDataStore.getInstance().storeSessionData(key.getResultId(), AUTHENTICATION_REQUEST_CACHE_NAME, | |
| entry, tenantId); | |
| SessionDataStore.getInstance().storeSessionData(key.getResultId(), AUTHENTICATION_REQUEST_CACHE_NAME, | |
| entry, tenantId); | |
| if (log.isDebugEnabled()) { | |
| log.debug("Stored authentication request in session data store for tenant: " + tenantDomain); | |
| } |
| public void addToCacheOnRead(AuthenticationResultCacheKey key, AuthenticationResultCacheEntry entry) { | ||
| super.addToCacheOnRead(key, entry); | ||
| if (isTemporarySessionDataPersistEnabled) { | ||
| int tenantId = MultitenantConstants.INVALID_TENANT_ID; |
There was a problem hiding this comment.
Log Improvement Suggestion No: 21
| public void addToCacheOnRead(AuthenticationResultCacheKey key, AuthenticationResultCacheEntry entry) { | |
| super.addToCacheOnRead(key, entry); | |
| if (isTemporarySessionDataPersistEnabled) { | |
| int tenantId = MultitenantConstants.INVALID_TENANT_ID; | |
| public void addToCacheOnRead(AuthenticationResultCacheKey key, AuthenticationResultCacheEntry entry) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Adding authentication result to cache on read for key: " + key.getResultId()); | |
| } | |
| super.addToCacheOnRead(key, entry); | |
| if (isTemporarySessionDataPersistEnabled) { |
| } | ||
| SessionDataStore.getInstance().storeSessionData(key.getResultId(), CACHE_NAME, entry, tenantId); | ||
| } | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 22
| } | |
| SessionDataStore.getInstance().storeSessionData(key.getResultId(), CACHE_NAME, entry, tenantId); | |
| } | |
| } | |
| } | |
| SessionDataStore.getInstance().storeSessionData(key.getResultId(), CACHE_NAME, entry, tenantId); | |
| if (log.isDebugEnabled()) { | |
| log.debug("Stored authentication result in session data store for tenant: " + tenantId); | |
| } | |
| } | |
| } |
| @Override | ||
| public void addToCacheOnRead(LongWaitResultCacheKey key, LongWaitResultCacheEntry entry) { | ||
|
|
||
| super.addToCacheOnRead(key, entry); | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 23
| @Override | |
| public void addToCacheOnRead(LongWaitResultCacheKey key, LongWaitResultCacheEntry entry) { | |
| super.addToCacheOnRead(key, entry); | |
| } | |
| @Override | |
| public void addToCacheOnRead(LongWaitResultCacheKey key, LongWaitResultCacheEntry entry) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Adding long wait result to cache on read for key: " + key.getHashCode()); | |
| } | |
| super.addToCacheOnRead(key, entry); | |
| } |
| */ | ||
| private void optimizeAndStoreSessionData(SessionContextCacheKey key, SessionContextCacheEntry entry) { |
There was a problem hiding this comment.
Log Improvement Suggestion No: 24
| */ | |
| private void optimizeAndStoreSessionData(SessionContextCacheKey key, SessionContextCacheEntry entry) { | |
| private void optimizeAndStoreSessionData(SessionContextCacheKey key, SessionContextCacheEntry entry) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Optimizing and storing session data for context: " + key.getContextId()); | |
| } |
| LongWaitResultCacheEntry cacheEntry = new LongWaitResultCacheEntry(status); | ||
| LongWaitResultCache.getInstance().addToCache(cacheKey, cacheEntry); | ||
| LongWaitResultCache.getInstance().addToCacheOnRead(cacheKey, cacheEntry); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 26
| LongWaitResultCacheEntry cacheEntry = new LongWaitResultCacheEntry(status); | |
| LongWaitResultCache.getInstance().addToCache(cacheKey, cacheEntry); | |
| LongWaitResultCache.getInstance().addToCacheOnRead(cacheKey, cacheEntry); | |
| LongWaitResultCacheEntry cacheEntry = new LongWaitResultCacheEntry(status); | |
| log.debug("Adding wait status to cache for waitKey: {}", waitKey); | |
| LongWaitResultCache.getInstance().addToCacheOnRead(cacheKey, cacheEntry); |
| public void addToCacheOnRead(String key, IdentityMessageContext context) { | ||
| super.addToCacheOnRead(key, context); | ||
| if (enableRequestScopeCache) { |
There was a problem hiding this comment.
Log Improvement Suggestion No: 27
| public void addToCacheOnRead(String key, IdentityMessageContext context) { | |
| super.addToCacheOnRead(key, context); | |
| if (enableRequestScopeCache) { | |
| public void addToCacheOnRead(String key, IdentityMessageContext context) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Adding identity context to cache on read for key: " + key); | |
| } | |
| super.addToCacheOnRead(key, context); |
| SessionDataStore.getInstance().storeSessionData(key, INBOUND_CONTEXT_CACHE_NAME, context, tenantId); | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 28
| SessionDataStore.getInstance().storeSessionData(key, INBOUND_CONTEXT_CACHE_NAME, context, tenantId); | |
| } | |
| SessionDataStore.getInstance().storeSessionData(key, INBOUND_CONTEXT_CACHE_NAME, context, tenantId); | |
| if (log.isDebugEnabled()) { | |
| log.debug("Stored identity context in session data store for tenant: " + tenantDomain); | |
| } | |
| } |
| cacheEntry.setContext(sessionContext); | ||
| SessionContextCache.getInstance().addToCache(cacheKey, cacheEntry); | ||
| SessionContextCache.getInstance().addToCache(cacheKey, cacheEntry, getLoginTenantDomainFromContext()); |
There was a problem hiding this comment.
Log Improvement Suggestion No: 29
| cacheEntry.setContext(sessionContext); | |
| SessionContextCache.getInstance().addToCache(cacheKey, cacheEntry); | |
| SessionContextCache.getInstance().addToCache(cacheKey, cacheEntry, getLoginTenantDomainFromContext()); | |
| cacheEntry.setContext(sessionContext); | |
| if (log.isDebugEnabled()) { | |
| log.debug("Adding session context to cache for key: " + cacheKey.getContextId()); | |
| } |
| * Expects entry to be stored in SessionDataStore with a tenant ID. | ||
| */ | ||
| @Test | ||
| public void testAddToCacheOnReadWithAuthenticatedUser() { |
There was a problem hiding this comment.
Log Improvement Suggestion No: 30
| public void testAddToCacheOnReadWithAuthenticatedUser() { | |
| @Test | |
| public void testAddToCacheOnReadWithAuthenticatedUser() { | |
| log.info("Testing addToCacheOnRead with authenticated user for context: {}", CONTEXT_ID); |
| /** | ||
| * Test addToCacheOnRead – SessionContextLoader throws SessionDataStorageOptimizationClientException. | ||
| * Method should return early without calling SessionDataStore. | ||
| */ |
There was a problem hiding this comment.
Log Improvement Suggestion No: 31
| */ | |
| @Test | |
| public void testAddToCacheOnReadClientExceptionReturnEarly() { | |
| log.info("Testing addToCacheOnRead with client exception scenario"); |
| @@ -127,7 +127,7 @@ public List<LocalClaim> getLocalClaims(int tenantId) throws ClaimMetadataExcepti | |||
| log.debug("Cache miss for local claim list for tenant: " + tenantId); | |||
| } | |||
| localClaimList = super.getLocalClaims(tenantId); | |||
There was a problem hiding this comment.
Log Improvement Suggestion No: 32
| localClaimList = super.getLocalClaims(tenantId); | |
| localClaimList = super.getLocalClaims(tenantId); | |
| if (log.isDebugEnabled()) { | |
| log.debug("Retrieved " + localClaimList.size() + " local claims from database for tenant: " + tenantId); | |
| } |
| @@ -211,7 +211,7 @@ public List<ExternalClaim> getExternalClaims(String externalClaimDialectURI, int | |||
| tenantId); | |||
| } | |||
| externalClaimList = super.getExternalClaims(externalClaimDialectURI, tenantId); | |||
There was a problem hiding this comment.
Log Improvement Suggestion No: 33
| externalClaimList = super.getExternalClaims(externalClaimDialectURI, tenantId); | |
| externalClaimList = super.getExternalClaims(externalClaimDialectURI, tenantId); | |
| if (log.isDebugEnabled()) { | |
| log.debug("Retrieved " + externalClaimList.size() + " external claims from database for dialect: " + externalClaimDialectURI + " in tenant: " + tenantId); | |
| } |
| public void putClaimDialectsOnRead(int tenantId, List<ClaimDialect> claimDialectList) { | ||
|
|
||
| super.addToCacheOnRead(tenantId, (Serializable) claimDialectList, tenantId); | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 34
| public void putClaimDialectsOnRead(int tenantId, List<ClaimDialect> claimDialectList) { | |
| super.addToCacheOnRead(tenantId, (Serializable) claimDialectList, tenantId); | |
| } | |
| public void putClaimDialectsOnRead(int tenantId, List<ClaimDialect> claimDialectList) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Adding claim dialects to cache on read for tenant: " + tenantId); | |
| } | |
| super.addToCacheOnRead(tenantId, (Serializable) claimDialectList, tenantId); | |
| } |
| public void putClaimDialectsOnRead(int tenantId, List<ClaimDialect> claimDialectList) { | ||
|
|
||
| super.addToCacheOnRead(tenantId, (Serializable) claimDialectList, tenantId); | ||
| } |
There was a problem hiding this comment.
Log Improvement Suggestion No: 35
| public void putClaimDialectsOnRead(int tenantId, List<ClaimDialect> claimDialectList) { | |
| super.addToCacheOnRead(tenantId, (Serializable) claimDialectList, tenantId); | |
| } | |
| public void putClaimDialectsOnRead(int tenantId, List<ClaimDialect> claimDialectList) { | |
| if (log.isDebugEnabled()) { | |
| log.debug("Caching claim dialects for tenant: " + tenantId + ", dialect count: " + | |
| (claimDialectList != null ? claimDialectList.size() : 0)); | |
| } | |
| super.addToCacheOnRead(tenantId, (Serializable) claimDialectList, tenantId); | |
| } |
There was a problem hiding this comment.
AI Agent Log Improvement Checklist
- The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
- Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.
✅ Before merging this pull request:
- Review all AI-generated comments for accuracy and relevance.
- Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
|
|
PR builder started |
|
PR builder completed |



🤖 Auto-sync from master
This PR automatically syncs the changes from #7871 to the
nextbranch.Original PR: #7871
Author: @Zeta201
Total commits: 4
Workflow run: https://github.com/wso2/carbon-identity-framework/actions/runs/23485460069
Commits: