Class CeitecCrmConnector

java.lang.Object
cz.metacentrum.perun.core.impl.modules.CeitecCrmConnector

public class CeitecCrmConnector extends Object
Connector class used to call CEITEC CRM API. It supports check for users existence and retrieval of existing or newly generated login and CN to be later set to a proper attributes.
Author:
Pavel Zlámal <zlamal@cesnet.cz>
  • Constructor Details

    • CeitecCrmConnector

      public CeitecCrmConnector()
  • Method Details

    • checkCrmUserExists

      public boolean checkCrmUserExists(String ceitecId)
      Check whether user with specified CEITEC ID exists in CRM.
      Parameters:
      ceitecId - ID to check
      Returns:
      TRUE when CRM API response is 200, FALSE when 404, throws exception otherwise
    • getLogin

      public String getLogin(String ceitecId, Attribute eppns, User user)
      Reads CEITEC "login" from user entry in CRM. "CEITEC\" prefix is dropped. Returns existing login if user is matched or generates new by pre-defined rules.
      Parameters:
      ceitecId - CEITEC ID
      eppns - Attribute with all users' EPPNs
      user - User to get login for
      Returns:
      Existing or generated login to be set to u:d:login-namespace:ceitec
    • getCn

      public String getCn(String ceitecId, Attribute eppns, User user)
      Reads CN (common name) attribute from user entry in CRM. Returns existing CN if user is matched or generates new by pre-defined rules.
      Parameters:
      ceitecId - CEITEC ID
      eppns - Attribute with all users' EPPNs
      user - User to get CN for
      Returns:
      Existing or generated CN to be set to u:d:cnCeitecAD
    • isMigrationRunning

      public boolean isMigrationRunning()
      Reads configuration from /etc/perun/modules/Ceitec.yaml and returns TRUE if migration of CEITEC users is currently running.
      Returns:
      TRUE if migration is running, FALSE otherwise.