Package cz.metacentrum.perun.core.entry
Class ConsentsManagerEntry
java.lang.Object
cz.metacentrum.perun.core.entry.ConsentsManagerEntry
- All Implemented Interfaces:
ConsentsManager
Consents entry logic.
- Author:
- Radoslav Čerhák invalid input: '<'r.cerhak@gmail.com>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchangeConsentStatus(PerunSession sess, Consent consent, ConsentStatus status) Set consent statusvoidevaluateConsents(PerunSession sess, ConsentHub consentHub) Evaluates consents for given consent hub with enforced consents enabled.voidevaluateConsents(PerunSession sess, Service service) Evaluates consents for given service for all consent hubs with given service with enforced consents enabled.voidevaluateConsents(PerunSession sess, List<ConsentHub> consentHubs) Evaluates consents for given list of consent hubs with enforced consents enabled.Get list of all Consent HubsgetAllConsents(PerunSession sess) Gel all consentsgetConsentById(PerunSession sess, int id) Get consent object with specified idgetConsentForUserAndConsentHub(PerunSession sess, int userId, int consentHubId, ConsentStatus status) Get consent for chosen user in specified consent hub with specified statusgetConsentHubByFacility(PerunSession sess, int facilityId) Finds existing Consent Hub by facility.getConsentHubById(PerunSession sess, int id) Finds existing Consent Hub by id.getConsentHubByName(PerunSession sess, String name) Finds existing Consent Hub by name.getConsentHubByResource(PerunSession sess, int resourceId) Finds existing Consent Hub for facility to which resource belongs.getConsentsForConsentHub(PerunSession sess, int id) Get all consents for chosen ConsentHubgetConsentsForConsentHub(PerunSession sess, int id, ConsentStatus status) Get all consents for chosen ConsentHub with the specified statusgetConsentsForConsentHubByResource(PerunSession sess, int resourceId) Get consents for members assigned to the chosen resource.getConsentsForUser(PerunSession sess, int id) Get all consents for chosen UsergetConsentsForUser(PerunSession sess, int id, ConsentStatus status) Get all consents for chosen User with the specified statusgetConsentsForUserAndConsentHub(PerunSession sess, int userId, int consentHubId) Get all consents for chosen User in specified consent hubvoidsetConsentsManagerBl(ConsentsManagerBl consentsManagerBl) voidsetPerunBl(PerunBl perunBl) updateConsentHub(PerunSession sess, ConsentHub consentHub) Updates the consent hub.
-
Constructor Details
-
ConsentsManagerEntry
-
ConsentsManagerEntry
public ConsentsManagerEntry()
-
-
Method Details
-
changeConsentStatus
public Consent changeConsentStatus(PerunSession sess, Consent consent, ConsentStatus status) throws ConsentNotExistsException, PrivilegeException, InvalidConsentStatusException, UserNotExistsException Description copied from interface:ConsentsManagerSet consent status- Specified by:
changeConsentStatusin interfaceConsentsManager- Parameters:
sess- perun sessionconsent- consentstatus- status that should be set- Returns:
- consent
- Throws:
ConsentNotExistsException- if consent hub does not existPrivilegeException- if insufficient rightsInvalidConsentStatusException- if passed status value can not be setUserNotExistsException- if user does not exist
-
evaluateConsents
Description copied from interface:ConsentsManagerEvaluates consents for given consent hub with enforced consents enabled.Service defines whether only active users will be evaluated or expired ones as well.
- Specified by:
evaluateConsentsin interfaceConsentsManager- Parameters:
sess- sessionconsentHub- consent hub- Throws:
PrivilegeException
-
evaluateConsents
public void evaluateConsents(PerunSession sess, List<ConsentHub> consentHubs) throws PrivilegeException Description copied from interface:ConsentsManagerEvaluates consents for given list of consent hubs with enforced consents enabled.Service defines whether only active users will be evaluated or expired ones as well.
- Specified by:
evaluateConsentsin interfaceConsentsManager- Parameters:
sess- sessionconsentHubs- consent hubs- Throws:
PrivilegeException
-
evaluateConsents
Description copied from interface:ConsentsManagerEvaluates consents for given service for all consent hubs with given service with enforced consents enabled.Corresponding consent hubs (containing the service) will have consents evaluated ONLY for selected service. Service defines whether only active users will be evaluated or expired ones as well. If new consent is created, attributes from ALL services under given consent hub are gathered for it.
- Specified by:
evaluateConsentsin interfaceConsentsManager- Parameters:
sess- sessionservice- service- Throws:
PrivilegeException
-
getAllConsentHubs
Description copied from interface:ConsentsManagerGet list of all Consent Hubs- Specified by:
getAllConsentHubsin interfaceConsentsManager- Parameters:
sess- perun session- Returns:
- list of Consent Hubs
- Throws:
PrivilegeException
-
getAllConsents
Description copied from interface:ConsentsManagerGel all consents- Specified by:
getAllConsentsin interfaceConsentsManager- Parameters:
sess-- Returns:
- all existing consents in the database
- Throws:
PrivilegeException
-
getConsentById
public Consent getConsentById(PerunSession sess, int id) throws ConsentNotExistsException, PrivilegeException Description copied from interface:ConsentsManagerGet consent object with specified id- Specified by:
getConsentByIdin interfaceConsentsManager- Parameters:
sess-id- id of desired consent object- Returns:
- consent object with specified id
- Throws:
ConsentNotExistsException- thrown if consent with the id doesn't existPrivilegeException
-
getConsentForUserAndConsentHub
public Consent getConsentForUserAndConsentHub(PerunSession sess, int userId, int consentHubId, ConsentStatus status) throws PrivilegeException, UserNotExistsException, ConsentHubNotExistsException, ConsentNotExistsException Description copied from interface:ConsentsManagerGet consent for chosen user in specified consent hub with specified status- Specified by:
getConsentForUserAndConsentHubin interfaceConsentsManager- Parameters:
sess-userId- id of the userconsentHubId- id of the consent hubstatus- status of the consent- Returns:
- Throws:
PrivilegeExceptionUserNotExistsExceptionConsentHubNotExistsExceptionConsentNotExistsException
-
getConsentHubByFacility
public ConsentHub getConsentHubByFacility(PerunSession sess, int facilityId) throws ConsentHubNotExistsException, PrivilegeException, FacilityNotExistsException Description copied from interface:ConsentsManagerFinds existing Consent Hub by facility.- Specified by:
getConsentHubByFacilityin interfaceConsentsManager- Parameters:
sess- perun sessionfacilityId- id of facility for which consent hub is searched- Returns:
- found Consent Hub
- Throws:
ConsentHubNotExistsExceptionPrivilegeExceptionFacilityNotExistsException
-
getConsentHubById
public ConsentHub getConsentHubById(PerunSession sess, int id) throws ConsentHubNotExistsException, PrivilegeException Description copied from interface:ConsentsManagerFinds existing Consent Hub by id.- Specified by:
getConsentHubByIdin interfaceConsentsManager- Parameters:
sess- perun sessionid- id of the Consent Hub you are looking for- Returns:
- found Consent Hub
- Throws:
ConsentHubNotExistsExceptionPrivilegeException
-
getConsentHubByName
public ConsentHub getConsentHubByName(PerunSession sess, String name) throws ConsentHubNotExistsException, PrivilegeException Description copied from interface:ConsentsManagerFinds existing Consent Hub by name.- Specified by:
getConsentHubByNamein interfaceConsentsManager- Parameters:
sess- perun sessionname- name of the Consent Hub you are looking for- Returns:
- found Consent Hub
- Throws:
ConsentHubNotExistsExceptionPrivilegeException
-
getConsentHubByResource
public ConsentHub getConsentHubByResource(PerunSession sess, int resourceId) throws ConsentHubNotExistsException, PrivilegeException, FacilityNotExistsException, ResourceNotExistsException Description copied from interface:ConsentsManagerFinds existing Consent Hub for facility to which resource belongs.- Specified by:
getConsentHubByResourcein interfaceConsentsManager- Parameters:
sess- perun sessionresourceId- id of resource- Returns:
- found Consent Hub
- Throws:
ConsentHubNotExistsExceptionPrivilegeExceptionFacilityNotExistsExceptionResourceNotExistsException
-
getConsentsForConsentHub
public List<Consent> getConsentsForConsentHub(PerunSession sess, int id, ConsentStatus status) throws PrivilegeException, ConsentHubNotExistsException Description copied from interface:ConsentsManagerGet all consents for chosen ConsentHub with the specified status- Specified by:
getConsentsForConsentHubin interfaceConsentsManager- Parameters:
sess-id- id of the ConsentHubstatus- status of the consent- Returns:
- consents for chosen ConsentHub with the specified status
- Throws:
PrivilegeExceptionConsentHubNotExistsException
-
getConsentsForConsentHub
public List<Consent> getConsentsForConsentHub(PerunSession sess, int id) throws PrivilegeException, ConsentHubNotExistsException Description copied from interface:ConsentsManagerGet all consents for chosen ConsentHub- Specified by:
getConsentsForConsentHubin interfaceConsentsManager- Parameters:
sess-id- id of the ConsentHub- Returns:
- consents for chosen ConsentHub
- Throws:
PrivilegeExceptionConsentHubNotExistsException
-
getConsentsForConsentHubByResource
public List<Consent> getConsentsForConsentHubByResource(PerunSession sess, int resourceId) throws PrivilegeException, ConsentHubNotExistsException, FacilityNotExistsException, ResourceNotExistsException Description copied from interface:ConsentsManagerGet consents for members assigned to the chosen resource.- Specified by:
getConsentsForConsentHubByResourcein interfaceConsentsManager- Parameters:
sess- sessionresourceId- id of resource- Returns:
- consents for corresponding ConsentHub
- Throws:
PrivilegeExceptionConsentHubNotExistsExceptionFacilityNotExistsExceptionResourceNotExistsException
-
getConsentsForUser
public List<Consent> getConsentsForUser(PerunSession sess, int id, ConsentStatus status) throws UserNotExistsException, PrivilegeException Description copied from interface:ConsentsManagerGet all consents for chosen User with the specified status- Specified by:
getConsentsForUserin interfaceConsentsManager- Parameters:
sess-id- id of the Userstatus- status of the consent- Returns:
- consents for chosen User with the specified status
- Throws:
UserNotExistsExceptionPrivilegeException
-
getConsentsForUser
public List<Consent> getConsentsForUser(PerunSession sess, int id) throws UserNotExistsException, PrivilegeException Description copied from interface:ConsentsManagerGet all consents for chosen User- Specified by:
getConsentsForUserin interfaceConsentsManager- Parameters:
sess-id- id of the user- Returns:
- consents for chosen User
- Throws:
UserNotExistsExceptionPrivilegeException
-
getConsentsForUserAndConsentHub
public List<Consent> getConsentsForUserAndConsentHub(PerunSession sess, int userId, int consentHubId) throws PrivilegeException, UserNotExistsException, ConsentHubNotExistsException Description copied from interface:ConsentsManagerGet all consents for chosen User in specified consent hub- Specified by:
getConsentsForUserAndConsentHubin interfaceConsentsManager- Parameters:
sess-userId- id of the userconsentHubId- id of the consent hub- Returns:
- Throws:
PrivilegeExceptionUserNotExistsExceptionConsentHubNotExistsException
-
getConsentsManagerBl
-
getPerunBl
-
setConsentsManagerBl
-
setPerunBl
-
updateConsentHub
public ConsentHub updateConsentHub(PerunSession sess, ConsentHub consentHub) throws ConsentHubNotExistsException, PrivilegeException, ConsentHubExistsException Description copied from interface:ConsentsManagerUpdates the consent hub. Ignores related facilities.- Specified by:
updateConsentHubin interfaceConsentsManager- Parameters:
sess- sessionconsentHub- consent hub- Returns:
- updated consent hub
- Throws:
ConsentHubNotExistsException- if consent hub does not existPrivilegeException- insufficient rightsConsentHubExistsException- if consent hub with the same name already exists
-