code: private Map<String, String> getMapping() {
      if (this.attributesMapping != null && this.lastReload != null && this.lastReload.equals(this.attributeResolverService
        .getLastSuccessfulReloadInstant())) {
        return this.attributesMapping;
      }
      // Reload.
      ServiceableComponent<AttributeResolver> component = null;
      Map<String, String> am = null;
      try {
        // Get date before we get the component. That way we'll not leak changes.
        final DateTime when = this.attributeResolverService.getLastSuccessfulReloadInstant();
        component = this.attributeResolverService.getServiceableComponent();
        if (null == component) {
          if (!captiveServiceReloadFailed) {
            logger.error("Invalid AttributeResolver configuration");
          }
          captiveServiceReloadFailed = true;
        }
        else {
          final AttributeResolver attributeResolver = component.getComponent();
          am = new HashMap<>();
  
          Map<String, AttributeDefinition> map = attributeResolver.getAttributeDefinitions();
          for (Map.Entry<String, AttributeDefinition> entry : map.entrySet()) {
            String name = null;
            Set<AttributeEncoder<?>> encoders = entry.getValue().getAttributeEncoders();
            for (AttributeEncoder<?> encoder : encoders) {
              if (encoder instanceof SAML2AttributeEncoder) {
                name = ((SAML2AttributeEncoder<?>) encoder).getName();
                if (name != null) {
                  break;
                }
              }
            }
            if (name != null) {
              logger.debug("Adding mapping between SAML2 attribute '{}' and id '{}'", name, entry.getKey());
              am.put(name, entry.getKey());
            }
            else {
              logger.debug("No mapping to SAML2 attribute for attribute id '{}'", entry.getKey());
            }
          }
  
          captiveServiceReloadFailed = false;
          lastReload = when;
        }
      }
      finally {
        if (null != component) {
          component.unpinComponent();
        }
      }
  
      this.attributesMapping = am;
      return am;
    }
docs: Returns the mapping between attribute names and their Shibboleth ID:s.
  
  @return a mapping