use of com.cloudera.thunderhead.service.usermanagement.UserManagementProto.EventGenerationIds in project cloudbreak by hortonworks.
the class UmsEventGenerationIdsProvider method getEventGenerationIds.
public UmsEventGenerationIds getEventGenerationIds(String accountId, Optional<String> requestId) {
EventGenerationIds eventGenerationIds = grpcUmsClient.getEventGenerationIds(accountId, requestId, regionAwareInternalCrnGeneratorFactory).getEventGenerationIds();
UmsEventGenerationIds umsEventGenerationIds = new UmsEventGenerationIds();
Map<String, String> eventGenerationIdsMap = Maps.newHashMap();
for (Descriptors.FieldDescriptor fd : eventGenerationIds.getDescriptorForType().getFields()) {
if (Descriptors.FieldDescriptor.Type.STRING.equals(fd.getType()) && eventGenerationIds.hasField(fd)) {
eventGenerationIdsMap.put(fd.getName(), (String) eventGenerationIds.getField(fd));
}
}
umsEventGenerationIds.setEventGenerationIds(eventGenerationIdsMap);
return umsEventGenerationIds;
}
Aggregations