-
- All Implemented Interfaces:
-
com.batch.android.core.domain.IDomainStore
public class DomainStore implements IDomainStore
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringDNS_DOMAIN_ORIGINAL
-
Method Summary
Modifier and Type Method Description StringgetCurrentDomain()Determines the current domain. voidupdateDomain(@Nullable() String domain)Updates the current domain with a new provided domain. intincrementErrorCount()Increments the error count and returns the new error count value. voidupdateLastCheckDomainDate()Updates the date of the last check performed on the domain. voidresetDomainToOriginal()Resets the domain to its original value {@code DomainStore.DNS_DOMAIN_ORIGINAL}.voidresetErrorCountIfNeeded()Resets the error count if needed, for instance if a successful API call was done on the current domain. DatelastErrorUpdateDate()Returns the date of the last error update, or null if no error has been recorded. booleancanCheckOriginalDomainAvailability()Determines if the original domain can be checked for availability. booleanisOriginalDomain(String domain)Determine if the given domain is the original one booleanisCurrentDomain(String domain)Determine if the given domain is the current one -
-
Method Detail
-
getCurrentDomain
@NonNull() String getCurrentDomain()
Determines the current domain.
This domain is typically the one being used in the app for performing operations.
-
updateDomain
void updateDomain(@Nullable() String domain)
Updates the current domain with a new provided domain.
If
{@code domain}is null, it resets the domain to{@code DomainStore.DNS_DOMAIN_ORIGINAL}.- Parameters:
domain- The new domain to set, or null to reset to the original domain.
-
incrementErrorCount
int incrementErrorCount()
Increments the error count and returns the new error count value.
Used to track the number of errors related to the domain.
-
updateLastCheckDomainDate
void updateLastCheckDomainDate()
Updates the date of the last check performed on the domain.
-
resetDomainToOriginal
void resetDomainToOriginal()
Resets the domain to its original value
{@code DomainStore.DNS_DOMAIN_ORIGINAL}.
-
resetErrorCountIfNeeded
void resetErrorCountIfNeeded()
Resets the error count if needed, for instance if a successful API call was done on the current domain.
-
lastErrorUpdateDate
@Nullable() Date lastErrorUpdateDate()
Returns the date of the last error update, or null if no error has been recorded.
-
canCheckOriginalDomainAvailability
boolean canCheckOriginalDomainAvailability()
Determines if the original domain can be checked for availability.
-
isOriginalDomain
boolean isOriginalDomain(String domain)
Determine if the given domain is the original one
-
isCurrentDomain
boolean isCurrentDomain(String domain)
Determine if the given domain is the current one
-
-
-
-