void attach(final ProjectUpdatedEvent event) { checkNotNull(this.entity,"Entity cannot be null"); checkNotNull(this.target,"Target cannot be null"); checkNotNull(this.action,"Action cannot be null"); final Map<String, List<Change>> entityChanges = event.getChanges().get(this.entity); List<Change> targetChanges=entityChanges.get(this.target); if(targetChanges==null) { targetChanges=Lists.newArrayList(); entityChanges.put(this.target,targetChanges); } targetChanges.add(Change.create(this.action,this.authors)); }
/** * Set the changes that happened to the project project * * @param changes * The identifier of the project */ @JsonProperty(CHANGES) public void setChanges(final Map<Entity, Map<String, List<Change>>> changes) { this.changes = changes; refreshSize(changes); }
static void updateProject(final WriteSession session, final ProjectUpdatedEvent event) throws IOException { final Name<String> projectName = IdentityUtil.projectName(event.getProject()); final ResourceSnapshot projectSnapshot = session.find(ResourceSnapshot.class,projectName,ProjectHandler.class); if(projectSnapshot==null) { throw new IOException("Project "+event.getProject()+" does not exist"); for(final Entry<Entity, Map<String, List<Change>>> entry:event.getChanges().entrySet()) { switch(entry.getKey()) { case COMPONENT: event.getProject(), addedComponents, projectSnapshot); event.getProject(), deletedComponents, session); event.getProject(), addedVersions, projectSnapshot); event.getProject(), deletedVersions, session); event.getProject(), addedIssues, projectSnapshot);
project.getIssues().addAll(oldProject.getIssues()); ProjectUpdatedEvent event = new ProjectUpdatedEvent(); Set<String> news = new HashSet<>(); news.addAll(newTop); event.setProject(project.getId()); if (!news.isEmpty() || !updated.isEmpty()) { sendNotification(event); ProjectUpdatedEvent event = new ProjectUpdatedEvent(); event.setProject(jiraProject.getKey()); for (String id : newComponents) { event.append(Modification.create().component(id)); event.append(Modification.create().version(id));