Package cz.metacentrum.perun.core.api
Interface OwnersManager
- All Known Implementing Classes:
OwnersManagerEntry
public interface OwnersManager
OwnersManager
- Author:
- Slavek Licehammer
-
Method Summary
Modifier and TypeMethodDescriptioncreateOwner
(PerunSession perunSession, Owner owner) Create owner in the underlaying data sourcevoid
deleteOwner
(PerunSession perunSession, Owner owner) Delete owner from underlaying data source.void
deleteOwner
(PerunSession perunSession, Owner owner, boolean forceDelete) Delete owner from underlaying data source.void
deleteOwners
(PerunSession sess, List<Owner> owners, boolean forceDelete) Delete owners from underlaying data source.getOwnerById
(PerunSession perunSession, int id) Find owner by id.getOwnerByName
(PerunSession perunSession, String name) Find owner by name.getOwners
(PerunSession perunSession) Return all owners.
-
Method Details
-
createOwner
Create owner in the underlaying data source- Parameters:
perunSession
-owner
-- Returns:
- owner with id set
- Throws:
InternalErrorException
PrivilegeException
-
deleteOwner
void deleteOwner(PerunSession perunSession, Owner owner) throws OwnerNotExistsException, PrivilegeException, RelationExistsException, OwnerAlreadyRemovedException Delete owner from underlaying data source.- Parameters:
perunSession
-owner
-- Throws:
OwnerNotExistsException
InternalErrorException
PrivilegeException
RelationExistsException
OwnerAlreadyRemovedException
- if there are 0 rows affected by deleting from DB
-
deleteOwner
void deleteOwner(PerunSession perunSession, Owner owner, boolean forceDelete) throws OwnerNotExistsException, PrivilegeException, RelationExistsException, OwnerAlreadyRemovedException Delete owner from underlaying data source.- Parameters:
perunSession
-owner
-forceDelete
-- Throws:
OwnerNotExistsException
InternalErrorException
PrivilegeException
RelationExistsException
OwnerAlreadyRemovedException
- if there are 0 rows affected by deleting from DB
-
deleteOwners
void deleteOwners(PerunSession sess, List<Owner> owners, boolean forceDelete) throws OwnerNotExistsException, PrivilegeException, RelationExistsException, OwnerAlreadyRemovedException Delete owners from underlaying data source.- Parameters:
sess
- perun sessionowners
- list of ownersforceDelete
-- Throws:
OwnerNotExistsException
InternalErrorException
PrivilegeException
RelationExistsException
OwnerAlreadyRemovedException
- if there are 0 rows affected by deleting from DB
-
getOwnerById
Owner getOwnerById(PerunSession perunSession, int id) throws OwnerNotExistsException, PrivilegeException Find owner by id.- Parameters:
perunSession
-id
-- Returns:
- Owner with specified id
- Throws:
OwnerNotExistsException
InternalErrorException
PrivilegeException
-
getOwnerByName
Owner getOwnerByName(PerunSession perunSession, String name) throws OwnerNotExistsException, PrivilegeException Find owner by name.- Parameters:
perunSession
- perun sessionname
- name of the owner- Returns:
- Owner with specified name
- Throws:
OwnerNotExistsException
- if owner with given name does not existPrivilegeException
- if user does not have sufficient permissions
-
getOwners
Return all owners.- Parameters:
perunSession
-- Returns:
- list of owners
- Throws:
InternalErrorException
PrivilegeException
-