/** * @param artifact * @return */ private RoleDescriptor resolvePeerRoleDescriptor(SAML2Artifact artifact) throws MessageDecodingException { CriteriaSet criteriaSet = new CriteriaSet( new ArtifactCriterion(artifact), new ProtocolCriterion(SAMLConstants.SAML20P_NS), new EntityRoleCriterion(getPeerEntityRole())); try { return roleDescriptorResolver.resolveSingle(criteriaSet); } catch (ResolverException e) { throw new MessageDecodingException("Error resolving peer entity RoleDescriptor", e); } }
/** {@inheritDoc} */ @Nullable public Set<MetadataIndexKey> generateKeys(@Nonnull CriteriaSet criteriaSet) { Constraint.isNotNull(criteriaSet, "CriteriaSet was null"); ArtifactCriterion artifactCrit = criteriaSet.get(ArtifactCriterion.class); if (artifactCrit != null) { LazySet<MetadataIndexKey> results = new LazySet<>(); SAMLArtifact artifact = artifactCrit.getArtifact(); if (artifact instanceof SAMLSourceIDArtifact) { results.add(new ArtifactSourceIDMetadataIndexKey(((SAMLSourceIDArtifact)artifact).getSourceID())); } if (artifact instanceof SAMLSourceLocationArtifact) { results.add(new ArtifactSourceLocationMetadataIndexKey( ((SAMLSourceLocationArtifact)artifact).getSourceLocation())); } return results; } else { return null; } }