Skip to content

Commit

Permalink
event service fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nocs00 committed Jul 11, 2016
1 parent 0d24c03 commit 5423fab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Expand Up @@ -94,7 +94,6 @@ public EventClassFamily(EventClassFamilyDto dto) {
this.description = dto.getDescription();
this.createdUsername = dto.getCreatedUsername();
this.createdTime = dto.getCreatedTime();

}

public Tenant getTenant() {
Expand Down
Expand Up @@ -97,10 +97,7 @@ public EventClassFamilyDto findEventClassFamilyById(String id) {
public List<EventClassFamilyVersionDto> findEventClassFamilyVersionsById(String id) {
validateSqlId(id, "Event class family id is incorrect. Can't find event class family by id " + id);
EventClassFamily ecf = eventClassFamilyDao.findById(id);
List<EventClassFamilyVersion> schemas = ecf.getSchemas();
List<EventClassFamilyVersionDto> schemasDto = new ArrayList<>();
schemas.forEach(s -> schemasDto.add(s.toDto()));
return schemasDto;
return convertDtoList(ecf.getSchemas());
}

@Override
Expand All @@ -127,7 +124,11 @@ public EventClassFamilyDto saveEventClassFamily(
throw new IncorrectParameterException("Incorrect event class family. Namespace is not valid. '" + eventClassFamilyDto.getNamespace() + "' is not a valid identifier.");
}
}
savedEventClassFamilyDto = getDto(eventClassFamilyDao.save(new EventClassFamily(eventClassFamilyDto)));
EventClassFamily ecf = new EventClassFamily(eventClassFamilyDto);
List<EventClassFamilyVersion> schemas = new ArrayList<>();
findEventClassFamilyVersionsById(eventClassFamilyDto.getId()).forEach(s -> schemas.add(new EventClassFamilyVersion(s)));
ecf.setSchemas(schemas);
savedEventClassFamilyDto = getDto(eventClassFamilyDao.save(ecf));
} else {
LOG.debug("Can't save event class family. Name should be unique within the tenant.");
throw new IncorrectParameterException("Incorrect event class family. Name should be unique within the tenant.");
Expand Down
Expand Up @@ -1046,7 +1046,7 @@ List<NotificationSchemaDto> findNotificationSchemasByAppIdAndType(String applica
void addEventClassFamilySchema(String eventClassFamilyId, String eventClassFamilySchema, String createdUsername)
throws ControlServiceException;

/**
/**
* Gets the event classes by family id version and type.
*
* @param ecfId
Expand Down

0 comments on commit 5423fab

Please sign in to comment.