Skip to content

Commit

Permalink
refac:rename list<String> urlStrategy to urlStrategyDomains
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiZTD committed May 30, 2024
1 parent 83b1280 commit fa72ebd
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ public void run() {

IActivityPackageSender packageHandlerActivitySender =
new ActivityPackageSender(
adjustConfig.urlStrategy,
adjustConfig.urlStrategyDomains,
adjustConfig.useSubdomains,
adjustConfig.basePath,
adjustConfig.gdprPath,
Expand All @@ -967,7 +967,7 @@ public void run() {

IActivityPackageSender attributionHandlerActivitySender =
new ActivityPackageSender(
adjustConfig.urlStrategy,
adjustConfig.urlStrategyDomains,
adjustConfig.useSubdomains,
adjustConfig.basePath,
adjustConfig.gdprPath,
Expand All @@ -983,7 +983,7 @@ public void run() {

IActivityPackageSender sdkClickHandlerActivitySender =
new ActivityPackageSender(
adjustConfig.urlStrategy,
adjustConfig.urlStrategyDomains,
adjustConfig.useSubdomains,
adjustConfig.basePath,
adjustConfig.gdprPath,
Expand All @@ -999,7 +999,7 @@ public void run() {

IActivityPackageSender purchaseVerificationHandlerActivitySender =
new ActivityPackageSender(
adjustConfig.urlStrategy,
adjustConfig.urlStrategyDomains,
adjustConfig.useSubdomains,
adjustConfig.basePath,
adjustConfig.gdprPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class AdjustConfig {
String externalDeviceId;
boolean preinstallTrackingEnabled;
Boolean needsCost;
List<String> urlStrategy;
List<String> urlStrategyDomains;
boolean useSubdomains;
boolean isDataResidency;
String preinstallFilePath;
Expand Down Expand Up @@ -164,7 +164,7 @@ public void setUrlStrategy(List<String> domains, boolean useSubdomains, boolean
logger.error("Invalid url strategy");
return;
}
this.urlStrategy = domains;
this.urlStrategyDomains = domains;
this.useSubdomains = useSubdomains;
this.isDataResidency = isDataResidency;
}
Expand Down Expand Up @@ -285,8 +285,8 @@ public Boolean getNeedsCost() {
return needsCost;
}

public List<String> getUrlStrategy() {
return urlStrategy;
public List<String> getUrlStrategyDomains() {
return urlStrategyDomains;
}

public String getPreinstallFilePath() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class ActivityPackageSender implements IActivityPackageSender {
private IConnectionOptions connectionOptions;
private Context context;

public ActivityPackageSender(final List<String> adjustUrlStrategy,
public ActivityPackageSender(final List<String> urlStrategyDomains,
final boolean useSubdomains,
final String basePath,
final String gdprPath,
Expand All @@ -78,7 +78,7 @@ public ActivityPackageSender(final List<String> adjustUrlStrategy,
AdjustFactory.getGdprUrl(),
AdjustFactory.getSubscriptionUrl(),
AdjustFactory.getPurchaseVerificationUrl(),
adjustUrlStrategy,
urlStrategyDomains,
useSubdomains);
httpsURLConnectionProvider = AdjustFactory.getHttpsURLConnectionProvider();
connectionOptions = AdjustFactory.getConnectionOptions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class UrlStrategy {
private static final String SUBSCRIPTION_URL_WORLD = "https://subscription.adjust.world";
private static final String PURCHASE_VERIFICATION_URL_WORLD = "https://ssrv.adjust.world";

private final List<String> adjustUrlStrategy;
private final List<String> urlStrategyDomains;
private final boolean useSubdomains;

private final String baseUrlOverwrite;
Expand All @@ -43,10 +43,10 @@ public UrlStrategy(final String baseUrlOverwrite,
final String gdprUrlOverwrite,
final String subscriptionUrlOverwrite,
final String purchaseVerificationUrlOverwrite,
final List<String> adjustUrlStrategy,
final List<String> urlStrategyDomains,
final boolean useSubdomains)
{
this.adjustUrlStrategy = adjustUrlStrategy;
this.urlStrategyDomains = urlStrategyDomains;
this.useSubdomains = useSubdomains;

this.baseUrlOverwrite = baseUrlOverwrite;
Expand Down Expand Up @@ -139,66 +139,66 @@ public String targetUrlByActivityKind(final ActivityKind activityKind) {

private List<String> baseUrlChoices() {

if (adjustUrlStrategy == null || adjustUrlStrategy.isEmpty()) {
if (urlStrategyDomains == null || urlStrategyDomains.isEmpty()) {
return Arrays.asList(BASE_URL, BASE_URL_WORLD);
}
if (useSubdomains) {
List<String> baseUrls = new ArrayList<>();
for (String url : adjustUrlStrategy) {
for (String url : urlStrategyDomains) {
baseUrls.add(String.format(BASE_URL_FORMAT, url));
}
return baseUrls;
}else {
List<String> baseUrls = new ArrayList<>();
for (String url : adjustUrlStrategy) {
for (String url : urlStrategyDomains) {
baseUrls.add(String.format(BASE_URL_NO_SUB_DOMAIN_FORMAT, url));
}
return baseUrls;
}
}
private List<String> gdprUrlChoices() {
if (adjustUrlStrategy == null || adjustUrlStrategy.isEmpty()) {
if (urlStrategyDomains == null || urlStrategyDomains.isEmpty()) {
return Arrays.asList(GDPR_URL, GDPR_URL_WORLD);
}
List<String> baseUrls = new ArrayList<>();
if (useSubdomains) {
for (String url : adjustUrlStrategy) {
for (String url : urlStrategyDomains) {
baseUrls.add(String.format(GDPR_URL_FORMAT, url));
}
}else {
for (String url : adjustUrlStrategy) {
for (String url : urlStrategyDomains) {
baseUrls.add(String.format(BASE_URL_NO_SUB_DOMAIN_FORMAT, url));
}
}
return baseUrls;
}
private List<String> subscriptionUrlChoices() {
if (adjustUrlStrategy == null || adjustUrlStrategy.isEmpty()) {
if (urlStrategyDomains == null || urlStrategyDomains.isEmpty()) {
return Arrays.asList(SUBSCRIPTION_URL, SUBSCRIPTION_URL_WORLD);
}
List<String> baseUrls = new ArrayList<>();
if (useSubdomains) {
for (String url : adjustUrlStrategy) {
for (String url : urlStrategyDomains) {
baseUrls.add(String.format(SUBSCRIPTION_URL_FORMAT, url));
}
}else {
for (String url : adjustUrlStrategy) {
for (String url : urlStrategyDomains) {
baseUrls.add(String.format(BASE_URL_NO_SUB_DOMAIN_FORMAT, url));
}
}
return baseUrls;
}
private List<String> purchaseVerificationUrlChoices() {
if (adjustUrlStrategy == null || adjustUrlStrategy.isEmpty()) {
if (urlStrategyDomains == null || urlStrategyDomains.isEmpty()) {
return Arrays.asList(PURCHASE_VERIFICATION_URL, PURCHASE_VERIFICATION_URL_WORLD);
}
List<String> baseUrls = new ArrayList<>();
if (useSubdomains){
for (String url : adjustUrlStrategy) {
for (String url : urlStrategyDomains) {
baseUrls.add(String.format(PURCHASE_VERIFICATION_URL_FORMAT, url));
}
}else {
for (String url : adjustUrlStrategy) {
for (String url : urlStrategyDomains) {
baseUrls.add(String.format(BASE_URL_NO_SUB_DOMAIN_FORMAT, url));
}
}
Expand Down

0 comments on commit fa72ebd

Please sign in to comment.