Nifi connection rest client cleanup logs when updating connections
@@ -20,7 +20,6 @@ package com.thinkbiganalytics.nifi.v1.rest.client;
* #L%
*/
-import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableMap;
import com.thinkbiganalytics.nifi.rest.client.AbstractNiFiConnectionsRestClient;
import com.thinkbiganalytics.nifi.rest.client.NiFiConnectionsRestClient;
@@ -167,33 +166,14 @@ public class NiFiConnectionsRestClientV1 extends AbstractNiFiConnectionsRestClie
updateDto.getDestination().setId(connectionDTO.getDestination().getId());
updateDto.getDestination().setType(connectionDTO.getDestination().getType());
}
- /*
-
- connectionEntity.setComponent(connectionDTO);
- connectionEntity.setId(connectionDTO.getId());
- connectionEntity.setDestinationId(connectionDTO.getDestination() != null ? connectionDTO.getDestination().getId() : null);
- connectionEntity.setDestinationGroupId(connectionDTO.getDestination() != null ? connectionDTO.getDestination().getGroupId() : null);
- connectionEntity.setDestinationType(connectionDTO.getDestination() != null ? connectionDTO.getDestination().getType() : null);
- connectionEntity.setSourceId(connectionDTO.getSource() != null ? connectionDTO.getSource().getId() : null);
- connectionEntity.setSourceGroupId(connectionDTO.getSource() != null ? connectionDTO.getSource().getGroupId() : null);
- connectionEntity.setSourceType(connectionDTO.getSource() != null ? connectionDTO.getSource().getType() : null);
- */
final RevisionDTO revision = new RevisionDTO();
revision.setVersion(current.get().getRevision().getVersion());
connectionEntity.setRevision(revision);
-
-/*
- final RevisionDTO revision = new RevisionDTO();
- revision.setVersion(current.getRevision().getVersion());
- connectionEntity.setRevision(revision);
- */
- ObjectMapper m = new ObjectMapper();
-
try {
- log.info("Updating ConnectionEntity: {} ",m.writeValueAsString(connectionEntity));
return Optional.of(client.put(CONNECTION_PATH + connectionDTO.getId(), connectionEntity, ConnectionEntity.class).getComponent());
} catch (Exception e) {
+ log.error("Error updating connection entry info for connection: {} {} ", connectionDTO, e.getMessage());
return Optional.empty();
}
}
