/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved * * The contents of this file are subject to the terms * of the Common Development and Distribution License * (the License). You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * https://opensso.dev.java.net/public/CDDLv1.0.html or * opensso/legal/CDDLv1.0.txt * See the License for the specific language governing * permission and limitations under the License. * * When distributing Covered Code, include this CDDL * Header Notice in each file and include the License file * at opensso/legal/CDDLv1.0.txt. * If applicable, add the following below the CDDL Header, * with the fields enclosed by brackets [] replaced by * your own identifying information: * "Portions Copyrighted [year] [name of copyright owner]" * * $Id: FederationViewBean.java,v 1.27 2010/01/07 19:11:12 asyhuang Exp $ * * Portions Copyrighted 2012-2016 ForgeRock AS. * Portions Copyrighted 2012 Open Source Solution Technology Corporation */ package com.sun.identity.console.federation; import com.iplanet.jato.model.ModelControlException; import com.iplanet.jato.RequestManager; import com.iplanet.jato.RequestContext; import com.iplanet.jato.view.View; import com.iplanet.jato.view.event.DisplayEvent; import com.iplanet.jato.view.event.RequestInvocationEvent; import com.iplanet.jato.view.html.OptionList; import com.sun.identity.console.base.AMPipeDelimitAttrTokenizer; import com.sun.identity.console.base.AMPropertySheet; import com.sun.identity.console.base.AMPrimaryMastHeadViewBean; import com.sun.identity.console.base.model.AMAdminConstants; import com.sun.identity.console.base.model.AMAdminUtils; import com.sun.identity.console.base.model.AMConsoleException; import com.sun.identity.console.base.model.AMModel; import com.sun.identity.console.base.model.AMModelBase; import com.sun.identity.console.base.model.AMPropertySheetModel; import com.sun.identity.console.components.view.html.SerializedField; import com.sun.identity.console.federation.model.EntityModel; import com.sun.identity.console.federation.model.EntityModelImpl; import com.sun.identity.console.federation.model.FSAuthDomainsModel; import com.sun.identity.console.federation.model.FSAuthDomainsModelImpl; import com.sun.identity.console.federation.model.FSSAMLServiceModel; import com.sun.identity.console.federation.model.FSSAMLServiceModelImpl; import com.sun.identity.cot.CircleOfTrustDescriptor; import com.sun.identity.saml.common.SAMLConstants; import com.sun.identity.shared.datastruct.OrderedSet; import com.sun.web.ui.model.CCActionTableModel; import com.sun.web.ui.view.alert.CCAlert; import com.sun.web.ui.view.table.CCActionTable; import java.io.Serializable; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.owasp.esapi.ESAPI; import org.owasp.esapi.Encoder; import javax.servlet.http.HttpServletRequest; public class FederationViewBean extends AMPrimaryMastHeadViewBean { public static final String DEFAULT_DISPLAY_URL = "/console/federation/Federation.jsp"; public static final String MESSAGE_TEXT = "displayMessage"; protected static final String PROPERTY_ATTRIBUTE = "propertyAttributes"; private boolean tablePopulated = false; private boolean initialized = false; private AMPropertySheetModel propertySheetModel; // cot table properties private static final String COT_TABLE = "cotTable"; private static final String COT_NAME_VALUE = "cotNameValue"; private static final String COT_NAME_HREF = "cotNameHref"; private static final String COT_ENTITY_VALUE = "cotEntityValue"; private static final String COT_REALM_VALUE = "cotRealmValue"; private static final String COT_STATUS_VALUE = "statusValue"; // entity table properties private static final String ENTITY_TABLE = "entityTable"; private static final String ENTITY_NAME_VALUE = "entityNameValue"; private static final String ENTITY_NAME_HREF = "entityNameHref"; private static final String ENTITY_PROTOCOL_VALUE = "protocolValue"; private static final String ENTITY_ROLE_VALUE = "roleValue"; private static final String ENTITY_LOCATION_VALUE = "locationValue"; private static final String ENTITY_REALM_VALUE = "entityRealmValue"; // SAML Configuration table private static final String SAML_TABLE = "samlTable"; protected static final String TABLE_TRUSTED_PARTNERS = "iplanet-am-saml-partner-urls"; private static final String SAML_TRUSTED_PARTNER_VALUE = "trustedPartnerValue"; private static final String SAML_TRUSTED_PARTNER_HREF = "trustedPartnerHref"; protected static final String SAML_TABLE_ATTRIBUTE = "samlPropertyAttributes"; protected static final String SAML_TRUSTED_PARTNER_DESTINATION_TYPE = "trustedPartnerDestinationType"; protected static final String SAML_TRUSTED_PARTNER_SOURCE_TYPE = "trustedPartnerSourceType"; /** * Creates a authentication domains view bean. */ public FederationViewBean () { super ("Federation"); setDefaultDisplayURL (DEFAULT_DISPLAY_URL); } protected void initialize () { if (!initialized) { initialized = true; super.initialize (); createPropertyModel (); createCOTTable (); createEntityTable (); createSAMLTable (); registerChildren (); } } protected void registerChildren () { super.registerChildren (); registerChild (PROPERTY_ATTRIBUTE, AMPropertySheet.class); propertySheetModel.registerChildren (this); } protected View createChild (String name) { if (!tablePopulated) { populateCOTTable (); populateEntityTable (); populateSAMLTable (); } View view = null; if (name.equals (PROPERTY_ATTRIBUTE)) { view = new AMPropertySheet (this, propertySheetModel, name); } else if (propertySheetModel.isChildSupported (name)) { view = propertySheetModel.createChild (this, name, getModel ()); } else { view = super.createChild (name); } return view; } public void beginDisplay (DisplayEvent event) throws ModelControlException { super.beginDisplay (event); setSelectedTabNode(getCurrentRealm()); String id = (String)getPageSessionAttribute(getTrackingTabIDName()); setPageSessionAttribute(AMAdminConstants.PREVIOUS_TAB_ID, id); resetButtonState ("deleteCOTButton"); resetButtonState ("deleteEntityButton"); resetButtonState ("deleteTPButton"); AMPropertySheet ps = (AMPropertySheet)getChild (PROPERTY_ATTRIBUTE); populateCOTTable (); populateEntityTable (); populateSAMLTable (); String msg = (String)removePageSessionAttribute(MESSAGE_TEXT); if (msg != null) { setInlineAlertMessage( CCAlert.TYPE_INFO, "message.information", msg); } } protected AMModel getModelInternal () { HttpServletRequest req = getRequestContext ().getRequest (); return new FSAuthDomainsModelImpl (req, getPageSessionAttributes ()); } private EntityModel getEntityModel () { RequestContext rc = RequestManager.getRequestContext (); HttpServletRequest req = rc.getRequest (); return new EntityModelImpl (req, getPageSessionAttributes () ); } private AMModel getSAMLModel () { HttpServletRequest req = getRequestContext ().getRequest (); return new FSSAMLServiceModelImpl (req, getPageSessionAttributes ()); } private void populateSAMLTable () { tablePopulated = true; FSSAMLServiceModel model = (FSSAMLServiceModel)getSAMLModel (); Map attrValues = model.getAttributeValues (); CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel (SAML_TABLE); tblModel.clearAll (); removePageSessionAttribute (SAML_TABLE_ATTRIBUTE); List cache = new ArrayList (); for (Iterator iter = attrValues.keySet().iterator(); iter.hasNext(); ) { String name = (String)iter.next (); Set values = (Set)attrValues.get (name); if (name.equals (TABLE_TRUSTED_PARTNERS)) { AMPipeDelimitAttrTokenizer tokenizer = AMPipeDelimitAttrTokenizer.getInstance (); boolean firstEntry = true; int counter = 0; for (Iterator iter2 = values.iterator (); iter2.hasNext (); ) { if (!firstEntry) { tblModel.appendRow (); } else { firstEntry = false; } String tokenizedValue = (String)iter2.next (); Map map = AMAdminUtils.upCaseKeys ( tokenizer.tokenizes (tokenizedValue)); String partnerName = (String)map.get(SAMLConstants.PARTNERNAME); if (partnerName == null) { partnerName = (String)map.get(SAMLConstants.SOURCEID); } tblModel.setValue (SAML_TRUSTED_PARTNER_VALUE, partnerName); tblModel.setValue (SAML_TRUSTED_PARTNER_HREF, Integer.toString (counter++)); cache.add (tokenizedValue); // get trusted partner type SAMLPropertyXMLBuilder builder = SAMLPropertyXMLBuilder.getInstance (); List profiles = (ArrayList)builder.getSAMLProperties (map); StringBuffer trustedPartnerSourceType = new StringBuffer (); StringBuffer trustedPartnerDestinationType = new StringBuffer (); int size = profiles.size (); for (int i=0;i"); } tableModel.setValue(COT_ENTITY_VALUE, sb.toString()); } else { tableModel.setValue(COT_ENTITY_VALUE, ""); } // get realm name String realm = desc.getCircleOfTrustRealm(); tableModel.setValue(COT_REALM_VALUE, realm); // get cot status String status = desc.getCircleOfTrustStatus(); if((status !=null) && status.equals("active")){ tableModel.setValue (COT_STATUS_VALUE, "label.active"); } else { tableModel.setValue (COT_STATUS_VALUE, "label.inactive"); } cache.add (name + "," + realm); } szCache.setValue ((ArrayList)cache); } else { szCache.setValue (null); } } private void createPropertyModel () { propertySheetModel = new AMPropertySheetModel ( getClass().getClassLoader().getResourceAsStream ( "com/sun/identity/console/propertyFederationView.xml")); propertySheetModel.clear (); } /* * Responsible for creating the circle of trust table. */ private void createCOTTable () { CCActionTableModel tableModel = new CCActionTableModel ( getClass ().getClassLoader ().getResourceAsStream ( "com/sun/identity/console/cotTable.xml")); tableModel.setMaxRows (getModel ().getPageSize ()); tableModel.setTitleLabel ("label.items"); tableModel.setActionValue ("addCOTButton", "cot.new.button"); tableModel.setActionValue ("deleteCOTButton", "cot.delete.button"); tableModel.setActionValue ("cotNameColumn", "cot.name.column.label"); tableModel.setActionValue ("cotEntityColumn", "cot.entity.column.label"); tableModel.setActionValue ("realmColumn", "cot.realm.column.label"); tableModel.setActionValue ("statusColumn", "cot.status.column.label"); propertySheetModel.setModel (COT_TABLE, tableModel); } /* * Responsible for creating the entity table. */ private void createEntityTable () { CCActionTableModel tableModel = new CCActionTableModel( getClass().getClassLoader().getResourceAsStream( "com/sun/identity/console/entityTable.xml")); tableModel.setMaxRows(getModel().getPageSize()); tableModel.setTitleLabel("label.items"); tableModel.setActionValue( "addEntityButton", "entity.new.button"); tableModel.setActionValue( "deleteEntityButton", "entity.delete.button"); tableModel.setActionValue( "importEntityButton", "entity.import.button"); tableModel.setActionValue( "entityNameColumn", "entity.name.column.label"); tableModel.setActionValue( "roleColumn", "entity.role.column.label"); tableModel.setActionValue( "protocolColumn", "entity.protocol.column.label"); tableModel.setActionValue( "locationColumn", "entity.location.column.label"); tableModel.setActionValue( "realmColumn", "entity.realm.column.label"); propertySheetModel.setModel(ENTITY_TABLE, tableModel); } /* * Responsible for creating the entity table. */ private void createSAMLTable () { CCActionTableModel tableModel = new CCActionTableModel ( getClass ().getClassLoader ().getResourceAsStream ( "com/sun/identity/console/samlTable.xml")); tableModel.setMaxRows (getModel ().getPageSize ()); tableModel.setTitleLabel ("label.items"); tableModel.setActionValue ("addTPButton", "saml.new.button"); tableModel.setActionValue ("deleteTPButton", "saml.delete.button"); tableModel.setActionValue ("trustedPartnerColumn", "saml.name.column.label"); tableModel.setActionValue ("trustedPartnerSourceColumn", "saml.trusted.partner.source.column.label"); tableModel.setActionValue ("trustedPartnerDestinationColumn", "saml.trusted.partner.destination.column.label"); propertySheetModel.setModel (SAML_TABLE, tableModel); } /***************************************************************** * * SAML Event Handlers. * There are four events which may be generated from the SAML section. * For the trusted partners there are new, delete, and edit requests. * There is also a handler for editing the local properties. * *****************************************************************/ /** * Handles the new trusted partner request. There is no real processing * done here. We are just forwarding the request onto the view bean * which will do the real work. * * @param event Request Invocation Event. */ public void handleAddTPButtonRequest (RequestInvocationEvent event) { FSSAMLSelectTrustedPartnerTypeViewBean vb = (FSSAMLSelectTrustedPartnerTypeViewBean) getViewBean (FSSAMLSelectTrustedPartnerTypeViewBean.class); unlockPageTrail (); passPgSessionMap (vb); vb.forwardTo (getRequestContext ()); } /** * Handles the delete trusted partner request. The items which are * selected in the SAML table will be removed. After the processing is * complete a message will be displayed indicating the process succeeded, * or what failed if it didn't succeed. * * @param event Request Invocation Event. */ public void handleDeleteTPButtonRequest (RequestInvocationEvent event) throws ModelControlException { CCActionTable tbl = (CCActionTable)getChild (SAML_TABLE); tbl.restoreStateData (); CCActionTableModel tblModel = (CCActionTableModel) propertySheetModel.getModel (SAML_TABLE); // get selected rows here Integer[] selected = tblModel.getSelectedRows (); List currentList = (List) getPageSessionAttribute (SAML_TABLE_ATTRIBUTE); Set selectedSet = new HashSet (); for (int i = 0; i < selected.length; i++) { selectedSet.add (currentList.get (selected[i].intValue ())); } try { FSSAMLServiceModel model = (FSSAMLServiceModel)getSAMLModel (); model.deleteTrustPartners (selectedSet); if (selected.length == 1) { setInlineAlertMessage (CCAlert.TYPE_INFO, "message.information", "saml.message.trusted.partner.deleted"); } else { setInlineAlertMessage (CCAlert.TYPE_INFO, "message.information", "saml.message.trusted.partner.deleted.pural"); } } catch (AMConsoleException e) { setInlineAlertMessage (CCAlert.TYPE_ERROR, "message.error", e.getMessage ()); } forwardTo (); } public void handleLocalSitePropertiesRequest (RequestInvocationEvent event) { removePageSessionAttribute(PROPERTY_ATTRIBUTE); FSSAMLServiceViewBean vb = (FSSAMLServiceViewBean) getViewBean (FSSAMLServiceViewBean.class); unlockPageTrail (); passPgSessionMap (vb); vb.forwardTo (getRequestContext ()); } public void handleTrustedPartnerHrefRequest ( RequestInvocationEvent event ) throws ModelControlException { String idx = (String)getDisplayFieldValue (SAML_TRUSTED_PARTNER_HREF); List currentList = (List) getPageSessionAttribute (SAML_TABLE_ATTRIBUTE); String strValue = currentList.get (Integer.parseInt (idx)).toString (); Map values = AMPipeDelimitAttrTokenizer.getInstance ().tokenizes ( strValue); SAMLPropertyXMLBuilder builder = SAMLPropertyXMLBuilder.getInstance (); setPageSessionAttribute (FSSAMLTrustedPartnersViewBeanBase.PROFILES, (ArrayList)builder.getSAMLProperties (values)); FSSAMLTrustedPartnersViewBeanBase vb = (FSSAMLTrustedPartnersViewBeanBase)getViewBean ( FSSAMLTrustedPartnersEditViewBean.class) ; unlockPageTrail (); passPgSessionMap (vb); vb.populateValues (idx); vb.forwardTo (getRequestContext ()); } /***************************************************************** * * Circle of Trust Event Handlers * *****************************************************************/ public void handleAddCOTButtonRequest (RequestInvocationEvent event) { CreateCOTViewBean vb = (CreateCOTViewBean)getViewBean (CreateCOTViewBean.class); unlockPageTrail (); passPgSessionMap (vb); vb.forwardTo (getRequestContext ()); } public void handleDeleteCOTButtonRequest (RequestInvocationEvent event) throws ModelControlException { CCActionTable tbl = (CCActionTable)getChild (COT_TABLE); tbl.restoreStateData (); CCActionTableModel tableModel = (CCActionTableModel) propertySheetModel.getModel (COT_TABLE); // get selected rows Integer[] selected = tableModel.getSelectedRows (); SerializedField szCache = (SerializedField)getChild (SZ_CACHE); List list = (List)szCache.getSerializedObj (); FSAuthDomainsModel model = (FSAuthDomainsModel)getModel (); StringBuilder deletedNames = new StringBuilder(); StringBuilder cannotDeleteds = new StringBuilder(); // each COT is deleted separately as they can be in separate realms for ( int i = 0; i < selected.length; i++) { String str = (String)list.get (selected[i].intValue ()); int pipeIndex = str.indexOf (","); String name = str.substring (0, pipeIndex); String realm = str.substring (pipeIndex+1); try { model.deleteAuthenticationDomain (realm, name); if (deletedNames.length() > 0) { deletedNames.append(", "); } deletedNames.append(name); } catch (AMConsoleException e) { if (cannotDeleteds.length() > 0) { cannotDeleteds.append(", "); } cannotDeleteds.append(e.getMessage()); } } StringBuilder message = new StringBuilder(); if (deletedNames.length () > 0) { Object[] params = {deletedNames}; message.append(MessageFormat.format( model.getLocalizedString("authDomain.message.deleted"), params)); } if (cannotDeleteds.length() > 0) { Object[] params = {cannotDeleteds}; message.append(MessageFormat.format( model.getLocalizedString("generic.error.message"), params)); } if (message.length() > 0) { setInlineAlertMessage (CCAlert.TYPE_INFO, "message.information", message.toString ()); } forwardTo (); } public void handleCotNameHrefRequest (RequestInvocationEvent event) throws ModelControlException { String name = hexToString((String)getDisplayFieldValue(COT_NAME_HREF)); FSAuthDomainsEditViewBean vb = (FSAuthDomainsEditViewBean) getViewBean (FSAuthDomainsEditViewBean.class); unlockPageTrail (); passPgSessionMap (vb); vb.setPageSessionAttribute (FSAuthDomainsModel.TF_NAME, name); vb.forwardTo (getRequestContext ()); } /***************************************************************** * * Entity Event handlers * ******************************************************************/ public void handleAddEntityButtonRequest (RequestInvocationEvent event) { // TBD enable when CreateEntityViewBean is done. // CreateEntityViewBean vb = (CreateEntityViewBean) // getViewBean(CreateEntityViewBean.class); // // vb.forwardTo(getRequestContext()); } public void handleImportEntityButtonRequest (RequestInvocationEvent event) { ImportEntityViewBean vb = (ImportEntityViewBean) getViewBean (ImportEntityViewBean.class); unlockPageTrail (); passPgSessionMap (vb); vb.forwardTo (getRequestContext ()); } public void handleDeleteEntityButtonRequest(RequestInvocationEvent event) throws ModelControlException { CCActionTable table = (CCActionTable)getChild(ENTITY_TABLE); table.restoreStateData(); EntityModel model = getEntityModel(); CCActionTableModel cctablemodel = (CCActionTableModel) propertySheetModel.getModel(ENTITY_TABLE); List entitiesList = (ArrayList)getPageSessionAttribute(ENTITY_TABLE); Integer[] selected = cctablemodel.getSelectedRows(); List successList = new ArrayList(); List failureList = new ArrayList(); String name = null; for (int i = 0; i < selected.length; i++) { String selectedRow = (String)entitiesList.get(selected[i].intValue()); int pos = selectedRow.indexOf(","); name = selectedRow.substring(0, pos); String protStr = selectedRow.substring(pos+1); int posProtocol = protStr.indexOf(","); String protocol = protStr.substring(0, posProtocol); String realmStr = protStr.substring(posProtocol+1); int posrealm = realmStr.indexOf(","); String realm = realmStr.substring(0, posrealm); try { model.deleteEntities(name, protocol, realm); successList.add(name); }catch (AMConsoleException e) { failureList.add(name); } } String finalStr = printDeleteMessage(model, successList, failureList); setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", finalStr); forwardTo(); } private String printDeleteMessage( EntityModel model, List slist, List flist ) { StringBuilder buffer = new StringBuilder(); if ((slist != null) && !slist.isEmpty()) { StringBuilder buff = new StringBuilder(); for (String s : slist) { if (buff.length() > 0) { buff.append(", "); } buff.append(s); } Object[] params = {buff.toString()}; buffer.append(MessageFormat.format( model.getLocalizedString("entity.deleted.message"), params)); } if ((flist != null) && !flist.isEmpty()) { StringBuilder buff = new StringBuilder(); for (String s : flist) { if (buff.length() > 0) { buff.append(", "); } buff.append(s); } Object[] params = {buff.toString()}; buffer.append(MessageFormat.format( model.getLocalizedString("entity.deleted.failed.message"), params)); } return buffer.toString(); } public void handleEntityNameHrefRequest(RequestInvocationEvent event) { // store the current selected tab in the page session String id = (String)getPageSessionAttribute(getTrackingTabIDName()); setPageSessionAttribute(AMAdminConstants.PREVIOUS_TAB_ID, id); String tmp = hexToString( (String)getDisplayFieldValue(ENTITY_NAME_HREF)); int index = tmp.lastIndexOf(","); String location = tmp.substring(index+1); tmp = tmp.substring(0, index); index = tmp.lastIndexOf(","); String realm = tmp.substring(index+1); tmp = tmp.substring(0, index); index = tmp.indexOf(","); String protocol = tmp.substring(index + 1); String name = tmp.substring(0,index); EntityPropertiesBase vb = null; List roles = null; EntityModel eModel = (EntityModel) getEntityModel(); if (protocol.equals(EntityModel.SAMLV2)) { roles = eModel.getSAMLv2Roles(name, realm ); String strViewBean = (String)roles.get(0); vb = getSAMLv2ViewBean(strViewBean); } else if (protocol.equals(EntityModel.IDFF)) { roles = eModel.getIDFFRoles(name, realm ); String strViewBean = (String)roles.get(0); vb = getIDFFViewBean(strViewBean); } else if (protocol.equals(EntityModel.WSFED)) { vb = (WSFedGeneralViewBean)getViewBean(WSFedGeneralViewBean.class); } if (vb != null) { setPageSessionAttribute(EntityPropertiesBase.ENTITY_NAME, name); setPageSessionAttribute(EntityPropertiesBase.ENTITY_REALM, realm); setPageSessionAttribute( EntityPropertiesBase.ENTITY_LOCATION, location); unlockPageTrail(); passPgSessionMap(vb); vb.forwardTo(getRequestContext()); } else { setInlineAlertMessage(CCAlert.TYPE_ERROR, getModel().getLocalizedString("unknown.object.type.title"), getModel().getLocalizedString("unknown.object.type")); forwardTo(); } } /* * This handler is called when the dropdown menu is invoked in the * entity provider table. The value in the actionMenu * field is the value selected and dictates what action should be * taken. */ public void handleBtnSearchRequest (RequestInvocationEvent event) { // use the action value to determine which view we will forward to String actionValue = (String)getDisplayFieldValue ("actionMenu"); forwardTo (); } private EntityPropertiesBase getSAMLv2ViewBean(String strViewBean) { EntityPropertiesBase vb = null; if (strViewBean.equals(EntityModel.SERVICE_PROVIDER)) { vb = (SAMLv2SPAssertionContentViewBean) getViewBean(SAMLv2SPAssertionContentViewBean.class); } else if (strViewBean.equals(EntityModel.IDENTITY_PROVIDER)) { vb = (SAMLv2IDPAssertionContentViewBean) getViewBean(SAMLv2IDPAssertionContentViewBean.class); } else if (strViewBean.equals( EntityModel.POLICY_DECISION_POINT_DESCRIPTOR)) { vb = (SAMLv2PDPViewBean) getViewBean(SAMLv2PDPViewBean.class); } else if (strViewBean.equals( EntityModel.POLICY_ENFORCEMENT_POINT_DESCRIPTOR)) { vb = (SAMLv2PEPViewBean) getViewBean(SAMLv2PEPViewBean.class); } else if (strViewBean.equals(EntityModel.SAML_ATTRAUTHORITY)) { vb = (SAMLv2AttrAuthorityViewBean) getViewBean(SAMLv2AttrAuthorityViewBean.class); } else if (strViewBean.equals(EntityModel.SAML_AUTHNAUTHORITY)) { vb = (SAMLv2AuthnAuthorityViewBean) getViewBean(SAMLv2AuthnAuthorityViewBean.class); } else if (strViewBean.equals(EntityModel.SAML_ATTRQUERY)) { vb = (SAMLv2AttrQueryViewBean) getViewBean(SAMLv2AttrQueryViewBean.class); } else if (strViewBean.equals(EntityModel.AFFILIATE)) { vb = (SAMLv2AffiliateViewBean) getViewBean(SAMLv2AffiliateViewBean.class); } return vb; } private EntityPropertiesBase getIDFFViewBean(String strViewBean) { EntityPropertiesBase vb = null; if (strViewBean.equals(EntityModel.SERVICE_PROVIDER)) { vb = (IDFFSPViewBean) getViewBean(IDFFSPViewBean.class); } else if (strViewBean.equals(EntityModel.IDENTITY_PROVIDER)) { vb = (IDFFIDPViewBean) getViewBean(IDFFIDPViewBean.class); } else if (strViewBean.equals(EntityModel.AFFILIATE)) { vb = (IDFFAffiliateViewBean) getViewBean(IDFFAffiliateViewBean.class); } return vb; } }