Skip to content

Commit

Permalink
feat(event): add properties attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
tcompiegne committed Jan 18, 2016
1 parent fd866aa commit 5faf6d1
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ public interface EventRepository extends CrudRepository<Event, String> {

Set<Event> findByType(List<EventType> eventTypes);

Set<Event> findByProperty(String key, String value);

}
234 changes: 131 additions & 103 deletions src/main/java/io/gravitee/repository/management/model/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,113 +16,141 @@
package io.gravitee.repository.management.model;

import java.util.Date;
import java.util.Map;

/**
* @author Titouan COMPIEGNE
*/
public class Event {

/**
* The event ID
*/
private String id;

/**
* The event Type
*/
private EventType type;

/**
* The event payload
*/
private String payload;

/**
* The event parent
*/
private String parentId;

/**
* The event origin
*/
private String origin;

/**
* The event publisher
*/
private String username;

/**
* The event creation date
*/
private Date createdAt;

/**
* The event last updated date
*/
private Date updatedAt;

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public EventType getType() {
return type;
}

public void setType(EventType type) {
this.type = type;
}

public String getPayload() {
return payload;
}

public void setPayload(String payload) {
this.payload = payload;
}

public String getParentId() {
return parentId;
}

public void setParentId(String parentId) {
this.parentId = parentId;
}

public String getOrigin() {
return origin;
}

public void setOrigin(String origin) {
this.origin = origin;
}

public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public Date getCreatedAt() {
return createdAt;
}

public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}

public Date getUpdatedAt() {
return updatedAt;
}

public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
/**
* The event ID
*/
private String id;

/**
* The event Type
*/
private EventType type;

/**
* The event payload
*/
private String payload;

/**
* The event parent
*/
private String parentId;

/**
* The event origin
*/
private String origin;

/**
* The event publisher
*/
private String username;

/**
* The event properties
*/
private Map<String, String> properties;

/**
* The event creation date
*/
private Date createdAt;

/**
* The event last updated date
*/
private Date updatedAt;

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public EventType getType() {
return type;
}

public void setType(EventType type) {
this.type = type;
}

public String getPayload() {
return payload;
}

public void setPayload(String payload) {
this.payload = payload;
}

public String getParentId() {
return parentId;
}

public void setParentId(String parentId) {
this.parentId = parentId;
}

public String getOrigin() {
return origin;
}

public void setOrigin(String origin) {
this.origin = origin;
}

public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public Map<String, String> getProperties() {
return properties;
}

public void setProperties(Map<String, String> properties) {
this.properties = properties;
}

public Date getCreatedAt() {
return createdAt;
}

public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}

public Date getUpdatedAt() {
return updatedAt;
}

public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}

public enum EventProperties {
API_ID("api_id");

private String value;

EventProperties(String value) {
this.value = value;
}

public String getValue() {
return this.value;
}
}
}

0 comments on commit 5faf6d1

Please sign in to comment.