1 23 24 package com.sun.enterprise.config.serverbeans.validation.tests; 25 26 import java.util.logging.Level ; 27 28 import com.sun.enterprise.config.ConfigBean; 29 import com.sun.enterprise.config.ConfigContext; 30 import com.sun.enterprise.config.ConfigContextEvent; 31 import com.sun.enterprise.config.ConfigException; 32 import com.sun.enterprise.config.serverbeans.AdminObjectResource; 33 import com.sun.enterprise.config.serverbeans.ServerBeansFactory; 34 import com.sun.enterprise.config.serverbeans.ServerTags; 35 import com.sun.enterprise.config.serverbeans.validation.GenericValidator; 36 import com.sun.enterprise.config.serverbeans.validation.Result; 37 import com.sun.enterprise.config.serverbeans.validation.ValidationDescriptor; 38 import com.sun.enterprise.connectors.ConnectorRuntime; 39 import java.util.Set ; 40 41 47 48 public class AdminObjectResourceTest extends GenericValidator { 49 50 static boolean checked = false; 51 52 public AdminObjectResourceTest(ValidationDescriptor desc) { 53 super(desc); 54 } 55 56 public Result validate(ConfigContextEvent cce) { 57 Result result = super.validate(cce); 59 if(cce.getChoice().equals(StaticTest.UPDATE)) { 60 try { 61 ConfigContext context = cce.getConfigContext(); 62 String name = cce.getName(); 63 String value = (String ) cce.getObject(); 64 AdminObjectResource admin = (AdminObjectResource)cce.getClassObject(); 65 validateAttribute(name, value, admin, result); 66 } catch(Exception e) { 67 _logger.log(Level.FINE, "domainxmlverifier.exception", e); 68 } 69 } 70 71 if(cce.getChoice().equals(StaticTest.ADD) || cce.getChoice().equals(StaticTest.VALIDATE)) { 72 try { 73 ConfigContext context = cce.getConfigContext(); 74 Object value = cce.getObject(); 75 AdminObjectResource admin = (AdminObjectResource)value; 76 validateAttribute(ServerTags.RES_TYPE, admin.getResType(), admin, result); 77 } catch(Exception e) { 78 _logger.log(Level.FINE, "domainxmlverifier.exception", e); 79 } 80 } 81 return result; 82 } 83 84 public void validateAttribute(String name, String value, ConfigBean admin, Result result) { 85 86 112 } 113 114 } 115 | Popular Tags |