Skip to content

Commit

Permalink
Fixed #11 by updating CacheManager.cls to use global on the class, Ca…
Browse files Browse the repository at this point in the history
…cheable interface, and several public static methods
  • Loading branch information
jongpie committed Mar 6, 2023
1 parent b40f8d8 commit fac9d5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ jobs:
run: npx sfdx force:package:install --package ${{ env.noNamespacePackageVersionId }} --wait 20

- name: 'Validate Namespaced Package Access'
run: npx sfdx apex:run --apexcodefile ./scripts/build/validate-access-to-no-namespace-package.apex
run: npx sfdx apex:run --file ./scripts/build/validate-access-to-no-namespace-package.apex

- name: 'Validate No-Namespace Package Access'
run: npx sfdx apex:run --apexcodefile ./scripts/build/validate-access-to-namespaced-package.apex
run: npx sfdx apex:run --file ./scripts/build/validate-access-to-namespaced-package.apex

- name: 'Delete Platform Cache Scratch Org'
run: npx sfdx force:org:delete --json --noprompt
Expand Down
14 changes: 7 additions & 7 deletions nebula-cache-manager/core/classes/CacheManager.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//---------------------------------------------------------------------------------------------------//

@SuppressWarnings('PMD.ApexDoc, PMD.AvoidDebugStatements, PMD.AvoidGlobalModifier, PMD.ExcessivePublicCount, PMD.PropertyNamingConventions')
public without sharing class CacheManager {
global without sharing class CacheManager {
@TestVisible
private static final Map<String, Cacheable> CONFIGURATION_DEVELOPER_NAME_TO_CACHEABLE_INSTANCE = new Map<String, Cacheable>();
@TestVisible
Expand Down Expand Up @@ -42,7 +42,7 @@ public without sharing class CacheManager {
SESSION
}

public interface Cacheable {
global interface Cacheable {
Boolean contains(String key);
Map<String, Boolean> contains(Set<String> keys);
Boolean containsAll(Set<String> keys);
Expand All @@ -61,23 +61,23 @@ public without sharing class CacheManager {
void removeAll();
}

public static Cacheable getOrganizationCache() {
global static Cacheable getOrganizationCache() {
return getOrganizationCache(ORGANIZATION_CACHE_CONFIGURATION);
}

public static Cacheable getOrganizationCache(CacheConfiguration__mdt configuration) {
global static Cacheable getOrganizationCache(CacheConfiguration__mdt configuration) {
return getPlatformCache(configuration, PlatformCacheType.ORGANIZATION);
}

public static Cacheable getSessionCache() {
global static Cacheable getSessionCache() {
return getSessionCache(SESSION_CACHE_CONFIGURATION);
}

public static Cacheable getSessionCache(CacheConfiguration__mdt configuration) {
global static Cacheable getSessionCache(CacheConfiguration__mdt configuration) {
return getPlatformCache(configuration, PlatformCacheType.SESSION);
}

public static Cacheable getTransactionCache() {
global static Cacheable getTransactionCache() {
if (CONFIGURATION_DEVELOPER_NAME_TO_CACHEABLE_INSTANCE.containsKey(TRANSACTION_CACHE_CONFIGURATION.DeveloperName)) {
return CONFIGURATION_DEVELOPER_NAME_TO_CACHEABLE_INSTANCE.get(TRANSACTION_CACHE_CONFIGURATION.DeveloperName);
}
Expand Down

0 comments on commit fac9d5b

Please sign in to comment.