File tree Expand file tree Collapse file tree
modules/apim-adapter/src/main/java/com/axway/apim Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,14 +17,16 @@ public User convert(User user) {
1717// if(user.getRole().equals("oadmin")) {
1818// orgName2Id.put(organization.getName(), organization.getId());
1919// }
20- for (Map .Entry <String ,String > entry : orgs2Role .entrySet ()){
21- String orgId = entry .getKey ();
22- String role = entry .getValue ();
23- if (role .equals ("oadmin" ) || role .equals ("admin" )){
24- orgName2Id .put (orgs2Name .get (orgId ), orgId );
20+ if (orgs2Role != null ) {
21+ for (Map .Entry <String , String > entry : orgs2Role .entrySet ()) {
22+ String orgId = entry .getKey ();
23+ String role = entry .getValue ();
24+ if (role .equals ("oadmin" ) || role .equals ("admin" )) {
25+ orgName2Id .put (orgs2Name .get (orgId ), orgId );
26+ }
2527 }
28+ user .setName2OrgId (orgName2Id );
2629 }
27- user .setName2OrgId (orgName2Id );
2830 return user ;
2931 }
3032}
Original file line number Diff line number Diff line change 1515
1616public class UserFilter implements CustomPropertiesFilter {
1717
18- public static enum USER_TYPE {
18+ public enum USER_TYPE {
1919 internal ,
2020 external
2121 }
@@ -36,7 +36,7 @@ public static enum USER_TYPE {
3636
3737 private List <String > customProperties ;
3838
39- private List <NameValuePair > filters = new ArrayList <NameValuePair >();
39+ private List <NameValuePair > filters = new ArrayList <>();
4040
4141 private UserFilter () { }
4242
@@ -170,7 +170,7 @@ public void setCustomProperties(List<String> customProperties) {
170170 public boolean equals (Object obj ) {
171171 if (obj == null ) return false ;
172172 if (this == obj ) return true ;
173- if (obj instanceof UserFilter == false ) return false ;
173+ if (!( obj instanceof UserFilter ) ) return false ;
174174 UserFilter other = (UserFilter )obj ;
175175 return (
176176 StringUtils .equals (other .getId (), this .getId ()) &&
@@ -229,7 +229,6 @@ public static class Builder {
229229
230230 private List <String > customProperties ;
231231
232- List <NameValuePair > filters = new ArrayList <NameValuePair >();
233232
234233 public Builder () {
235234 super ();
Original file line number Diff line number Diff line change 1717
1818@ JsonIgnoreProperties (ignoreUnknown = true )
1919@ JsonFilter ("UserFilter" )
20- // @JsonDeserialize(converter = UserOrgName2IdConverter.class)
20+ @ JsonDeserialize (converter = UserOrgName2IdConverter .class )
2121public class User implements CustomPropertiesEntity {
2222 String id ;
2323 @ JsonDeserialize (using = OrganizationDeserializer .class )
You can’t perform that action at this time.
0 commit comments