public void createSAMLv2Provider(String realm,String entityId,Map values) throws AMConsoleException {
  try {
    List<String> metaAliases=getFederationAlias(values,MetaTemplateParameters.P_SAML_ALIASES);
    Set<String> duplicateCheck=new HashSet<String>(metaAliases);
    if (duplicateCheck.size() < metaAliases.size()) {
      throw new AMConsoleException(getLocalizedString("federation.create.provider.duplicate.metaAlias"));
    }
    SAML2MetaManager mgr=new SAML2MetaManager();
    mgr.validateMetaAliasForNewEntity(realm,metaAliases);
    String metadata=CreateSAML2HostedProviderTemplate.buildMetaDataTemplate(entityId,values,requestURL);
    String extendedData=CreateSAML2HostedProviderTemplate.createExtendedDataTemplate(entityId,values,requestURL);
    ImportSAML2MetaData.importData(realm,metadata,extendedData);
  }
 catch (  WorkflowException ex) {
    throw new AMConsoleException(getErrorString(ex));
  }
catch (  SAML2MetaException ex) {
    throw new AMConsoleException(getErrorString(ex));
  }
}

public void createSAMLv2Provider ( String realm , String entityId , Map values ) throws AMConsoleException { try { List < String > metaAliases = getFederationAlias ( values , MetaTemplateParameters . P_SAML_ALIASES ) ; Set < String > duplicateCheck = new HashSet < String > ( metaAliases ) ; if ( duplicateCheck . size ( ) < metaAliases . size ( ) ) { throw new AMConsoleException ( getLocalizedString ( "federation.create.provider.duplicate.metaAlias" ) ) ; } SAML2MetaManager mgr = new SAML2MetaManager ( ) ; mgr . validateMetaAliasForNewEntity ( realm , metaAliases ) ; String metadata = CreateSAML2HostedProviderTemplate . buildMetaDataTemplate ( entityId , values , requestURL ) ; String extendedData = CreateSAML2HostedProviderTemplate . createExtendedDataTemplate ( entityId , values , requestURL ) ; ImportSAML2MetaData . importData ( realm , metadata , extendedData ) ; } catch ( WorkflowException ex ) { throw new AMConsoleException ( getErrorString ( ex ) ) ; } catch ( SAML2MetaException ex ) { throw new AMConsoleException ( getErrorString ( ex ) ) ; } }
creates a samlv2 provider .
