use of org.wso2.carbon.consent.mgt.core.PrivilegedConsentManager in project carbon-identity-framework by wso2.
the class TenantConsentMgtListener method deleteAllConsents.
/**
* Delete all consents belongs to a given tenant id.
*
* @param tenantId The id of the tenant.
* @throws StratosException throws when an error occurs in deleting consents.
*/
protected void deleteAllConsents(int tenantId) throws StratosException {
try {
PrivilegedConsentManager privilegedConsentManager = IdentityConsentDataHolder.getInstance().getPrivilegedConsentManager();
privilegedConsentManager.deletePurposeCategories(tenantId);
privilegedConsentManager.deletePIICategories(tenantId);
privilegedConsentManager.deletePurposes(tenantId);
privilegedConsentManager.deleteReceipts(tenantId);
} catch (ConsentManagementException e) {
throw new StratosException("Error in deleting consents of tenant:" + tenantId, e);
}
}
Aggregations