class SwiftUrlProvider implements UrlProvider {

    protected DescriptiveUrlBag sign(final Region region, final Path file, final long expiry) {
        if(!accounts.containsKey(region)) {
            log.warn(String.format("No account info for region %s available required to sign temporary URL", region));
            return DescriptiveUrlBag.empty();
        }
        // OpenStack Swift Temporary URLs (TempURL) required the X-Account-Meta-Temp-URL-Key header
        // be set on the Swift account. Used to sign.
        final AccountInfo info = accounts.get(region);
        if(StringUtils.isBlank(info.getTempUrlKey())) {
            log.warn("Missing X-Account-Meta-Temp-URL-Key header value to sign temporary URL");
            return DescriptiveUrlBag.empty();
        }
        if(log.isInfoEnabled()) {
            log.info(String.format("Using X-Account-Meta-Temp-URL-Key header value %s to sign", info.getTempUrlKey()));
        }
        final String signature = this.sign(info.getTempUrlKey(),
                String.format("GET\n%d\n%s", expiry, String.format("%s/%s/%s",
                        region.getStorageUrl().getRawPath(),
                        URIEncoder.encode(containerService.getContainer(file).getName()),
                        containerService.getKey(file))));
        //Compile the temporary URL
        final DescriptiveUrlBag list = new DescriptiveUrlBag();
        for(Scheme scheme : Collections.singletonList(Scheme.valueOf(region.getStorageUrl().getScheme()))) {
            final int port = region.getStorageUrl().getPort();
            list.add(new DescriptiveUrl(URI.create(String.format("%s://%s%s%s?temp_url_sig=%s&temp_url_expires=%d",
                    scheme.name(), region.getStorageUrl().getHost(),
                    port == -1 ? StringUtils.EMPTY : port == scheme.getPort() ? StringUtils.EMPTY : String.format(":%d", port),
                    region.getStorageUrl(
                            containerService.getContainer(file).getName(), containerService.getKey(file)).getRawPath(), signature, expiry)),
                    DescriptiveUrl.Type.signed,
                    MessageFormat.format(LocaleFactory.localizedString("{0} URL"), LocaleFactory.localizedString("Pre-Signed", "S3"))
                            + " (" + MessageFormat.format(LocaleFactory.localizedString("Expires {0}", "S3") + ")",
                            UserDateFormatterFactory.get().getShortFormat(expiry * 1000))
            ));
        }
        return list;
    }

    public  SwiftUrlProvider(final SwiftSession session);
    public  SwiftUrlProvider(final SwiftSession session, final Map<Region, AccountInfo> accounts);
    public  SwiftUrlProvider(final SwiftSession session, final Map<Region, AccountInfo> accounts, final SwiftRegionService regionService);

}