Search in sources :

Example 6 with JaccProvider

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

the class CreateJACCProvider method preAuthorization.

@Override
public boolean preAuthorization(AdminCommandContext context) {
    config = CLIUtil.chooseConfig(domain, target, context.getActionReport());
    if (config == null) {
        return false;
    }
    securityService = config.getSecurityService();
    JaccProvider jaccProvider = CLIUtil.findJaccProvider(securityService, jaccProviderName);
    if (jaccProvider != null) {
        final ActionReport report = context.getActionReport();
        report.setMessage(localStrings.getLocalString("create.jacc.provider.duplicatefound", "JaccProvider named {0} exists. Cannot add duplicate JaccProvider.", jaccProviderName));
        report.setActionExitCode(ActionReport.ExitCode.FAILURE);
        return false;
    }
    return true;
}
Also used : JaccProvider(com.sun.enterprise.config.serverbeans.JaccProvider) ActionReport(org.glassfish.api.ActionReport)

Aggregations

JaccProvider (com.sun.enterprise.config.serverbeans.JaccProvider)6 ActionReport (org.glassfish.api.ActionReport)4 SecurityService (com.sun.enterprise.config.serverbeans.SecurityService)2 PropertyVetoException (java.beans.PropertyVetoException)2 TransactionFailure (org.jvnet.hk2.config.TransactionFailure)2