org.apereo.cas.consent.ConsentRepository Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cas-server-support-consent-api Show documentation
Show all versions of cas-server-support-consent-api Show documentation
cas-server-support-consent-api
package org.apereo.cas.consent;
import org.apereo.cas.authentication.Authentication;
import org.apereo.cas.authentication.principal.Service;
import org.apereo.cas.services.RegisteredService;
import java.io.Serializable;
import java.util.Collection;
/**
* This is {@link ConsentRepository}.
*
* @author Misagh Moayyed
* @since 5.1.0
*/
public interface ConsentRepository extends Serializable {
/**
* Bean name.
*/
String BEAN_NAME = "consentRepository";
/**
* Gets consent decision.
*
* @param service the service
* @param registeredService the registered service
* @param authentication the authentication
* @return the consent decision
*/
ConsentDecision findConsentDecision(Service service,
RegisteredService registeredService,
Authentication authentication);
/**
* Gets consent decision for a user.
*
* @param principal the principal
* @return the consent decision
*/
Collection extends ConsentDecision> findConsentDecisions(String principal);
/**
* Gets consent decisions.
*
* @return the consent decision
*/
Collection extends ConsentDecision> findConsentDecisions();
/**
* Store consent decision.
*
* @param decision the decision
* @return consent decision updated/added
* @throws Exception the exception
*/
ConsentDecision storeConsentDecision(ConsentDecision decision) throws Exception;
/**
* Delete consent decision.
*
* @param id the decision id
* @param principal the principal
* @return true / false
*/
boolean deleteConsentDecision(long id, String principal);
/**
* Delete consent decisions.
*
* @param principal the principal
* @return the boolean
*/
boolean deleteConsentDecisions(String principal);
/**
* Delete all.
*/
void deleteAll();
}