Skip to content

Commit

Permalink
Merge pull request gravitee-io#5 from gravitee-io/feature/enhance-eve…
Browse files Browse the repository at this point in the history
…nt-with-properties

Enhance event with properties
  • Loading branch information
brasseld committed Jan 20, 2016
2 parents fd866aa + 9e65a3d commit 048b426
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
import java.util.Set;

/**
* @author Titouan COMPIEGNE
*/
* @author Titouan COMPIEGNE
*/
public interface EventRepository extends CrudRepository<Event, String> {

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

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

}
13 changes: 13 additions & 0 deletions src/main/java/io/gravitee/repository/management/model/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public class Api {
* The api JSON definition
*/
private String definition;

/**
* The api deployment date
*/
private Date deployedAt;

/**
* The Api creation date
Expand Down Expand Up @@ -94,6 +99,14 @@ public String getName() {
public void setName(String name) {
this.name = name;
}

public Date getDeployedAt() {
return deployedAt;
}

public void setDeployedAt(Date deployedAt) {
this.deployedAt = deployedAt;
}

public Date getUpdatedAt() {
return updatedAt;
Expand Down
210 changes: 107 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,117 @@
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 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 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"),
ORIGIN("origin"),
USERNAME("username");

private String value;

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

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

0 comments on commit 048b426

Please sign in to comment.