public class ConsentRepository
extends java.lang.Object
| Constructor and Description |
|---|
ConsentRepository(android.content.SharedPreferences sharedPreferences,
VendorRepository vendorRepository,
ConfigurationRepository configurationRepository,
io.didomi.sdk.user.UserRepository userRepository,
TCFRepository tcfRepository,
io.didomi.sdk.resources.LanguagesHelper languagesHelper) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getConsentString() |
ConsentToken |
getConsentToken() |
java.util.Set<java.lang.String> |
getEnabledPurposeIds()
Method used to get a set of enabled purpose IDs.
|
java.util.Set<Purpose> |
getEnabledPurposes()
Method used to get a set of enabled purposes.
|
java.lang.String |
getGoogleAdditionalConsent() |
java.util.Set<java.lang.String> |
getRequiredEssentialPurposesIds() |
java.lang.Integer |
getTCFVersion() |
boolean |
hasAllConsentStatus(java.util.Set<Purpose> purposes,
java.util.Set<Vendor> vendors)
Check if all consent information is available (ie not consent status != unknown) for a set of purpose and vendor IDs
|
boolean |
hasAllLegitimateInterestStatus(java.util.Set<Purpose> purposes,
java.util.Set<Vendor> vendors)
Check if all consent information is available (ie not consent status != unknown) for a set of purpose and vendor IDs
|
boolean |
hasAnyConsentStatus()
Check if we have collected any consent status from the user
|
boolean |
isEssentialPurpose(java.lang.String purposeID)
Method used to detect if a purpose ID corresponds to an essential purpose.
|
ConsentToken |
loadConsentToken(int tcfVersion,
java.util.Date ignoreConsentBefore,
long consentDurationInSeconds,
long deniedConsentDurationInSeconds)
Load the consent token from the shared preferences
|
boolean |
numberOfDaysHasExceeded()
Determine if the number of days given by the client on the configuration before we could display the banner again if we need new consents has been exceeded:
|
java.util.Set<Purpose> |
removeEssentialPurposes(java.util.Set<Purpose> purposeSet)
Method used to remove essential purposes from an set of purposes.
|
void |
resetConsentToken()
Create a new consent token and store it
|
void |
saveConsentToken()
Save the consent token to the local storage
|
void |
setLastSyncDate(java.util.Date lastSyncDate)
Set the last sync date
|
boolean |
setUserConsentStatus(java.util.Set<Purpose> enabledPurposes,
java.util.Set<Purpose> disabledPurposes,
java.util.Set<Purpose> enabledLegitimatePurposes,
java.util.Set<Purpose> disabledLegitimatePurposes,
java.util.Set<Vendor> enabledVendors,
java.util.Set<Vendor> disabledVendors,
java.util.Set<Vendor> enabledLegIntVendors,
java.util.Set<Vendor> disabledLegIntVendors)
Update the user consent status
|
public ConsentRepository(android.content.SharedPreferences sharedPreferences,
VendorRepository vendorRepository,
ConfigurationRepository configurationRepository,
io.didomi.sdk.user.UserRepository userRepository,
TCFRepository tcfRepository,
io.didomi.sdk.resources.LanguagesHelper languagesHelper)
public java.util.Set<java.lang.String> getRequiredEssentialPurposesIds()
public void resetConsentToken()
public ConsentToken loadConsentToken(int tcfVersion, java.util.Date ignoreConsentBefore, long consentDurationInSeconds, long deniedConsentDurationInSeconds) throws java.lang.Exception
tcfVersion - Version of the TCF to loadignoreConsentBefore - If token was updated before this date, it will not be loadedconsentDurationInSeconds - If token update date is older than this duration, it will not be loadedjava.lang.Exceptionpublic void saveConsentToken()
public void setLastSyncDate(java.util.Date lastSyncDate)
lastSyncDate - public boolean isEssentialPurpose(java.lang.String purposeID)
purposeID: - purpose ID.public boolean setUserConsentStatus(java.util.Set<Purpose> enabledPurposes, java.util.Set<Purpose> disabledPurposes, java.util.Set<Purpose> enabledLegitimatePurposes, java.util.Set<Purpose> disabledLegitimatePurposes, java.util.Set<Vendor> enabledVendors, java.util.Set<Vendor> disabledVendors, java.util.Set<Vendor> enabledLegIntVendors, java.util.Set<Vendor> disabledLegIntVendors)
public java.util.Set<Purpose> removeEssentialPurposes(java.util.Set<Purpose> purposeSet)
purposeSet - set of purposes.public boolean hasAllConsentStatus(java.util.Set<Purpose> purposes, java.util.Set<Vendor> vendors)
purposes - vendors - public boolean hasAllLegitimateInterestStatus(java.util.Set<Purpose> purposes, java.util.Set<Vendor> vendors)
purposes - vendors - public boolean hasAnyConsentStatus()
public ConsentToken getConsentToken()
public boolean numberOfDaysHasExceeded()
public java.util.Set<Purpose> getEnabledPurposes()
public java.util.Set<java.lang.String> getEnabledPurposeIds()
public java.lang.String getConsentString()
public java.lang.Integer getTCFVersion()
public java.lang.String getGoogleAdditionalConsent()