Search in sources :

Example 86 with Server

use of com.sun.enterprise.config.serverbeans.Server in project Payara by payara.

the class SupportsUserManagementCommand method execute.

@Override
public void execute(AdminCommandContext context) {
    Config tmp = null;
    try {
        tmp = configs.getConfigByName(target);
    } catch (Exception ex) {
    }
    if (tmp != null) {
        config = tmp;
    }
    if (tmp == null) {
        Server targetServer = domain.getServerNamed(target);
        if (targetServer != null) {
            config = domain.getConfigNamed(targetServer.getConfigRef());
        }
        com.sun.enterprise.config.serverbeans.Cluster cluster = domain.getClusterNamed(target);
        if (cluster != null) {
            config = domain.getConfigNamed(cluster.getConfigRef());
        }
    }
    ActionReport report = context.getActionReport();
    report.setActionExitCode(ExitCode.SUCCESS);
    try {
        report.setMessage("" + supportsUserManagement(realmName));
    } catch (BadRealmException ex) {
        // throw new RuntimeException(ex);
        report.setFailureCause(ex);
        report.setActionExitCode(ExitCode.FAILURE);
    } catch (NoSuchRealmException ex) {
        // throw new RuntimeException(ex);
        report.setFailureCause(ex);
        report.setActionExitCode(ExitCode.FAILURE);
    } catch (Exception ex) {
        report.setFailureCause(ex);
        report.setActionExitCode(ExitCode.FAILURE);
    }
}
Also used : NoSuchRealmException(com.sun.enterprise.security.auth.realm.NoSuchRealmException) BadRealmException(com.sun.enterprise.security.auth.realm.BadRealmException) Server(com.sun.enterprise.config.serverbeans.Server) Config(com.sun.enterprise.config.serverbeans.Config) ActionReport(org.glassfish.api.ActionReport) BadRealmException(com.sun.enterprise.security.auth.realm.BadRealmException) NoSuchRealmException(com.sun.enterprise.security.auth.realm.NoSuchRealmException)

Aggregations

Server (com.sun.enterprise.config.serverbeans.Server)86 ActionReport (org.glassfish.api.ActionReport)27 Cluster (com.sun.enterprise.config.serverbeans.Cluster)26 Domain (com.sun.enterprise.config.serverbeans.Domain)16 Config (com.sun.enterprise.config.serverbeans.Config)15 ArrayList (java.util.ArrayList)12 DeploymentGroup (fish.payara.enterprise.config.serverbeans.DeploymentGroup)11 PropertyVetoException (java.beans.PropertyVetoException)11 Properties (java.util.Properties)10 TransactionFailure (org.jvnet.hk2.config.TransactionFailure)10 HashMap (java.util.HashMap)9 ApplicationRef (com.sun.enterprise.config.serverbeans.ApplicationRef)8 File (java.io.File)8 IOException (java.io.IOException)8 Test (org.junit.Test)8 Property (org.jvnet.hk2.config.types.Property)8 Node (com.sun.enterprise.config.serverbeans.Node)7 Map (java.util.Map)7 Logger (java.util.logging.Logger)7 ParameterMap (org.glassfish.api.admin.ParameterMap)7