RestSTSEditViewBean.java revision 56f76965098d6cc3ae531ce0a73bda588abdf1d3
/*
* 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 legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at 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]".
*
* Copyright 2014 ForgeRock AS. All rights reserved.
*/
/**
* ViewBean invoked to edit an existing Rest STS instance. The AMServiceProfileViewBeanBase class is not extended here
* as for the RestSTSAddViewBean because the generic propertySheet constitution logic in the AMServiceProfileViewBeanBase
* class does not work for SubConfig state, which is where Rest STS instance state is stored.
*/
public class RestSTSEditViewBean extends AMPrimaryMastHeadViewBean {
protected CCPageTitleModel ptModel;
protected boolean submitCycle;
protected AMPropertySheetModel propertySheetModel;
public RestSTSEditViewBean() {
super("RestSTSEdit");
}
protected void initialize() {
super.initialize();
}
protected void registerChildren() {
super.registerChildren();
ptModel.registerChildren(this);
if (propertySheetModel != null) {
}
}
} else {
}
return view;
}
protected void createPageTitleModel() {
ptModel = new CCPageTitleModel(
}
protected void createPropertyModel() {
}
super.beginDisplay(event);
if (!submitCycle) {
try {
} catch (AMConsoleException e) {
throw new ModelControlException(e);
}
} else {
}
}
}
protected AMModel getModelInternal() {
try {
} catch (AMConsoleException e) {
throw new IllegalStateException("Exception getting model in RestSTSAddViewBean: " + e.getMessage(), e);
}
}
/**
* Handles save button request. Validates the rest sts configuration state, and invokes the model to publish a
* rest sts instance corresponding to this state.
* @param event Request invocation event
*/
submitCycle = true;
if (validationResponse.isSuccessful()) {
try {
RestSTSModelResponse creationResponse = model.updateInstance(configurationState, currentRealm, instanceName);
if (creationResponse.isSuccessful()) {
} else {
}
} catch (AMConsoleException e) {
throw new ModelControlException(e);
}
} else {
}
forwardTo();
}
/*
Returns a map of all settings, including those not changed from the default values in the model.
*/
try {
} catch (AMConsoleException e) {
throw new ModelControlException(e.getMessage(), e);
}
}
return values;
}
throws ModelControlException, AMConsoleException {
}
throw new AMConsoleException("No page session attribute corresponding to " + AMAdminConstants.SAVE_VB_NAME);
}
try {
} catch (ClassNotFoundException e) {
throw new AMConsoleException("Could not find class corresponding to class name "
+ name + ". Exception: " + e);
}
} else {
}
}
}