Fields Summary |
---|
private static final com.sun.enterprise.util.i18n.StringManager | strMgri18n strings manager object |
private static final String | lInstallRoot |
private static final String | lDomainsRoot |
private static final String | lJavaHome |
private static final String | lAdminPort |
private static final String | lInstancePort |
private static final String | lHostName |
private static final String | lJmsUser |
private static final String | lJmsPasswd |
private static final String | lJmsPort |
private static final String | lOrbPort |
static DomainConfigEntryInfo[] | entries |
Methods Summary |
---|
private final void | addEntryToMap(java.lang.Object key, java.lang.Object value, java.util.Map map)Add the given key/value pair, but reversing it, in the given
map. reversal means that the values in the map must be sets.
if (!map.containsKey(value)){
map.put(value, new TreeSet());
}
((Set)map.get(value)).add(key);
|
final java.lang.String | getDuplicatePorts(java.util.Map ports)
return printDuplicatesFromMap(reverseMap(ports));
|
private final java.lang.String | getLocalizedString(java.lang.String key, java.lang.Object o)
return strMgr.getString(key, o);
|
private final java.lang.String | getMessage(java.util.Map ports)
return getLocalizedString("duplicatePorts", getDuplicatePorts(ports));
|
private final java.util.Map.Entry | getNextDuplicate(java.util.Iterator it)Get next entry from iterator whose value is a set of
cardinality greater than 1
while (it.hasNext()){
Map.Entry result = (Map.Entry) it.next();
if (((Set)result.getValue()).size() > 1){
return result;
}
}
return null;
|
protected boolean | isValidate(java.lang.String name, java.lang.Object domainConfig)
boolean isPortEntry = DomainConfig.K_ADMIN_PORT.equals(name) ||
DomainConfig.K_INSTANCE_PORT.equals(name) ||
DomainConfig.K_ORB_LISTENER_PORT.equals(name) ||
DomainConfig.K_JMS_PORT.equals(name);
return (isPortEntry) ? isValidatePorts((Map)domainConfig) : true;
|
private boolean | isValidatePorts(java.util.Map domainConfig)
Boolean isValidatePorts =
(Boolean)domainConfig.get(DomainConfig.K_VALIDATE_PORTS);
return (null != isValidatePorts) ?
isValidatePorts.booleanValue() : true;
|
private final java.lang.String | printDuplicatesFromMap(java.util.Map map)Return a string representation of the given map, but only for
those entries where the value has a size greater than 1
final StringBuffer sb = new StringBuffer();
final Iterator it = map.entrySet().iterator();
Map.Entry entry = getNextDuplicate(it);
if (entry != null){
printEntry(sb, entry);
while ((entry = getNextDuplicate(it)) != null){
sb.append(", ");
printEntry(sb, entry);
}
}
return sb.toString();
|
private final void | printEntry(java.lang.StringBuffer sb, java.util.Map.Entry entry)
printEntry(sb, (Object) entry.getKey(), (Set) entry.getValue());
|
private final void | printEntry(java.lang.StringBuffer sb, java.lang.Object key, java.util.Set dups)Print the given key and set onto the given string
buffer. Note that the set is considered to contain more than
one object
sb.append(key).append(" -> ");
printSet(sb, dups);
|
private final void | printSet(java.lang.StringBuffer sb, java.util.Set set)Print the given set on the given string buffer
sb.append("{");
String separator = "";
for (Iterator it = set.iterator(); it.hasNext(); ){
sb.append(separator).append(it.next());
separator = ", ";
}
sb.append("}");
|
private final java.util.Map | reverseMap(java.util.Map inputMap)Reverse the given map. i.e. a keys in the input map are
values in the output map, and values in the input map are
kays in the output map. Note that the values in the output
map must be sets, to allow for many to 1 relations in the input
map.
final Map outputMap = new TreeMap();
for (Iterator entries = inputMap.entrySet().iterator(); entries.hasNext(); ){
Map.Entry entry = (Map.Entry) entries.next();
addEntryToMap(entry.getKey(), entry.getValue(), outputMap);
}
return outputMap;
|
final void | uniquePorts(com.sun.enterprise.admin.servermgmt.DomainConfig dc)
final Map ports = dc.getPorts();
final Set portValues = new HashSet(ports.values());
if (ports.keySet().size() != portValues.size()){
throw new InvalidConfigException(getMessage(ports));
}
|
public void | validate(java.lang.Object domainConfig)
super.validate(domainConfig);
uniquePorts((DomainConfig) domainConfig);
|