forked from gravitee-io/gravitee-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(event): add Event and EventType model + add event repository
- Loading branch information
1 parent
2ca3361
commit 9510c0f
Showing
3 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/main/java/io/gravitee/repository/management/api/EventRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
102
src/main/java/io/gravitee/repository/management/model/Event.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/io/gravitee/repository/management/model/EventType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |