Skip to content

Commit

Permalink
feat(event): add Event and EventType model + add event repository
Browse files Browse the repository at this point in the history
  • Loading branch information
tcompiegne committed Jan 7, 2016
1 parent 2ca3361 commit 9510c0f
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.repository.management.api;

import io.gravitee.repository.management.model.Event;

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

}
102 changes: 102 additions & 0 deletions src/main/java/io/gravitee/repository/management/model/Event.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/**
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.repository.management.model;

import java.util.Date;

/**
* @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 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 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;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.repository.management.model;

/**
* @author Titouan COMPIEGNE
*/
public enum EventType {

PUBLISH_API,
PUBLISH_API_RESULT,
UNPUBLISH_API,
UNPUBLISH_API_RESULT,
SYSTEM_MONITOR
}

0 comments on commit 9510c0f

Please sign in to comment.