Example #1
0
 @GET
 @Path("{userId}/timeline/events")
 public Response getActivityEvents(@PathParam("userId") final String userId) {
   List<Event> events = auditEventDao.getEvents(userId);
   EventPage eventPage = new EventPage(0, events.size(), events);
   return Response.ok().entity(eventPage).build();
 }
Example #2
0
 @GET
 @Path("{userId}/timeline/feed")
 public Response getFeedForTheUser(@PathParam("userId") final String userId) throws IOException {
   List<Event> events = auditEventDao.getFeedEvents(userId);
   EventPage eventPage = new EventPage(0, events.size(), events);
   return Response.ok().entity(eventPage).build();
 }
Example #3
0
 private void setUpdatedFields(User user, Fields fields) throws Exception {
   ObjectMapper objectMapper = new ObjectMapper();
   for (Field field : fields.getFields()) {
     BeanUtils.setProperty(user, field.getName(), field.getValue());
   }
   Long currentTime = System.currentTimeMillis();
   String targetUserId = user.getId();
   String targetUserName = objectMapper.writeValueAsString(fields);
   String targetUrl = null;
   Target target = new Target(IdType.USER_ID.toString(), targetUserName, targetUrl);
   Event followedUSerEvent =
       new Event(AuditEventType.USER_UPDATED.toString(), target, currentTime, false);
   auditEventDao.addEvent(targetUserId, followedUSerEvent);
 }