em.refresh(resourceType);
Set<EventDefinition> eventDefinitions = resourceType.getEventDefinitions();
List<EventDefinitionRest> definitionsRest = new ArrayList<EventDefinitionRest>(eventDefinitions.size());
for (EventDefinition source : eventDefinitions) {
EventDefinitionRest esr = new EventDefinitionRest();
esr.setDescription(source.getDescription());
esr.setId(source.getId());
esr.setDisplayName(source.getDisplayName());
esr.setName(source.getName());
definitionsRest.add(esr);
}
Response.ResponseBuilder builder;
MediaType mediaType = headers.getAcceptableMediaTypes().get(0);