From 1fea014e9cf01c23040ded96ac2a9c600d9132f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20G=C3=A9raud?= Date: Tue, 5 Sep 2017 13:47:43 +0200 Subject: [PATCH] feat(groups): create default group for api and apps fix gravitee-io/issues#763 --- .../repository/management/model/Group.java | 14 +++++++ .../management/model/GroupEvent.java | 25 ++++++++++++ .../management/model/GroupEventRule.java | 39 +++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 src/main/java/io/gravitee/repository/management/model/GroupEvent.java create mode 100644 src/main/java/io/gravitee/repository/management/model/GroupEventRule.java diff --git a/src/main/java/io/gravitee/repository/management/model/Group.java b/src/main/java/io/gravitee/repository/management/model/Group.java index adebd69a..e9987d34 100644 --- a/src/main/java/io/gravitee/repository/management/model/Group.java +++ b/src/main/java/io/gravitee/repository/management/model/Group.java @@ -38,6 +38,12 @@ public class Group { * administrators of the group. May be null */ private List administrators; + + /** + * events + */ + private List eventRules; + /** * Creation date */ @@ -87,4 +93,12 @@ public Date getUpdatedAt() { public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; } + + public List getEventRules() { + return eventRules; + } + + public void setEventRules(List eventRules) { + this.eventRules = eventRules; + } } diff --git a/src/main/java/io/gravitee/repository/management/model/GroupEvent.java b/src/main/java/io/gravitee/repository/management/model/GroupEvent.java new file mode 100644 index 00000000..d49a4578 --- /dev/null +++ b/src/main/java/io/gravitee/repository/management/model/GroupEvent.java @@ -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.model; + +/** + * @author Nicolas GERAUD (nicolas.geraud at graviteesource.com) + * @author GraviteeSource Team + */ +public enum GroupEvent { + API_CREATE, + APPLICATION_CREATE +} diff --git a/src/main/java/io/gravitee/repository/management/model/GroupEventRule.java b/src/main/java/io/gravitee/repository/management/model/GroupEventRule.java new file mode 100644 index 00000000..644cf77b --- /dev/null +++ b/src/main/java/io/gravitee/repository/management/model/GroupEventRule.java @@ -0,0 +1,39 @@ +/** + * 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 Nicolas GERAUD (nicolas.geraud at graviteesource.com) + * @author GraviteeSource Team + */ +public class GroupEventRule { + private GroupEvent event; + + public GroupEventRule() { + } + + public GroupEventRule(GroupEvent event) { + this.event = event; + } + + public GroupEvent getEvent() { + return event; + } + + public void setEvent(GroupEvent event) { + this.event = event; + } +}