use of com.sun.identity.console.session.model.SMSessionCache in project OpenAM by OpenRock.
the class SMProfileViewBean method beginDisplay.
/**
* Sets the required information to display the page.
*
* @param event display event.
* @throws ModelControlException if problem access value of component.
*/
public void beginDisplay(DisplayEvent event) throws ModelControlException {
if (validSession) {
super.beginDisplay(event);
SMProfileModel model = (SMProfileModel) getModel();
Map map = model.getServerNames();
OptionList optList = new OptionList();
CCDropDownMenu child = (CCDropDownMenu) getChild(CHILD_SERVER_NAME_MENU);
String value = (String) child.getValue();
if (map != null && !map.isEmpty()) {
for (Iterator iter = map.keySet().iterator(); iter.hasNext(); ) {
String str = (String) iter.next();
String val = (String) map.get(str);
optList.add(str, val);
if (value == null) {
child.setValue(val);
}
}
}
child.setOptions(optList);
value = (String) child.getValue();
model.setProfileServerName(value);
SMSessionCache cache = null;
try {
cache = model.getSessionCache(getFilterString());
if (cache != null) {
populateTableModel(cache.getSessions());
String errorMessage = cache.getErrorMessage();
if (errorMessage != null && errorMessage.length() > 0) {
setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", errorMessage);
}
}
} catch (AMConsoleException ae) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ae.getMessage());
}
if (cache == null) {
populateTableModel(Collections.EMPTY_LIST);
}
setPageSessionAttribute(SERVER_NAME, value);
// Set our Sub-Tabs
addSessionsTab(model, 1);
// Both the SFO is Enabled and Repository Type has been Specified for view of HA Tabs.
if ((!SystemPropertiesManager.get(CoreTokenConstants.IS_SFO_ENABLED, "false").equalsIgnoreCase("true")) && (SystemPropertiesManager.get(CoreTokenConstants.SYS_PROPERTY_SESSION_HA_REPOSITORY_TYPE, "None").equalsIgnoreCase("None"))) {
removeSessionsTab();
}
}
}
Aggregations