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.
Merge pull request gravitee-io#4 from gravitee-io/features/event
Features/event : Manually deploy API to the Gateway
- Loading branch information
Showing
3 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
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,31 @@ | ||
/** | ||
* 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; | ||
import io.gravitee.repository.management.model.EventType; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
/** | ||
* @author Titouan COMPIEGNE | ||
*/ | ||
public interface EventRepository extends CrudRepository<Event, String> { | ||
|
||
Set<Event> findByType(List<EventType> eventTypes); | ||
|
||
} |
128 changes: 128 additions & 0 deletions
128
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,128 @@ | ||
/** | ||
* 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 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; | ||
} | ||
} |
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 | ||
} |