public void createWSFedProvider(String realm,String entityId,Map values) throws AMConsoleException {
  try {
    List<String> metaAliases=getFederationAlias(values,MetaTemplateParameters.P_WS_FED_ALIASES);
    Set<String> duplicateCheck=new HashSet<String>(metaAliases);
    if (duplicateCheck.size() < metaAliases.size()) {
      throw new AMConsoleException(getLocalizedString("federation.create.provider.duplicate.metaAlias"));
    }
    WSFederationMetaManager metaManager=new WSFederationMetaManager();
    metaManager.validateMetaAliasForNewEntity(realm,metaAliases);
    String metadata=CreateWSFedMetaDataTemplate.createStandardMetaTemplate(entityId,values,requestURL);
    String extendedData=CreateWSFedMetaDataTemplate.createExtendedMetaTemplate(entityId,values);
    FederationElement elt=(FederationElement)WSFederationMetaUtils.convertStringToJAXB(metadata);
    String federationID=elt.getFederationID();
    if (federationID == null) {
      federationID=WSFederationConstants.DEFAULT_FEDERATION_ID;
    }
    metaManager.createFederation(realm,elt);
    FederationConfigElement cfg=(FederationConfigElement)WSFederationMetaUtils.convertStringToJAXB(extendedData);
    metaManager.createEntityConfig(realm,cfg);
  }
 catch (  WSFederationMetaException ex) {
    throw new AMConsoleException(ex.getMessage());
  }
catch (  JAXBException ex) {
    throw new AMConsoleException(ex.getMessage());
  }
catch (  CertificateEncodingException ex) {
    throw new AMConsoleException(ex.getMessage());
  }
}

public void createWSFedProvider ( String realm , String entityId , Map values ) throws AMConsoleException { try { List < String > metaAliases = getFederationAlias ( values , MetaTemplateParameters . P_WS_FED_ALIASES ) ; Set < String > duplicateCheck = new HashSet < String > ( metaAliases ) ; if ( duplicateCheck . size ( ) < metaAliases . size ( ) ) { throw new AMConsoleException ( getLocalizedString ( "federation.create.provider.duplicate.metaAlias" ) ) ; } WSFederationMetaManager metaManager = new WSFederationMetaManager ( ) ; metaManager . validateMetaAliasForNewEntity ( realm , metaAliases ) ; String metadata = CreateWSFedMetaDataTemplate . createStandardMetaTemplate ( entityId , values , requestURL ) ; String extendedData = CreateWSFedMetaDataTemplate . createExtendedMetaTemplate ( entityId , values ) ; FederationElement elt = ( FederationElement ) WSFederationMetaUtils . convertStringToJAXB ( metadata ) ; String federationID = elt . getFederationID ( ) ; if ( federationID == null ) { federationID = WSFederationConstants . DEFAULT_FEDERATION_ID ; } metaManager . createFederation ( realm , elt ) ; FederationConfigElement cfg = ( FederationConfigElement ) WSFederationMetaUtils . convertStringToJAXB ( extendedData ) ; metaManager . createEntityConfig ( realm , cfg ) ; } catch ( WSFederationMetaException ex ) { throw new AMConsoleException ( ex . getMessage ( ) ) ; } catch ( JAXBException ex ) { throw new AMConsoleException ( ex . getMessage ( ) ) ; } catch ( CertificateEncodingException ex ) { throw new AMConsoleException ( ex . getMessage ( ) ) ; } }
creates a ws federation provider .
