FileDocCategorySizeDatePackage
ProviderConfigTest.javaAPI DocGlassfish v2 API4105Fri May 04 22:24:38 BST 2007com.sun.enterprise.config.serverbeans.validation.tests

ProviderConfigTest

public class ProviderConfigTest extends com.sun.enterprise.config.serverbeans.validation.GenericValidator

Fields Summary
private static final char[]
illegalChars
Constructors Summary
public ProviderConfigTest(com.sun.enterprise.config.serverbeans.validation.ValidationDescriptor desc)


        
        super(desc);
    
Methods Summary
private com.sun.enterprise.config.serverbeans.ProviderConfiggetProviderConfig(com.sun.enterprise.config.ConfigContextEvent cce)

        return (ProviderConfig) cce.getValidationTarget();
    
private final booleanisReferencedByParent(com.sun.enterprise.config.ConfigContextEvent cce)

        final ProviderConfig pc = getProviderConfig(cce);
        final MessageSecurityConfig msc = (MessageSecurityConfig) pc.parent().parent();
        return msc.getDefaultProvider() != null && msc.getDefaultProvider().equals(pc.getProviderId());
    
public com.sun.enterprise.config.serverbeans.validation.Resultvalidate(com.sun.enterprise.config.ConfigContextEvent cce)


        Result result = super.validate(cce);
        try {
            if (cce.getChoice().equals(StaticTest.DELETE)){
                if (isReferencedByParent(cce)){
                    result.failed(
                        smh.getLocalString(
                            getClass().getName() + ".cannotDeleteReferencedProviderConfig",
                            "provider config (provider-id={0}) can not be removed. It is referenced by its parent message-security-config",
                            new Object[]{getProviderConfig(cce).getProviderId()}));
                }
            }
        }
        catch (Exception e){
            _logger.log(Level.FINE, "domainxmlverifier.exception", e);
        }
            
        return result;