Methods Summary |
---|
private ClusteredInstance | createNewInstance(java.lang.String instanceName)
ClusteredInstance clInstance = new ClusteredInstance(instanceName);
clusteredInstanceList.add(clInstance);
return clInstance;
|
public java.lang.String | getClusterName()
return this.clusterName;
|
public java.util.List | getClusteredInstanceList()
return this.clusteredInstanceList;
|
public java.lang.String | getDomainName()
if(this.domainName == null){
ClusteredInstance clInstance = this.getMasterInstance();
if((clInstance == null) && (this.clusteredInstanceList.size() > 0)){
clInstance = (ClusteredInstance)this.clusteredInstanceList.get(0);
}
this.domainName = clInstance.getDomain();
return clInstance.getDomain();
}
return this.domainName;
|
public ClusteredInstance | getMasterInstance()
ClusteredInstance clInstance = null;
for(Iterator it = this.clusteredInstanceList.iterator(); it.hasNext();){
clInstance = (ClusteredInstance)it.next();
if(clInstance.isMaster())
return clInstance;
}
return null;
|
public void | parseClinstanceConfFile(java.io.File file)
if(clusteredInstanceList == null){
clusteredInstanceList = new ArrayList();
}
clusteredInstanceList.clear();
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
String line = null;
ClusteredInstance clInstance = null;
while((line = reader.readLine()) != null){
if(line.trim().startsWith("#")){
// Comment line. pass on
continue;
}
if(line.trim().startsWith("instancename")){
String instanceName = line.substring("instancename".length()).trim();
clInstance = createNewInstance(instanceName);
continue;
}
if(clInstance != null)
clInstance.extractDataFromLine(line);
}
|
public void | print()
if(clusteredInstanceList != null){
for(Iterator it = clusteredInstanceList.iterator(); it.hasNext();){
ClusteredInstance clInst = (ClusteredInstance)it.next();
log.info(clInst.getInstanceName());
log.info(clInst.getUser());
log.info(clInst.getHost());
log.info(clInst.getPort());
log.info(clInst.getDomain());
log.info(clInst.getInstancePort());
log.info(String.valueOf(clInst.isMaster()));
log.info("\n");
}
}
|
public void | setClusterName(java.lang.String clName)
this.clusterName = clName;
|
public void | setDomainName(java.lang.String dName)
this.domainName = dName;
|
public void | updateClusteredInstanceList(java.lang.String domainXMLFile, java.lang.String domainName, java.lang.String clName, com.sun.enterprise.tools.upgrade.common.UpgradeUtils upgradeUtils)Builds ClusteredInstance list with domain name
and respective cluster name.
if(clusteredInstanceList == null) {
clusteredInstanceList = new ArrayList();
}
clusteredInstanceList.clear();
upgradeUtils.updateClusteredInstanceList(domainXMLFile,
domainName, clName, clusteredInstanceList);
|