use of org.cloudfoundry.client.v2.events.EventResource in project cf-java-client by cloudfoundry.
the class DefaultApplications method convertToApplicationEvent.
private static ApplicationEvent convertToApplicationEvent(EventResource resource) {
EventEntity entity = resource.getEntity();
Date timestamp = null;
try {
timestamp = DateUtils.parseFromIso8601(entity.getTimestamp());
} catch (IllegalArgumentException iae) {
// do not set time
}
return ApplicationEvent.builder().actor(entity.getActorName()).description(eventDescription(getMetadataRequest(entity), getEntryNames(entity.getType()))).id(ResourceUtils.getId(resource)).event(entity.getType()).time(timestamp).build();
}
Aggregations