Search in sources :

Example 1 with STSHomeViewBeanModel

use of com.sun.identity.console.sts.model.STSHomeViewBeanModel in project OpenAM by OpenRock.

the class STSHomeViewBean method setRestSTSInstanceNamesInTable.

private void setRestSTSInstanceNamesInTable() {
    STSHomeViewBeanModel model = (STSHomeViewBeanModel) getModel();
    try {
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        populateRestSTSTableModel(model.getPublishedInstances(STSType.REST, curRealm));
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) STSHomeViewBeanModel(com.sun.identity.console.sts.model.STSHomeViewBeanModel)

Example 2 with STSHomeViewBeanModel

use of com.sun.identity.console.sts.model.STSHomeViewBeanModel in project OpenAM by OpenRock.

the class STSHomeViewBean method handleTblRestSTSInstancesButtonDeleteRequest.

public void handleTblRestSTSInstancesButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    CCActionTable table = (CCActionTable) getChild(TBL_REST_STS_INSTANCES);
    table.restoreStateData();
    Integer[] selected = tblModelRestSTSInstances.getSelectedRows();
    Set<String> instanceNames = new HashSet<>(selected.length);
    for (int i = 0; i < selected.length; i++) {
        tblModelRestSTSInstances.setRowIndex(selected[i].intValue());
        instanceNames.add((String) tblModelRestSTSInstances.getValue(TBL_REST_STS_INSTANCES_DATA_NAME));
    }
    try {
        STSHomeViewBeanModel model = (STSHomeViewBeanModel) getModel();
        model.deleteInstances(STSType.REST, instanceNames);
        if (selected.length == 1) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "rest.sts.home.instance.deleted");
        } else {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "rest.sts.home.instances.deleted");
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashSet(java.util.HashSet) STSHomeViewBeanModel(com.sun.identity.console.sts.model.STSHomeViewBeanModel)

Example 3 with STSHomeViewBeanModel

use of com.sun.identity.console.sts.model.STSHomeViewBeanModel in project OpenAM by OpenRock.

the class STSHomeViewBean method setSoapSTSInstanceNamesInTable.

private void setSoapSTSInstanceNamesInTable() {
    STSHomeViewBeanModel model = (STSHomeViewBeanModel) getModel();
    try {
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        populateSoapSTSTableModel(model.getPublishedInstances(STSType.SOAP, curRealm));
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) STSHomeViewBeanModel(com.sun.identity.console.sts.model.STSHomeViewBeanModel)

Example 4 with STSHomeViewBeanModel

use of com.sun.identity.console.sts.model.STSHomeViewBeanModel in project OpenAM by OpenRock.

the class STSHomeViewBean method handleTblSoapSTSInstancesButtonDeleteRequest.

public void handleTblSoapSTSInstancesButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    CCActionTable table = (CCActionTable) getChild(TBL_SOAP_STS_INSTANCES);
    table.restoreStateData();
    Integer[] selected = tblModelSoapSTSInstances.getSelectedRows();
    Set<String> instanceNames = new HashSet<>(selected.length);
    for (int i = 0; i < selected.length; i++) {
        tblModelSoapSTSInstances.setRowIndex(selected[i].intValue());
        instanceNames.add((String) tblModelSoapSTSInstances.getValue(TBL_SOAP_STS_INSTANCES_DATA_NAME));
    }
    try {
        STSHomeViewBeanModel model = (STSHomeViewBeanModel) getModel();
        model.deleteInstances(STSType.SOAP, instanceNames);
        if (selected.length == 1) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "rest.sts.home.instance.deleted");
        } else {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "rest.sts.home.instances.deleted");
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashSet(java.util.HashSet) STSHomeViewBeanModel(com.sun.identity.console.sts.model.STSHomeViewBeanModel)

Aggregations

AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)4 STSHomeViewBeanModel (com.sun.identity.console.sts.model.STSHomeViewBeanModel)4 CCActionTable (com.sun.web.ui.view.table.CCActionTable)2 HashSet (java.util.HashSet)2