class SAML2HttpUrlMetadataGenerator extends BaseSAML2MetadataGenerator {
    @Getter
    private final URL metadataUrl;
    private final HttpClient httpClient;

    @Getter
    private float refreshDelayFactor = -1;
    @Getter
    @Setter
    private Duration maxRefreshDelay;
    @Getter
    @Setter
    private Duration minRefreshDelay;


    /** {@inheritDoc} */
    @Override
    protected AbstractMetadataResolver createMetadataResolver() throws Exception {
        val resolver = new HTTPMetadataResolver(httpClient, this.metadataUrl.toExternalForm());
        if (minRefreshDelay != null) {
            resolver.setMinRefreshDelay(minRefreshDelay);
        }
        if (maxRefreshDelay != null) {
            resolver.setMaxRefreshDelay(maxRefreshDelay);
        }
        if (refreshDelayFactor >= 0) {
            resolver.setRefreshDelayFactor(refreshDelayFactor);
        }
        return resolver;
    }

    /** {@inheritDoc} */
    @Override
    public boolean storeMetadata(final String metadata, final boolean force) throws Exception {<FILL_FUNCTION_BODY>}
}

        HttpResponse response = null;

        try {
            logger.debug("Posting metadata to {}", this.metadataUrl.toURI());

            val httpPost = new HttpPost(this.metadataUrl.toURI());
            httpPost.addHeader("Accept", ContentType.APPLICATION_XML.getMimeType());
            httpPost.addHeader("Content-Type", ContentType.APPLICATION_XML.getMimeType());
            httpPost.setEntity(new StringEntity(metadata, ContentType.APPLICATION_XML));

            response = httpClient.execute(httpPost);
            if (response != null) {
                val code = response.getCode();
                if (code == HttpStatus.SC_NOT_IMPLEMENTED) {
                    logger.info("Storing metadata is not supported/implemented by {}", metadataUrl);
                    return false;
                }
                if (code == HttpStatus.SC_OK || code == HttpStatus.SC_CREATED) {
                    logger.info("Successfully submitted metadata to {}", metadataUrl);
                    return true;
                }
            }
            logger.error("Unable to store metadata successfully via {}", metadataUrl.toExternalForm());
            return false;
        } finally {
            if (response != null && response instanceof CloseableHttpResponse) {
                ((CloseableHttpResponse) response).close();
            }
        }
    
<methods>public non-sealed void <init>() ,public org.opensaml.saml.saml2.metadata.EntityDescriptor buildEntityDescriptor() ,public org.opensaml.saml.metadata.resolver.MetadataResolver buildMetadataResolver() throws java.lang.Exception,public List<java.lang.String> getBlackListedSignatureSigningAlgorithms() ,public java.lang.String getMetadata(org.opensaml.saml.saml2.metadata.EntityDescriptor) throws java.lang.Exception,public List<java.lang.String> getSignatureAlgorithms() ,public List<java.lang.String> getSignatureReferenceDigestMethods() <variables>protected java.lang.String assertionConsumerServiceUrl,protected boolean authnRequestSigned,protected List<java.lang.String> blackListedSignatureSigningAlgorithms,protected final org.opensaml.core.xml.XMLObjectBuilderFactory builderFactory,private List<org.pac4j.saml.metadata.SAML2MetadataContactPerson> contactPersons,protected org.pac4j.saml.crypto.CredentialProvider credentialProvider,protected int defaultACSIndex,protected org.opensaml.xmlsec.SignatureSigningConfiguration defaultSignatureSigningConfiguration,protected java.lang.String entityId,protected final org.opensaml.xmlsec.algorithm.AlgorithmRegistry globalAlgorithmRegistry,protected final org.slf4j.Logger logger,protected final org.opensaml.core.xml.io.MarshallerFactory marshallerFactory,private org.pac4j.saml.metadata.SAML2MetadataSigner metadataSigner,private List<org.pac4j.saml.metadata.SAML2MetadataUIInfo> metadataUIInfos,protected java.lang.String nameIdPolicyFormat,protected java.lang.String requestInitiatorLocation,protected List<org.pac4j.saml.metadata.SAML2ServiceProviderRequestedAttribute> requestedAttributes,protected java.lang.String responseBindingType,protected boolean signMetadata,protected List<java.lang.String> signatureAlgorithms,protected List<java.lang.String> signatureReferenceDigestMethods,protected java.lang.String singleLogoutServiceUrl,private List<java.lang.String> supportedProtocols,protected boolean wantAssertionSigned