/** * Add a new modification to the event. * * @param modification * the modification to be added * @return the updated event */ public ProjectUpdatedEvent append(final Modification modification) { modification.attach(this); this.size++; return this; }
private Change(final Action action, final List<String> authors) { setAction(action); setAuthors(authors); }
private Modification forward(final String target, final Entity entity) { return new Modification(this.action,entity,target,null); }
public static EntitySelector create() { return new EntitySelector(Action.CREATED); }
public Modification version(final String target) { return forward(target, Entity.VERSION); }
/** * 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); }
/** * Create a new empty change */ public Change() { setAuthors(Lists.<String>newArrayList()); }
@Override protected void handleEvent(final ContributorCreatedEvent event, final WriteSession session) { PublisherHelper. publishContributors( session, PublishingNotificationListener.this.target, event.getNewContributors()); }
@Override protected void handleEvent(final CommitCreatedEvent event, final WriteSession session) { PublisherHelper. publishCommits( session, PublishingNotificationListener.this.target, event.getNewCommits()); }
@Override protected void handleEvent(final ProjectCreatedEvent event, final WriteSession session) { PublisherHelper. publishProjects( session, PublishingNotificationListener.this.target, event.getNewProjects()); }
@Override protected void handleEvent(final CommitDeletedEvent event, final WriteSession session) { PublisherHelper.unpublishCommits(session, event.getDeletedCommits()); }
@Override protected void handleEvent(final ProjectDeletedEvent event, final WriteSession session) { PublisherHelper.unpublishProjects(session,event.getDeletedProjects()); }
@Override protected void handleEvent(final ContributorDeletedEvent event, final WriteSession session) { PublisherHelper.unpublishContributors(session,event.getDeletedContributors()); }
public Modification authors(final String... authors) { return new Modification(this.action,this.entity,this.target,authors); }
public static EntitySelector update() { return new EntitySelector(Action.UPDATED); }
public Modification issue(final String target) { return forward(target, Entity.ISSUE); }
public Modification authors(final Collection<String> authors) { return new Modification(this.action,this.entity,this.target,authors.toArray(new String[authors.size()])); }
public static EntitySelector delete() { return new EntitySelector(Action.DELETED); }
public Modification component(final String target) { return forward(target, Entity.COMPONENT); }