Interface ConsentsManagerImplApi
- All Known Implementing Classes:
ConsentsManagerImpl
public interface ConsentsManagerImplApi
Consents database logic.
- Author:
- Radoslav Čerhák invalid input: '<'r.cerhak@gmail.com>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFacility
(PerunSession sess, ConsentHub consentHub, Facility facility) Adds facility to consent hub.void
changeConsentStatus
(PerunSession sess, Consent consent) Set consent statusvoid
checkConsentExists
(PerunSession sess, Consent consent) Check if consent exists in underlying data source.void
checkConsentHubExists
(PerunSession sess, ConsentHub consentHub) Throws exception if consent hub does not exist.boolean
consentExists
(PerunSession sess, Consent consent) Check if consent exists in underlying data source.boolean
consentHubExists
(PerunSession sess, ConsentHub consentHub) Returns true, if consent hub exists, false otherwise.createConsent
(PerunSession perunSession, Consent consent) Save consent to database.createConsentHub
(PerunSession perunSession, ConsentHub consentHub) Creates new consent hub.void
deleteConsent
(PerunSession perunSession, Consent consent) Delete consent from the database.void
deleteConsentHub
(PerunSession perunSession, ConsentHub consentHub) Deletes the consent hub.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.getConsentHubsByService
(PerunSession session, int serviceId) Finds all existing Consent Hubs by service (service is assigned to them)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 statusgetConsentsForUser
(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 list of consents for user and consent hubgetFacilitiesForConsentHub
(ConsentHub consentHub) Get list of all facilities associated to the given Consent Hubvoid
removeFacility
(PerunSession sess, ConsentHub consentHub, Facility facility) Removes facility from consent hub.void
updateConsentHub
(PerunSession perunSession, ConsentHub consentHub) Updates the consent hub.
-
Method Details
-
addFacility
void addFacility(PerunSession sess, ConsentHub consentHub, Facility facility) throws FacilityAlreadyAssigned Adds facility to consent hub.- Parameters:
sess
- sessionconsentHub
- consent hubfacility
- facility to be added- Throws:
FacilityAlreadyAssigned
- if facility is already assigned to consent hub
-
changeConsentStatus
Set consent status- Parameters:
sess
- perun sessionconsent
- consent
-
checkConsentExists
Check if consent exists in underlying data source.- Parameters:
sess
- PerunSessionconsent
- Consent to check- Throws:
ConsentNotExistsException
- if consent doesn't exist
-
checkConsentHubExists
void checkConsentHubExists(PerunSession sess, ConsentHub consentHub) throws ConsentHubNotExistsException Throws exception if consent hub does not exist.- Parameters:
sess
- sessionconsentHub
- consent hub- Throws:
ConsentHubNotExistsException
- if consent hub does not exist
-
consentExists
Check if consent exists in underlying data source.- Parameters:
sess
- perun sessionconsent
- Consent to check- Returns:
- true if consent exists in data source, false otherwise
-
consentHubExists
Returns true, if consent hub exists, false otherwise.- Parameters:
sess
- sessionconsentHub
- consent hub- Returns:
- whether consent hub exists
-
createConsent
Save consent to database.- Parameters:
perunSession
- PerunSessionconsent
- Consent- Returns:
- created consent
- Throws:
ConsentExistsException
- if consent already exists
-
createConsentHub
Creates new consent hub.- Parameters:
perunSession
- sessionconsentHub
- consent hub- Returns:
- new consent hub
-
deleteConsent
Delete consent from the database.- Parameters:
perunSession
- PerunSessionconsent
- Consent- Throws:
ConsentNotExistsException
- if consent doesn't exist
-
deleteConsentHub
void deleteConsentHub(PerunSession perunSession, ConsentHub consentHub) throws ConsentHubAlreadyRemovedException Deletes the consent hub.- Parameters:
perunSession
- sessionconsentHub
- consent hub- Throws:
ConsentHubAlreadyRemovedException
-
getAllConsentHubs
Get list of all Consent Hubs- Parameters:
sess
- perun session- Returns:
- list of Consent Hubs
- Throws:
InternalErrorException
- if an exception occurred
-
getAllConsents
Gel all consents- Parameters:
sess
- PerunSession- Returns:
- all existing consents in the database
-
getConsentById
Get consent object with specified id- Parameters:
sess
- perun sessionid
- id of desired consent object- Returns:
- consent object with specified id
- Throws:
ConsentNotExistsException
- thrown if consent with the id doesn't exist
-
getConsentForUserAndConsentHub
Consent getConsentForUserAndConsentHub(PerunSession sess, int userId, int consentHubId, ConsentStatus status) throws ConsentNotExistsException Get consent for chosen user in specified consent hub with specified status- Parameters:
sess
- PerunSessionuserId
- id of the userconsentHubId
- id of the consent hubstatus
- chosen status- Returns:
- consent for chosen user in specified consent hub with specified status
- Throws:
ConsentNotExistsException
- if consent doesn't exist
-
getConsentHubByFacility
ConsentHub getConsentHubByFacility(PerunSession sess, int facilityId) throws ConsentHubNotExistsException Finds existing Consent Hub by facility.- Parameters:
sess
- perun sessionfacilityId
- facility for which consent hub is searched- Returns:
- found Consent Hub
- Throws:
ConsentHubNotExistsException
- if Consent Hub with the specified name doesn't existInternalErrorException
- if an exception occurred
-
getConsentHubById
Finds existing Consent Hub by id.- Parameters:
sess
- perun sessionid
- id of the Consent Hub you are looking for- Returns:
- found Consent Hub
- Throws:
ConsentHubNotExistsException
- if Consent Hub with the specified id doesn't existInternalErrorException
- if an exception occurred
-
getConsentHubByName
Finds existing Consent Hub by name.- Parameters:
sess
- perun sessionname
- name of the Consent Hub you are looking for- Returns:
- found Consent Hub
- Throws:
ConsentHubNotExistsException
- if Consent Hub with the specified name doesn't existInternalErrorException
- if an exception occurred
-
getConsentHubsByService
Finds all existing Consent Hubs by service (service is assigned to them)- Parameters:
session
- perun sessionserviceId
- service for which consent hubs are searched- Returns:
- list of consent hubs that have given service assigned to them
-
getConsentsForConsentHub
Get all consents for chosen ConsentHub with the specified status- Parameters:
sess
- PerunSessionid
- id of the ConsentHubstatus
- status of the consent- Returns:
- consents for chosen ConsentHub with the specified status
-
getConsentsForConsentHub
Get all consents for chosen ConsentHub- Parameters:
sess
- PerunSessionid
- id of the ConsentHub- Returns:
- consents for chosen ConsentHub
-
getConsentsForUser
Get all consents for chosen User with the specified status- Parameters:
sess
- PerunSessionid
- id of the Userstatus
- status of the consent- Returns:
- consents for chosen User with the specified status
-
getConsentsForUser
Get all consents for chosen User- Parameters:
sess
- PerunSessionid
- id of the user- Returns:
- consents for chosen User
-
getConsentsForUserAndConsentHub
Get list of consents for user and consent hub- Parameters:
sess
- PerunSessionuserId
- id of the userconsentHubId
- id of the consent hub- Returns:
- list of consents for the user and consent hub
-
getFacilitiesForConsentHub
Get list of all facilities associated to the given Consent Hub- Parameters:
consentHub
- Consent Hub- Returns:
- list of facilities
-
removeFacility
void removeFacility(PerunSession sess, ConsentHub consentHub, Facility facility) throws RelationNotExistsException Removes facility from consent hub.- Parameters:
sess
- sessionconsentHub
- consent hubfacility
- facility to be removed- Throws:
RelationNotExistsException
- if facility is not assigned to consent hub
-
updateConsentHub
void updateConsentHub(PerunSession perunSession, ConsentHub consentHub) throws ConsentHubExistsException Updates the consent hub. Ignores related facilities.- Parameters:
perunSession
- sessionconsentHub
- consent hub- Throws:
ConsentHubExistsException
- if consent hub with the same name exists
-