use of com.sequenceiq.cloudbreak.domain.StructuredEventEntity in project cloudbreak by hortonworks.
the class StructuredEventToStructuredEventEntityConverter method convert.
@Override
public StructuredEventEntity convert(StructuredEvent source) {
try {
OperationDetails operationDetails = source.getOperation();
StructuredEventEntity structuredEventEntity = new StructuredEventEntity();
structuredEventEntity.setEventType(operationDetails.getEventType());
structuredEventEntity.setResourceType(operationDetails.getResourceType());
structuredEventEntity.setResourceId(operationDetails.getResourceId());
structuredEventEntity.setTimestamp(operationDetails.getTimestamp());
structuredEventEntity.setAccount(operationDetails.getAccount());
structuredEventEntity.setUserId(operationDetails.getUserId());
structuredEventEntity.setStructuredEventJson(new Json(source));
return structuredEventEntity;
} catch (JsonProcessingException e) {
// TODO What should we do in case of json processing error
return null;
}
}
use of com.sequenceiq.cloudbreak.domain.StructuredEventEntity in project cloudbreak by hortonworks.
the class StructuredEventDBService method storeStructuredEvent.
@Override
public void storeStructuredEvent(StructuredEvent structuredEvent) {
StructuredEventEntity structuredEventEntityEntity = conversionService.convert(structuredEvent, StructuredEventEntity.class);
structuredEventRepository.save(structuredEventEntityEntity);
}
Aggregations