Search in sources :

Example 1 with EventGenerationIds

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;
}
Also used : EventGenerationIds(com.cloudera.thunderhead.service.usermanagement.UserManagementProto.EventGenerationIds) UmsEventGenerationIds(com.sequenceiq.freeipa.service.freeipa.user.model.UmsEventGenerationIds) UmsEventGenerationIds(com.sequenceiq.freeipa.service.freeipa.user.model.UmsEventGenerationIds) Descriptors(com.google.protobuf.Descriptors)

Aggregations

EventGenerationIds (com.cloudera.thunderhead.service.usermanagement.UserManagementProto.EventGenerationIds)1 Descriptors (com.google.protobuf.Descriptors)1 UmsEventGenerationIds (com.sequenceiq.freeipa.service.freeipa.user.model.UmsEventGenerationIds)1