Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed group attribute from membershipType to Type

This is done to match the SCIM spec.

[#40653593]

Change-Id: I477515dc997d6161d635b8543641d93e93f48e79
  • Loading branch information...
commit e5d1f581061172fda0f3f4f72ca2329ec08a72a4 1 parent cb7e2f3
@joeldsa joeldsa authored
View
24 common/src/main/java/org/cloudfoundry/identity/uaa/scim/ScimUser.java
@@ -39,15 +39,15 @@
String display;
- public static enum MembershipType { DIRECT, INDIRECT };
- MembershipType membershipType;
+ public static enum Type { DIRECT, INDIRECT };
+ Type type;
- public MembershipType getMembershipType() {
- return membershipType;
+ public Type getType() {
+ return type;
}
- public void setMembershipType(MembershipType membershipType) {
- this.membershipType = membershipType;
+ public void setType(Type type) {
+ this.type = type;
}
public Group() {
@@ -55,13 +55,13 @@ public Group() {
}
public Group(String value, String display) {
- this(value, display, MembershipType.DIRECT);
+ this(value, display, Type.DIRECT);
}
- public Group(String value, String display, MembershipType type) {
+ public Group(String value, String display, Type type) {
this.value = value;
this.display = display;
- this.membershipType = type;
+ this.type = type;
}
public String getValue() {
@@ -86,7 +86,7 @@ public int hashCode() {
int result = 1;
result = prime * result + ((display == null) ? 0 : display.hashCode());
result = prime * result + ((value == null) ? 0 : value.hashCode());
- result = prime * result + ((membershipType == null) ? 0 : membershipType.hashCode());
+ result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
}
@@ -111,12 +111,12 @@ else if (!display.equals(other.display))
}
else if (!value.equals(other.value))
return false;
- return membershipType == other.membershipType;
+ return type == other.type;
}
@Override
public String toString() {
- return String.format("(id: %s, name: %s, type: %s)", value, display, membershipType);
+ return String.format("(id: %s, name: %s, type: %s)", value, display, type);
}
}
View
4 common/src/main/java/org/cloudfoundry/identity/uaa/scim/endpoints/ScimUserEndpoints.java
@@ -251,10 +251,10 @@ private ScimUser syncGroups(ScimUser user) {
indirectGroups.removeAll(directGroups);
Set<ScimUser.Group> groups = new HashSet<ScimUser.Group>();
for (ScimGroup group : directGroups) {
- groups.add(new ScimUser.Group(group.getId(), group.getDisplayName(), ScimUser.Group.MembershipType.DIRECT));
+ groups.add(new ScimUser.Group(group.getId(), group.getDisplayName(), ScimUser.Group.Type.DIRECT));
}
for (ScimGroup group : indirectGroups) {
- groups.add(new ScimUser.Group(group.getId(), group.getDisplayName(), ScimUser.Group.MembershipType.INDIRECT));
+ groups.add(new ScimUser.Group(group.getId(), group.getDisplayName(), ScimUser.Group.Type.INDIRECT));
}
user.setGroups(groups);
Please sign in to comment.
Something went wrong with that request. Please try again.