public ClaimMapping[] getAllSupportedClaimMappings(String dialectUri)
throws Exception {
ClaimMapping[] claimMappings = new ClaimMapping[0];
ClaimMapping claimMapping = null;
Claim[] claims = null;
ClaimManager claimManager = null;
try {
UserRealm realm = getRealm();
claimManager = realm.getClaimManager();
if (claimManager == null) {
// There can be cases - we get a request for an external user store - where we don'
// have a claims administrator.
return new ClaimMapping[0];
}
claims = getAllSupportedClaims(dialectUri);
if (claims != null && claims.length > 0) {
claimMappings = new ClaimMapping[claims.length];
for (int i = 0; i < claims.length; i++) {
claimMapping = new ClaimMapping(null, null);
claimMapping.setClaim(claims[i]);
claimMapping.setMappedAttribute(claimManager.getAttributeName(claims[i]
.getClaimUri()));
claimMappings[i] = claimMapping;
}
}