StaticTestpublic class StaticTest extends Object 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 | public static final String | ADDRepresents the ADD configbean request | public static final String | DELETERepresents the DELETE configbean request | public static final String | UPDATERepresents the UPDATE configbean request | public static final String | SETRepresents the SET configbean request | public static final String | IAS_NAME | public static final String | XML_1 | public static final String | XML_2 |
Constructors Summary |
---|
public StaticTest()
//</addition>
|
Methods Summary |
---|
public static boolean | checkAddress(java.lang.String address)
if(address.equalsIgnoreCase("ANY") || address.equalsIgnoreCase("INADDR_ANY") ||
address.equalsIgnoreCase("localhost"))
return false;
else
return true;
| public static boolean | checkObjectName(java.lang.String id)should just take in the id. construct the name inside this method
String name = IAS_NAME + id;
new ObjectName(name); // verify that it's good
return true;
| public static boolean | checkObjectName(java.lang.String id, com.sun.enterprise.admin.verifier.Result result)method to be called by verifier
try {
return checkObjectName(id);
} catch(MalformedObjectNameException ex) {
_logger.log(Level.FINE, "serverxmlverifier.exception", ex);
result.failed(ex.getMessage());
return false;
}
| public static boolean | checkXMLName(java.lang.String name)external method to be called by instller, etc for checking if the string
is a valid xml string
This is a very expensive test. Be prudent in using it.
//Construct a valid xml string
String xml = XML_1 + name + XML_2;
ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
InputSource is = new InputSource(bais);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setValidating(false);
DocumentBuilder db = dbf.newDocumentBuilder();
db.parse(is);
return true;
| public static boolean | checkXMLName(java.lang.String name, com.sun.enterprise.admin.verifier.Result result)method called by verifier for checking for a valid xml string
This is a very expensive test. Be prudent in using it.
try {
return checkXMLName(name);
} catch (Exception s) {
_logger.log(Level.FINE, "serverxmlverifier.exception", s);
result.failed(s.getMessage());
return false;
}
| public static Config | getConfig(com.sun.enterprise.config.ConfigContext context)
Config mConfig=null;
try {
mConfig = ServerBeansFactory.getConfigBean(context);
} catch(Exception e) {
}
return mConfig;
| public static boolean | isPortValid(int i)
if(i > 0 && i <= 65535)
return true;
else
return false;
|
|