@ ReadOperation public Map < String , Object > getCachedMetadataObject ( final String serviceId , @ Nullable final String entityId ) { try { val registeredService = findRegisteredService ( serviceId ) ; val issuer = StringUtils . defaultIfBlank ( entityId , registeredService . getServiceId ( ) ) ; val criteriaSet = new CriteriaSet ( ) ; criteriaSet . add ( new EntityIdCriterion ( issuer ) ) ; criteriaSet . add ( new EntityRoleCriterion ( SPSSODescriptor . DEFAULT_ELEMENT_NAME ) ) ; val metadataResolver = cachingMetadataResolver . resolve ( registeredService , criteriaSet ) ; val iteration = metadataResolver . resolve ( criteriaSet ) . spliterator ( ) ; return StreamSupport . stream ( iteration , false ) . map ( entity -> Pair . of ( entity . getEntityID ( ) , SamlUtils . transformSamlObject ( openSamlConfigBean , entity ) . toString ( ) ) ) . collect ( Collectors . toMap ( Pair :: getLeft , Pair :: getRight ) ) ; } catch ( final Exception e ) { LOGGER . error ( e . getMessage ( ) , e ) ; return CollectionUtils . wrap ( "error" , e . getMessage ( ) ) ; } }
Gets cached metadata object .