FileDocCategorySizeDatePackage
ASConnectorIdleTimeout.javaAPI DocGlassfish v2 API4431Fri May 04 22:35:12 BST 2007com.sun.enterprise.tools.verifier.tests.connector.ias

ASConnectorIdleTimeout

public class ASConnectorIdleTimeout extends ConnectorTest implements ConnectorCheck

Fields Summary
Constructors Summary
Methods Summary
public Resultcheck(com.sun.enterprise.deployment.ConnectorDescriptor descriptor)

     Result result = getInitializedResult();
     ComponentNameConstructor compName = new ComponentNameConstructor(descriptor);   
	 boolean oneFailed = false;
     SunConnector sc = descriptor.getSunDescriptor();
     if(sc == null)
     {
            result.notApplicable(smh.getLocalString(getClass().getName()+".notApplicable1",
			      "NOT APPLICABLE [AS­CONNECTOR]: sun-ra.xml descriptor object could not be obtained"));

     }
     else{
     ResourceAdapter ra = sc.getResourceAdapter();
     String idleTimeout = ra.getAttributeValue("idle-timeout-in-seconds");
     if(idleTimeout.length()==0)
     {
         result.failed(smh.getLocalString(getClass().getName()+".failed1",
                    "FAILED [AS-CONNECTOR resource-adapter] : idle-timeout-in-seconds cannot be empty"));
     }
     else
     {
        try
        {
            long value = Long.valueOf(idleTimeout).longValue();
            if(value < 0  || value > Long.MAX_VALUE)
            {
                result.failed(smh.getLocalString(getClass().getName()+".failed2",
                    "FAILED [AS-CONNECTOR resource-adapter] : idle-timeout-in-seconds cannot be {0}. It should be between 0 and {1}",
                new Object[]{new Long(value),new Long(Long.MAX_VALUE)}));
            }
            else
            {
                result.passed(smh.getLocalString(getClass().getName()+".passed",
                   "PASSED [AS-CONNECTOR resource-adapter] : idle-timeout-in-seconds is {0}",
                         new Object[]{new Long(value)}));
            }
        }
        catch(NumberFormatException nfex)
        {
            Verifier.debug(nfex);
            result.failed(smh.getLocalString(getClass().getName()+".failed3",
            "FAILED [AS-CONNECTOR resource-adapter] : The value {0} for idle-timeout-in-seconds is not a valid Long number",new Object[]{idleTimeout}));
        }
     }
     }
        return result;