Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
5a41cc7d
Commit
5a41cc7d
authored
Dec 17, 2020
by
michael.simon
Browse files
Add Sorting to filtered IDP list from saml relying party
parent
ebc00058
Changes
1
Hide whitespace changes
Inline
Side-by-side
bwreg-service/src/main/java/edu/kit/scc/webreg/service/saml/FederationSingletonBean.java
View file @
5a41cc7d
...
...
@@ -99,7 +99,9 @@ public class FederationSingletonBean {
Invocable
invocable
=
(
Invocable
)
engine
;
invocable
.
invokeFunction
(
"filterIdps"
,
tempList
,
targetList
,
logger
);
Collections
.
sort
(
targetList
,
idpOrgComparator
);
return
targetList
;
}
catch
(
ScriptException
e
)
{
logger
.
warn
(
"Script execution failed."
,
e
);
...
...
@@ -114,18 +116,20 @@ public class FederationSingletonBean {
refreshCache
();
List
<
SamlIdpMetadataEntity
>
tempList
=
new
ArrayList
<
SamlIdpMetadataEntity
>(
idpMap
.
values
());
Collections
.
sort
(
tempList
,
new
Comparator
<
SamlIdpMetadataEntity
>()
{
@Override
public
int
compare
(
SamlIdpMetadataEntity
idp1
,
SamlIdpMetadataEntity
idp2
)
{
if
(
idp1
!=
null
&&
idp1
.
getOrgName
()
!=
null
&&
idp2
!=
null
&&
idp2
.
getOrgName
()
!=
null
)
return
idp1
.
getOrgName
().
compareTo
(
idp2
.
getOrgName
());
else
return
0
;
}
});
Collections
.
sort
(
tempList
,
idpOrgComparator
);
return
tempList
;
}
private
Comparator
<
SamlIdpMetadataEntity
>
idpOrgComparator
=
new
Comparator
<
SamlIdpMetadataEntity
>()
{
@Override
public
int
compare
(
SamlIdpMetadataEntity
idp1
,
SamlIdpMetadataEntity
idp2
)
{
if
(
idp1
!=
null
&&
idp1
.
getOrgName
()
!=
null
&&
idp2
!=
null
&&
idp2
.
getOrgName
()
!=
null
)
return
idp1
.
getOrgName
().
compareTo
(
idp2
.
getOrgName
());
else
return
0
;
}
};
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment