class FeedServiceImpl implements IFeedService {

  @Override
  public Response update(Feed feed) {
    ProjectLogger.log("FeedServiceImpl:update method called : ", LoggerEnum.INFO.name());
    Map<String, Object> feedData = feed.getData();
    Map<String, Object> dbMap = mapper.convertValue(feed, Map.class);
    try {
      if (MapUtils.isNotEmpty(feed.getData())) {
        dbMap.put(JsonKey.FEED_DATA, mapper.writeValueAsString(feed.getData()));
      }
    } catch (Exception ex) {
      ProjectLogger.log("FeedServiceImpl:update Exception occurred while mapping.", ex);
    }
    dbMap.remove(JsonKey.CREATED_ON);
    dbMap.put(JsonKey.UPDATED_ON, new Timestamp(Calendar.getInstance().getTimeInMillis()));
    Response response = saveFeed(dbMap);
    // update data to ES
    dbMap.put(JsonKey.FEED_DATA, feedData);
    dbMap.put(JsonKey.UPDATED_ON, Calendar.getInstance().getTimeInMillis());
    getESInstance().update(ProjectUtil.EsType.userfeed.getTypeName(), feed.getId(), dbMap);
    return response;
  }

}