FileDocCategorySizeDatePackage
HttpServiceTest.javaAPI DocGlassfish v2 API8407Fri May 04 22:34:10 BST 2007com.sun.enterprise.admin.verifier.tests

HttpServiceTest

public class HttpServiceTest extends ServerXmlTest implements ServerCheck
PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms. Copyright 2001-2002 by iPlanet/Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All rights reserved.

Fields Summary
static Logger
_logger
Constructors Summary
public HttpServiceTest()

    
      
    
Methods Summary
public Resultcheck(com.sun.enterprise.config.ConfigContext context)

        Result result;
        result = super.getInitializedResult();
        /*try {
            Server server = (Server)context.getRootConfigBean();
            HttpService http  = server.getHttpService();
            String qos = http.getQosMetricsIntervalInSeconds();
            String qosRecompute = http.getQosRecomputeTimeIntervalInMillis();
            try {
                // <addition> srini@sun.com Bug : 4698904
                if(qos!=null)
                // </addition>
                    Long.parseLong(qos);
                result.passed("Http Service QOS Metric Interval in Seconds Valid " + qos);
            } catch(NumberFormatException e) {
                result.failed("Http Service QOS Metric Interval in Seconds invalid number - " + qos );
            }
            try {
               // <addition> srini@sun.com Bug : 4698904
               if(qosRecompute!=null)
               // </addition>
                    Long.parseLong(qosRecompute);   
               result.passed("Http Service QOS Recompute time interval in millis Valid ");
            } catch(NumberFormatException e) {
                result.failed("Http Service QOS Recompute time Interval in millis Invalid - " + qosRecompute );
            }
            Acl[] aclList = http.getAcl();
            for(int i=0;i<aclList.length;i++){
                String file = aclList[i].getFile();
                File f = new File(file);
                try {
                    if(f.exists())
                        result.passed("Acl File Valid - " + file);
                    else
                        result.failed("Acl File Invalid - " + file);
                }catch(SecurityException e){
                    result.failed("Acl File Not able to access"+ file);
                }
            }
        }
        catch(Exception ex) {
            // Logging
            _logger.log(Level.FINE, "serverxmlverifier.exception", ex);
            result.failed("Exception : " + ex.getMessage());
        }*/
        return result;
    
public Resultcheck(com.sun.enterprise.config.ConfigContextEvent ccce)

        Result result;
        Object value = ccce.getObject();
        result = new Result();
        String beanName = ccce.getBeanName();
        result.passed("Passed***");
        if(beanName!=null) {
               String name = ccce.getName();
               result = testSave(name,(String)value);
               return result;
        }
/*
        HttpService http = (HttpService)value;
        String qos = http.getQosMetricsIntervalInSeconds();
        String qosRecompute = http.getQosRecomputeTimeIntervalInMillis();
        try {
            // <addition> srini@sun.com Bug : 4698904
            if(qos!=null)
            // </addition>
                Long.parseLong(qos);
            result.passed("QOS Metric Interval Valid Number : Passed");
        } catch(NumberFormatException e) {
            result.failed("QOS Metric Interval Invalid Number " + qos);
        }
        try {
           // <addition> srini@sun.com Bug : 4698904
           if(qosRecompute!=null)
           // <addition> 
                Long.parseLong(qosRecompute);
           result.passed("QOS Recompute Interval Valid : Passed");
        } catch(NumberFormatException e) {
            result.failed(" QOS Recompute time Interval Invalid Number " + qosRecompute);
        }
        Acl[] aclList = http.getAcl();
        for(int i=0;i<aclList.length;i++){
            String file = aclList[i].getFile();
            File f = new File(file);
            try {
                if(f.exists())
                    result.passed("Acl File Valid - " + file + ": Passed");
                else
                    result.failed("Acl File Invalid - " + file + ": Failed");
            }catch(SecurityException e){
                result.failed("Acl File Not able to access "+ file + ": Failed");
            }
        }
*/
        return result;
    
public ResulttestSave(java.lang.String name, java.lang.String value)

        Result result = new Result();
        result.passed("passed ** ");
/*
        if(name.equals(ServerTags.QOS_METRICS_INTERVAL_IN_SECONDS)) {
            try {
                // <addition> srini@sun.com Bug : 4698904
                if(value!=null)
                // </addition>
                    Long.parseLong(value);
                result.passed("QOS Metrics Interval Valid Number ");
            } catch(NumberFormatException e) {
                result.failed("QOS Metrics Interval Invalid Number " + value);
            }
        }
        if(name.equals(ServerTags.QOS_RECOMPUTE_TIME_INTERVAL_IN_MILLIS)){
            try {
                // <addition> srini@sun.com Bug : 4698904
                if(value!=null)
                // <addition> 
                     Long.parseLong(value);
                result.passed("QOS Recompute Time Interval Valid Number");
            } catch(NumberFormatException e){
                result.failed("QOS Recompute Time Interval Invalid Number " + value);
            }
        }
*/
        return result;