Class CeitecCrmConnector
java.lang.Object
cz.metacentrum.perun.core.impl.modules.CeitecCrmConnector
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 invalid input: '<'zlamal@cesnet.cz>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckAttributeExist(String attributeName, String attributeValue) Check whether there is an existing User in CRM by unique attribute like "new_ceitec_login" or "ce_cn_ceitec_ad".booleancheckCrmUserExists(String ceitecId, List<String> eppns) Check whether user with specified ceitecID or EPPNs exists in CRM.Reads CN (common name) attribute from user entry in CRM.Reads CEITEC "login" from user entry in CRM.booleanReads configuration from /etc/perun/modules/Ceitec.yaml and returns TRUE if migration of CEITEC users is currently running.
-
Constructor Details
-
CeitecCrmConnector
public CeitecCrmConnector()
-
-
Method Details
-
checkCrmUserExists
Check whether user with specified ceitecID or EPPNs exists in CRM. If ceitecId is provided, EPPNs are ignored by the backend.- Parameters:
ceitecId- ID to checkeppns- List of all users' EPPNs to check- Returns:
- TRUE when CRM API response is 200, FALSE when 404, throws exception otherwise
-
getLogin
Reads CEITEC "login" from user entry in CRM. "CEITEC\" prefix is dropped. Returns existing login if user is matched or NULL if not found.- Parameters:
ceitecId- CEITEC IDeppns- List of all users' EPPNs- Returns:
- Existing login to be set to u:d:login-namespace:ceitec or NULL
-
getCn
-
checkAttributeExist
Check whether there is an existing User in CRM by unique attribute like "new_ceitec_login" or "ce_cn_ceitec_ad".- Parameters:
attributeName- Name of attribute to checkattributeValue- Value of attribute to check- Returns:
- TRUE when CRM API respond with non-empty list of users, false when no user with matching unique ID is found, throws exception otherwise.
-
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.
-