New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[repository] refactor how to manage memberships #228

Closed
NicolasGeraud opened this Issue Sep 15, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@NicolasGeraud
Member

NicolasGeraud commented Sep 15, 2016

Currently, apis and applications stores their members themselves

package io.gravitee.repository.management.model;

public class Api {
    ...
    private List<Membership> members;
    ...
}

With this model, each implementations need to manage how to store datas.
For mongodb, it's stored as a list of member inside the Api collection, for redis it is in a dedicated collection.

I think it could be more efficient to change how we represent the membership.

  • remove membersinside repository models
  • create a MembershipRepository to manage memberships
  • manage Api memberships and Application memberships inside services

The membership model should evolve to :

public class Membership {
    private User user;

    private String referenceId; // the api id, or application id, depending on the referenceType
    private MembershipReferenceType referenceType; // API, APPLICATION
    private MembershipType type;//PRIMARY_OWNER, OWNER, USER

    private Date createdAt;
    private Date updatedAt;

@NicolasGeraud NicolasGeraud self-assigned this Sep 15, 2016

@NicolasGeraud NicolasGeraud added this to the 1.0.0 milestone Sep 15, 2016

NicolasGeraud added a commit to gravitee-io/gravitee-repository that referenced this issue Sep 19, 2016

NicolasGeraud added a commit to gravitee-io/gravitee-repository-test that referenced this issue Sep 19, 2016

NicolasGeraud added a commit to gravitee-io/gravitee-repository-mongodb that referenced this issue Sep 19, 2016

NicolasGeraud added a commit to gravitee-io/gravitee-management-rest-api that referenced this issue Sep 19, 2016

NicolasGeraud added a commit to gravitee-io/gravitee-management-rest-api that referenced this issue Sep 19, 2016

brasseld added a commit to gravitee-io/gravitee-repository that referenced this issue Sep 19, 2016

brasseld added a commit to gravitee-io/gravitee-repository-test that referenced this issue Sep 19, 2016

brasseld added a commit to gravitee-io/gravitee-repository-mongodb that referenced this issue Sep 19, 2016

brasseld added a commit to gravitee-io/gravitee-management-rest-api that referenced this issue Sep 19, 2016

NicolasGeraud added a commit to gravitee-io/gravitee-repository-redis that referenced this issue Sep 21, 2016

NicolasGeraud added a commit to gravitee-io/gravitee-repository-redis that referenced this issue Sep 21, 2016

NicolasGeraud added a commit to gravitee-io/gravitee-management-rest-api that referenced this issue Sep 21, 2016

fix(membership): store memberships in a dedicated repository
do not try to convert empty set of apis ou applications

fix gravitee-io/issues#228

brasseld added a commit to gravitee-io/gravitee-repository-redis that referenced this issue Sep 29, 2016

brasseld added a commit to gravitee-io/gravitee-management-rest-api that referenced this issue Sep 29, 2016

fix(membership): store memberships in a dedicated repository (#125)
do not try to convert empty set of apis ou applications

fix gravitee-io/issues#228
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment