All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apereo.cas.consent.ConsentRepository Maven / Gradle / Ivy

There is a newer version: 7.1.0
Show newest version
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 findConsentDecisions(String principal);

    /**
     * Gets consent decisions.
     *
     * @return the consent decision
     */
    Collection 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();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy