Methods Summary |
---|
public static com.sun.enterprise.admin.jmx.remote.server.ServerVersionMatcher | getMatcher()
return ( matcher );
|
boolean | majorCompatible(com.sun.enterprise.admin.jmx.remote.protocol.Version c, com.sun.enterprise.admin.jmx.remote.protocol.Version s)
//client version can at most equal server version
boolean compatible = false;
final int cmv = c.getMajorVersion();
final int smv = s.getMajorVersion();
if (cmv < smv) {
logger.finer("S1AS JSR 160 - Using Backword compatibility, as client version: " +
cmv + " is smaller than server version: " + smv);
logger.finer("It is better to upgrade the client software");
compatible = true;
}
else if (cmv == smv) {
compatible = true;
}
else {
logger.finer("S1AS JSR 160 - Version Compatibility failed, as client version: " +
cmv + " is higher than server version: " + smv);
logger.finer("Server software has to be upgraded to atleast major version: " + cmv);
compatible = false;
}
return ( compatible );
|
public boolean | match(com.sun.enterprise.admin.jmx.remote.protocol.Version client, com.sun.enterprise.admin.jmx.remote.protocol.Version server)Returns true if and only if the client version and server version are
compatible. The server version matches with client version if and only if
- Client Major Version is <= Server Major Version
- Client Minor Version is <= Server Minor Version
- Upgrade Data is compatible in both the versions
return (majorCompatible(client, server) &&
minorCompatible(client, server) &&
upgradeCompatible(client, server) );
|
boolean | minorCompatible(com.sun.enterprise.admin.jmx.remote.protocol.Version c, com.sun.enterprise.admin.jmx.remote.protocol.Version s)
//client version can at most equal server version
boolean compatible = false;
final int cmv = c.getMinorVersion();
final int smv = s.getMinorVersion();
if (cmv < smv) {
logger.finer("S1AS JSR 160 - Using Backword compatibility, as client version: " +
cmv + " is smaller than server version: " + smv);
logger.finer("It is better to upgrade the client software");
compatible = true;
}
else if (cmv == smv) {
compatible = true;
}
else {
logger.finer("S1AS JSR 160 - Version Compatibility failed, as client version: " +
cmv + " is higher than server version: " + smv);
logger.finer("Server software has to be upgraded to atleast major version: " + cmv);
compatible = false;
}
return ( compatible );
|
boolean | upgradeCompatible(com.sun.enterprise.admin.jmx.remote.protocol.Version c, com.sun.enterprise.admin.jmx.remote.protocol.Version s)
final String[] cud = c.getUpgradeData();
final String[] sud = s.getUpgradeData();
boolean uc = true;
uc = uc && (cud.length == sud.length); //lengths must be the same
if (uc) {
for (int i = 0 ; i < cud.length ; i++) {
if (cud[i] != null && sud[i] != null) {
uc = uc && cud[i].equals(sud[i]);
if (!uc) {
break;
}
}
}
}
return ( uc );
|