Interface VosManagerImplApi

All Known Implementing Classes:
VosManagerImpl

public interface VosManagerImplApi

VOs manager can create, delete, update and find VO.

You must get an instance of VosManager from Perun:

    PerunSession ps;
    //...
    VosManager vm = ps.getPerun().getVosManager();
 
Author:
Michal Prochazka, Slavek Licehammer
See Also:
  • Method Details

    • getVos

      List<Vo> getVos(PerunSession perunSession)
      Get list of all Vos.
      Parameters:
      perunSession -
      Returns:
      List of VOs
      Throws:
      InternalErrorException
    • deleteVo

      Vo deleteVo(PerunSession perunSession, Vo vo)
      Delete VO.
      Parameters:
      perunSession -
      vo -
      Returns:
      deleted VO
      Throws:
      InternalErrorException
    • createVo

      Vo createVo(PerunSession perunSession, Vo vo) throws VoExistsException
      Create new VO.
      Parameters:
      perunSession -
      vo -
      Returns:
      newly created VO
      Throws:
      VoExistsException
      InternalErrorException
    • updateVo

      Vo updateVo(PerunSession perunSession, Vo vo)
      Updates VO.
      Parameters:
      perunSession -
      vo -
      Returns:
      returns updated VO
      Throws:
      InternalErrorException
    • getVoByShortName

      Vo getVoByShortName(PerunSession perunSession, String shortName) throws VoNotExistsException
      Find existing VO by short name (short name is unique).
      Parameters:
      perunSession -
      shortName -
      Returns:
      vo
      Throws:
      VoNotExistsException
      InternalErrorException
    • getVoById

      Vo getVoById(PerunSession perunSession, int id) throws VoNotExistsException
      Finds existing VO by id.
      Parameters:
      perunSession -
      id - id of the VO you are looking for
      Returns:
      found VO
      Throws:
      VoNotExistsException
      InternalErrorException
    • getVosByIds

      List<Vo> getVosByIds(PerunSession perunSession, List<Integer> ids)
      Gets VOs by their ids. Silently skips non-existing VOs.
      Parameters:
      perunSession -
      ids -
      Returns:
      List of VOs with specified ids
      Throws:
      InternalErrorException
    • getAdmins

      List<User> getAdmins(PerunSession sess, Vo vo, String role)
      Get list of user administrators of specific vo for specific role. If some group is administrator of the VO, all VALID members are included in the list.
      Parameters:
      sess -
      vo -
      role -
      Returns:
      List of users who are administrators of the vo with specific role. Empty list if there is no such administrator
      Throws:
      InternalErrorException
    • getDirectAdmins

      List<User> getDirectAdmins(PerunSession sess, Vo vo, String role)
      Get list of direct user administrators of specific vo for specific role. 'Direct' means, there aren't included users, who are members of group administrators, in the returned list.
      Parameters:
      sess -
      vo -
      role -
      Returns:
      List of direct users who are administrators of the vo with specific role. Empty list if there is no such administrator
      Throws:
      InternalErrorException
    • getAdminGroups

      List<Group> getAdminGroups(PerunSession sess, Vo vo, String role)
      Get list of group administrators of the given VO for specific role.
      Parameters:
      sess -
      vo -
      Returns:
      List of groups, who are administrators of the Vo with specific role. Returns empty list if there is no such authorized group.
      Throws:
      InternalErrorException
    • getAdmins

      @Deprecated List<User> getAdmins(PerunSession sess, Vo vo)
      Deprecated.
      Get list of Vo administrators. If some group is administrator of the VO, all members are included in the list.
      Parameters:
      sess -
      vo -
      Returns:
      List of users, who are administrators of the Vo. Returns empty list if there is no VO admin.
      Throws:
      InternalErrorException
    • getDirectAdmins

      @Deprecated List<User> getDirectAdmins(PerunSession perunSession, Vo vo)
      Deprecated.
      Gets list of direct user administrators of the VO. 'Direct' means, there aren't included users, who are members of group administrators, in the returned list.
      Parameters:
      perunSession -
      vo -
      Throws:
      InternalErrorException
    • getAdminGroups

      @Deprecated List<Group> getAdminGroups(PerunSession sess, Vo vo)
      Deprecated.
      Get list of group administrators of the given VO.
      Parameters:
      sess -
      vo -
      Returns:
      List of groups, who are administrators of the Vo. Returns empty list if there is no VO group admin.
      Throws:
      InternalErrorException
    • voExists

      boolean voExists(PerunSession perunSession, Vo vo)
      Check if vo exists in underlaying data source.
      Parameters:
      perunSession -
      vo -
      Returns:
      true if vo exists in underlaying data source, false otherwise
      Throws:
      InternalErrorException
    • checkVoExists

      void checkVoExists(PerunSession perunSession, Vo vo) throws VoNotExistsException
      Check if vo exists in underlaying data source.
      Parameters:
      perunSession -
      vo -
      Throws:
      InternalErrorException
      VoNotExistsException
    • getVoApplicationIds

      List<Integer> getVoApplicationIds(PerunSession sess, Vo vo)
      Return list of IDs of all applications, which belongs to VO.
      Parameters:
      sess -
      vo -
      Returns:
      list of all vo applications ids
      Throws:
      InternalErrorException
    • getApplicationReservedLogins

      List<Pair<String,String>> getApplicationReservedLogins(Integer appId)
      Return list of all reserved logins for specific application (pair is namespace and login)
      Parameters:
      appId - from which application get reserved logins
      Returns:
      list of pairs namespace and login
      Throws:
      InternalErrorException
    • deleteVoReservedLogins

      void deleteVoReservedLogins(PerunSession sess, Vo vo)
      Delete all VO login reservations Reserved logins must be removed from external systems (e.g. KDC) BEFORE calling this method via deletePassword() in UsersManager.
      Parameters:
      sess -
      vo - VO to delete all login reservations for
      Throws:
      InternalErrorException
    • createApplicationForm

      void createApplicationForm(PerunSession sess, Vo vo)
      Creates empty application form definition for VO when VO is created
      Parameters:
      sess -
      vo -
      Throws:
      InternalErrorException
    • getVosCount

      int getVosCount(PerunSession perunSession)
      Get count of all vos.
      Parameters:
      perunSession -
      Returns:
      count of all vos
      Throws:
      InternalErrorException
    • setBan

      BanOnVo setBan(PerunSession sess, BanOnVo banOnVo)
      Set given ban.
      Parameters:
      sess - session
      banOnVo - ban information, memberId, voId, validity and description are needed
      Returns:
      created ban object
    • getBanById

      BanOnVo getBanById(PerunSession sess, int banId) throws BanNotExistsException
      Get ban by its id.
      Parameters:
      sess - session
      banId - ban id
      Returns:
      ban object
      Throws:
      BanNotExistsException - if ban with given id is not found
    • getBanForMember

      BanOnVo getBanForMember(PerunSession sess, int memberId) throws BanNotExistsException
      Get ban for given member.
      Parameters:
      sess - session
      memberId - member id
      Returns:
      ban object
      Throws:
      BanNotExistsException - if there is no ban for member with given id
    • getBansForVo

      List<BanOnVo> getBansForVo(PerunSession sess, int voId)
      Get list of all bans for vo with given id.
      Parameters:
      sess - session
      voId - vo id
      Returns:
      list of bans for given vo
    • updateBan

      BanOnVo updateBan(PerunSession sess, BanOnVo banOnVo)
      Update ban information. Only description and validity are updated.
      Parameters:
      sess - session
      banOnVo - updated ban
      Returns:
      updated ban object
    • removeBan

      void removeBan(PerunSession sess, int banId) throws BanNotExistsException
      Removes ban with given id.
      Parameters:
      sess - session
      banId - ban id
      Throws:
      BanNotExistsException - if there is no ban with given id
    • isMemberBanned

      boolean isMemberBanned(PerunSession sess, int memberId)
      Information if there is a ban for member with given id.
      Parameters:
      sess - session
      memberId - member id
      Returns:
      true, if member with given id is banned, false otherwise
    • hasEmbeddedGroupsItemInForm

      boolean hasEmbeddedGroupsItemInForm(PerunSession sess, int voId)
      Returns true, if there is a vo with given id which has application form with the EMBEDDED_GROUP_APPLICATION item in it.
      Parameters:
      sess - session
      voId - vo id
      Returns:
      true, if there is a vo with given id which has application form with the EMBEDDED_GROUP_APPLICATION item in it, false otherwise
    • addMemberVo

      void addMemberVo(PerunSession sess, Vo vo, Vo memberVo) throws RelationExistsException
      Adds new relationship between vo and a member vo.
      Parameters:
      sess - session
      vo - vo
      memberVo - new member of the vo
      Throws:
      RelationExistsException - if member vo is already member of the vo
    • removeMemberVo

      void removeMemberVo(PerunSession sess, Vo vo, Vo memberVo) throws RelationNotExistsException
      Removes member vo from given vo.
      Parameters:
      sess - session
      vo - vo
      memberVo - vo to be removed
      Throws:
      RelationNotExistsException - if member vo is not a member of the vo
    • getMemberVos

      List<Vo> getMemberVos(PerunSession sess, int voId)
      Gets all member organizations of the given vo.
      Parameters:
      sess - session
      voId - vo id
      Returns:
      list of member vos
    • getParentVos

      List<Vo> getParentVos(PerunSession sess, int memberVoId)
      Gets all organizations where given vo is direct member.
      Parameters:
      sess - session
      memberVoId - member vo id
      Returns:
      list of direct parent vos