FederationViewBean.java revision 4a2f0f0be43dfd4c1b490cbf3cc48b6ba6084b1c
/**
* 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
* 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 $
*
*/
public class FederationViewBean
extends AMPrimaryMastHeadViewBean {
public static final String DEFAULT_DISPLAY_URL =
private boolean tablePopulated = false;
private boolean initialized = false;
private AMPropertySheetModel propertySheetModel;
// cot table properties
// entity table properties
// SAML Configuration table
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");
}
protected void initialize () {
if (!initialized) {
initialized = true;
super.initialize ();
createCOTTable ();
createSAMLTable ();
registerChildren ();
}
}
protected void registerChildren () {
super.registerChildren ();
propertySheetModel.registerChildren (this);
}
if (!tablePopulated) {
populateCOTTable ();
}
} else {
}
return view;
}
throws ModelControlException {
super.beginDisplay (event);
resetButtonState ("deleteCOTButton");
resetButtonState ("deleteEntityButton");
resetButtonState ("deleteTPButton");
populateCOTTable ();
}
}
protected AMModel getModelInternal () {
}
private EntityModel getEntityModel () {
}
private AMModel getSAMLModel () {
}
private void populateSAMLTable () {
tablePopulated = true;
boolean firstEntry = true;
int counter = 0;
if (!firstEntry) {
} else {
firstEntry = false;
}
if (partnerName == null) {
}
// get trusted partner type
new StringBuffer ();
for (int i=0;i<size;i++) {
"destination")) {
}
} else { // source
}
}
}
}
break;
}
}
}
"saml.profile.trustedPartners.selectType.profile.artifact.label");
"saml.profile.trustedPartners.selectType.profile.post.label");
"saml.profile.trustedPartners.selectType.profile.soap.label");
}
return ret;
}
private void populateEntityTable() {
tablePopulated=true;
boolean firstRow = true;
try {
firstRow = false;
}
firstRow = false;
}
firstRow = false;
}
// set the instances in the page session so when a request comes
// in we can prepopulate the table model.
} catch (AMConsoleException e) {
return;
}
}
private void addRows (
boolean firstRow,
) {
if (!firstRow) {
} else {
firstRow = false;
}
try {
"affiliate" );
} else {
location+".label");
}
} catch (AMConsoleException e) {
}
}
}
private void populateCOTTable () {
tablePopulated=true;
tableModel.clearAll ();
if ((circleOfTrustDescriptors != null)
&& (!circleOfTrustDescriptors.isEmpty ()))
{
boolean first = true;
{
if (first) {
first = false;
} else {
}
}
} else {
}
// get realm name
// get cot status
} else {
}
}
} else {
}
}
private void createPropertyModel () {
}
/*
* Responsible for creating the circle of trust table.
*/
private void createCOTTable () {
"com/sun/identity/console/cotTable.xml"));
}
/*
* Responsible for creating the entity table.
*/
private void createEntityTable () {
"com/sun/identity/console/entityTable.xml"));
"addEntityButton", "entity.new.button");
"deleteEntityButton", "entity.delete.button");
"importEntityButton", "entity.import.button");
"entityNameColumn", "entity.name.column.label");
"roleColumn", "entity.role.column.label");
"protocolColumn", "entity.protocol.column.label");
"locationColumn", "entity.location.column.label");
"realmColumn", "entity.realm.column.label");
}
/*
* Responsible for creating the entity table.
*/
private void createSAMLTable () {
"com/sun/identity/console/samlTable.xml"));
"saml.name.column.label");
"saml.trusted.partner.source.column.label");
"saml.trusted.partner.destination.column.label");
}
/*****************************************************************
*
* 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.
*/
unlockPageTrail ();
}
/**
* 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.
*/
throws ModelControlException {
tbl.restoreStateData ();
// get selected rows here
}
try {
"saml.message.trusted.partner.deleted");
} else {
"saml.message.trusted.partner.deleted.pural");
}
} catch (AMConsoleException e) {
e.getMessage ());
}
forwardTo ();
}
getViewBean (FSSAMLServiceViewBean.class);
unlockPageTrail ();
}
public void handleTrustedPartnerHrefRequest (
) throws ModelControlException {
strValue);
FSSAMLTrustedPartnersEditViewBean.class) ;
unlockPageTrail ();
}
/*****************************************************************
*
* Circle of Trust Event Handlers
*
*****************************************************************/
unlockPageTrail ();
}
throws ModelControlException {
tbl.restoreStateData ();
// get selected rows
// each COT is deleted separately as they can be in separate realms
try {
}
} catch (AMConsoleException e) {
}
}
}
params));
}
params));
}
}
forwardTo ();
}
throws ModelControlException {
getViewBean (FSAuthDomainsEditViewBean.class);
unlockPageTrail ();
}
/*****************************************************************
*
* Entity Event handlers
*
******************************************************************/
// TBD enable when CreateEntityViewBean is done.
// CreateEntityViewBean vb = (CreateEntityViewBean)
// getViewBean(CreateEntityViewBean.class);
//
// vb.forwardTo(getRequestContext());
}
getViewBean (ImportEntityViewBean.class);
unlockPageTrail ();
}
throws ModelControlException {
try {
}catch (AMConsoleException e) {
}
}
finalStr);
forwardTo();
}
private String printDeleteMessage(
) {
}
}
params));
}
}
}
params));
}
}
// store the current selected tab in the page session
}
} else {
forwardTo();
}
}
/*
* This handler is called when the dropdown menu is invoked in the
* entity provider table. The value in the <code>actionMenu</code>
* field is the value selected and dictates what action should be
* taken.
*/
// use the action value to determine which view we will forward to
forwardTo ();
}
} else if (strViewBean.equals(
vb = (SAMLv2PDPViewBean)
getViewBean(SAMLv2PDPViewBean.class);
} else if (strViewBean.equals(
vb = (SAMLv2PEPViewBean)
getViewBean(SAMLv2PEPViewBean.class);
getViewBean(SAMLv2AttrQueryViewBean.class);
getViewBean(SAMLv2AffiliateViewBean.class);
}
return vb;
}
vb = (IDFFSPViewBean)
getViewBean(IDFFSPViewBean.class);
vb = (IDFFIDPViewBean)
getViewBean(IDFFIDPViewBean.class);
getViewBean(IDFFAffiliateViewBean.class);
}
return vb;
}
}