use of com.haleconnect.api.user.v1.api.OrganisationsApi in project hale by halestudio.
the class HaleConnectServiceImpl method getOrganisationInfo.
/**
* @see eu.esdihumboldt.hale.io.haleconnect.HaleConnectService#getOrganisationInfo(java.lang.String)
*/
@Override
public HaleConnectOrganisationInfo getOrganisationInfo(String orgId) throws HaleConnectException {
if (!this.isLoggedIn()) {
return null;
}
if (!orgInfoCache.containsKey(orgId)) {
OrganisationsApi api = UserServiceHelper.getOrganisationsApi(this, this.getSession().getToken());
try {
OrganisationInfo org = api.getOrganisation(orgId);
orgInfoCache.put(org.getId(), new HaleConnectOrganisationInfo(org.getId(), org.getName()));
} catch (ApiException e) {
throw new HaleConnectException(e.getMessage(), e);
}
}
return orgInfoCache.get(orgId);
}
Aggregations