-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from TrueSparrowSystems/login-changes
Added Default User Login in Connect Flow And Environment based Cache Suffix
- Loading branch information
Showing
14 changed files
with
121 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 30 additions & 11 deletions
41
src/main/java/com/salessparrow/api/lib/globalConstants/CacheConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,39 @@ | ||
package com.salessparrow.api.lib.globalConstants; | ||
|
||
import org.springframework.stereotype.Component; | ||
import com.salessparrow.api.config.CoreConstants; | ||
|
||
@Component | ||
public class CacheConstants { | ||
|
||
public static final String SalesSparrowPrefix = "ss_"; | ||
|
||
public static final String SS_SALESFORCE_USER_CACHE = SalesSparrowPrefix + "sf_user"; | ||
|
||
public static final Integer SS_SALESFORCE_USER_CACHE_EXP = 30 * 24 * 60 * 60; // 30 | ||
// days | ||
|
||
public static final String SS_SALESFORCE_OAUTH_TOKEN_CACHE = SalesSparrowPrefix + "sf_oauth_token"; | ||
|
||
public static final Integer SS_SALESFORCE_OAUTH_TOKEN_CACHE_EXP = 30 * 24 * 60 * 60; // 30 | ||
// days | ||
public static final String CACHE_SUFFIX = getCacheSuffix(); | ||
|
||
public static final String SALESFORCE_USER_CACHE = "sf_user"; | ||
|
||
public static final Integer SALESFORCE_USER_CACHE_EXP = 30 * 24 * 60 * 60; // 30 | ||
// days | ||
|
||
public static final String SALESFORCE_OAUTH_TOKEN_CACHE = "sf_oauth_token"; | ||
|
||
public static final Integer SALESFORCE_OAUTH_TOKEN_CACHE_EXP = 30 * 24 * 60 * 60; // 30 | ||
// days | ||
|
||
public static String getCacheSuffix() { | ||
if (CoreConstants.isProductionEnvironment()) { | ||
return "_prod"; | ||
} | ||
else if (CoreConstants.isStagingEnvironment()) { | ||
return "_stag"; | ||
} | ||
else if (CoreConstants.isTestEnvironment()) { | ||
return "_test"; | ||
} | ||
else if (CoreConstants.isLocalTestEnvironment()) { | ||
return "_ltest"; | ||
} | ||
else { | ||
return "_dev"; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters