class IdpAuthnRequestGeneratorService {

    public SamlRequestDto generateSaml(IdaAuthnRequestFromHubDto idaAuthnRequestFromHubDto) {
        URI ssoUri = idpSingleSignOnServiceHelper.getSingleSignOn(idaAuthnRequestFromHubDto.getIdpEntityId());

        IdaAuthnRequestFromHub idaAuthnRequestFromHub = idaAuthnRequestTranslator.getIdaAuthnRequestFromHub(idaAuthnRequestFromHubDto, ssoUri, hubEntityId);

        String request = idaRequestStringTransformer.apply(idaAuthnRequestFromHub);
        return new SamlRequestDto(request, ssoUri);
    }

    @Inject public  IdpAuthnRequestGeneratorService(IdpSingleSignOnServiceHelper idpSingleSignOnServiceHelper,
                                           Function<IdaAuthnRequestFromHub, String> idaRequestStringTransformer,
                                           IdaAuthnRequestTranslator idaAuthnRequestTranslator,
                                           @Named("HubEntityId") String hubEntityId);

}