AMServiceProfileModelImpl.java revision 8af80418ba1ec431c8027fa9668e5678658d3611
/**
* 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: AMServiceProfileModelImpl.java,v 1.3 2008/06/25 05:42:50 qcheng Exp $
*
*/
/* - LOG COMPLETE - */
public class AMServiceProfileModelImpl
extends AMModelBase
implements AMServiceProfileModel
{
protected PropertyXMLBuilder xmlBuilder;
static {
}
protected String serviceName;
/**
* Creates a simple model using default resource bundle.
*
* @param req HTTP Servlet Request
* @param serviceName Name of Service.
* @param map of user information
*/
public AMServiceProfileModelImpl(
) throws AMConsoleException {
this.serviceName = serviceName;
try {
xmlBuilder = new PropertyXMLBuilder(
serviceName, getDisplaySchemaTypes(), this);
{
}
} catch (SMSException e) {
throw new AMConsoleException(getErrorString(e));
} catch (SSOException e) {
throw new AMConsoleException(getErrorString(e));
}
}
public Set getDisplaySchemaTypes() {
return DISPLAY_SCHEMA_TYPES;
}
/**
* Returns page title.
*
* @return page title.
*/
public String getPageTitle() {
return getLocalizedServiceName(serviceName);
}
protected ServiceSchemaManager getServiceSchemaManager() {
return xmlBuilder.getServiceSchemaManager();
}
/**
* Returns the XML for property sheet view component.
*
* @param realmName Name of Realm.
* @param viewbeanClassName Class Name of View Bean.
* @param serviceName Name of Service.
* @return the XML for property sheet view component.
* @throws AMConsoleException if XML cannot be created.
*/
public String getPropertySheetXML(
) throws AMConsoleException {
if (!canModify) {
}
try {
/*
* the location needs to be set in order for the page to be
* constructed correctly. Some choice value components can have
* their values built based on the realm.
*/
} catch (SMSException e) {
throw new AMConsoleException(getErrorString(e));
} catch (SSOException e) {
throw new AMConsoleException(getErrorString(e));
}
}
/**
* Returns attributes values.
*
* @return attributes values.
*/
public Map getAttributeValues() {
) {
{
}
}
}
return values;
}
/**
* Returns attribute values.
*
* @param name Name of attribute.
* @return attribute values.
*/
boolean found = false;
found = true;
}
}
if (found) {
} else {
}
}
/**
* Set attribute values.
*
* @param map Map of attribute name to Set of attribute values.
* @throws AMConsoleException if values cannot be set.
*/
throws AMConsoleException
{
// Need to find the service schema for each attributeSchema
if (m == null) {
m = new HashMap();
}
}
}
if (!mapSvcSchemaToMapNameToValues.isEmpty()) {
i.hasNext();
) {
}
}
}
throws AMConsoleException
{
try {
} catch (SMSException e) {
logEvent("SMS_EXCEPTION_WRITE_GLOBAL_DEFAULT_ATTRIBUTE_VALUES",
paramsEx);
throw new AMConsoleException(getErrorString(e));
} catch (SSOException e) {
logEvent("SSO_EXCEPTION_WRITE_GLOBAL_DEFAULT_ATTRIBUTE_VALUES",
paramsEx);
throw new AMConsoleException(getErrorString(e));
}
}
/**
* Dervive classes can overwrite this method to add more attribute schema
* for modifying the discovery service.
*
* @param attributeSchemas Set of attribute schemas for modification.
*/
}
/**
* Returns properties view bean URL for an attribute schema.
*
* @param name Name of attribute schema.
* @return properties view bean URL for an attribute schema.
*/
) {
}
}
return url;
}
}