ctxList.add(ctx);
if ("services".equals(sd.locationType)) {
String fullLocation = sd.locationType + '/' + sd.location;
activeDeployments.add(fullLocation);
CmdService cmds = CmdService.getHandle();
String[] ctxHosts = ctx.getHosts();
for (String ctxHost : ctxHosts) {
if (hostDeploymentSet.add(new NameValuePair<String>(
cmds.getHostName(ctxHost), sd.location))) {
hostDeploymentList.add(new NameValuePair<String>(
ctxHost, sd.location));
}
}
}
String toolCmds = par.getParameter("fh:tools", serviceElement);
Set<String> tools = new LinkedHashSet<String>();
if (toolCmds.toUpperCase().equals("NONE")) {
} else if (toolCmds.length() != 0){
StringTokenizer st = new StringTokenizer(toolCmds, ";");
while (st.hasMoreTokens()) {
tools.add(st.nextToken().trim());
}
} else {
String key = "default" + '/' + serviceName;
Set<String> toolsetTools = new LinkedHashSet<String>();
if(toolSetsMap.containsKey(key)){
toolsetTools.addAll(toolSetsMap.get(key));
for (String t1 : toolsetTools) {
StringTokenizer tt1 = new StringTokenizer(t1);
String toolId1 = tt1.nextToken();
String toolKey1 = toolId1 + '/' + serviceName;
ToolDescription toolDesc = toolMap.get(toolKey1);
MasterToolContext toolCtx;
if (toolDesc != null) {
toolCtx = new MasterToolContext(t1, ctx,
toolDesc);
} else {
toolDesc = toolMap.get(toolId1);
if (toolDesc != null) {
toolCtx = new MasterToolContext(
t1, ctx, toolDesc);
activeDeployments.add(
toolDesc.getLocationType() +
File.separator +
toolDesc.getLocation());
} else {
//logger.info("No Tool Description for tool: " + t1);
logger.fine("No Tool Description for tool: "
+ t1 +" ,so it's a command line tool");
toolCtx = new MasterToolContext(
t1, ctx, null);
}
}
if (toolCtx != null) {
toolList.add(toolCtx);
}
}
}
}
// Analyze the list of tools for toolset references.
for (String tool : tools) {
StringTokenizer tt = new StringTokenizer(tool);
String toolId = tt.nextToken();
String toolKey = toolId + '/' + serviceName;
Set<String> toolsetTools = new LinkedHashSet<String>();
if (toolSetsMap.containsKey(toolKey)) {
toolsetTools.addAll(toolSetsMap.get(toolKey));
for (String t1 : toolsetTools) {
StringTokenizer tt1 = new StringTokenizer(t1);
String toolId1 = tt1.nextToken();
String toolKey1 = toolId1 + '/' + serviceName;
ToolDescription toolDesc = toolMap.get(toolKey1);
MasterToolContext toolCtx;
if (toolDesc != null) {
toolCtx = new MasterToolContext(t1, ctx, toolDesc);
} else {
toolDesc = toolMap.get(toolId1);
if (toolDesc != null) {
toolCtx = new MasterToolContext(
t1, ctx, toolDesc);
} else {
logger.fine("No Tool Description for tool: "
+ t1 +
" ,so it's a command line tool");
toolCtx = new MasterToolContext(
t1, ctx, null);
}
}
if (toolCtx != null) {
toolList.add(toolCtx);
}
}
} else {
ToolDescription toolDesc = toolMap.get(toolKey);
MasterToolContext toolCtx;
if (toolDesc != null) {
toolCtx = new MasterToolContext(tool, ctx, toolDesc);
} else {
toolDesc = toolMap.get(toolId);
if (toolDesc != null) {
toolCtx = new MasterToolContext(
tool, ctx, toolDesc);
} else {
logger.fine("No Tool Description for tool: " +
tool + " ,so it's a command line tool");
toolCtx = new MasterToolContext(
tool, ctx, null);
}
}
if (toolCtx != null) {
toolList.add(toolCtx);
}
}
}
for (MasterToolContext toolCtx : toolList) {
String locationType;
if (toolCtx.getToolDescription() != null) {
locationType =
toolCtx.getToolDescription().getLocationType();
if ("services".equals(locationType)) {
String location =
toolCtx.getToolDescription().getLocation();
String fullLocation = locationType + '/' + location;
activeDeployments.add(fullLocation);
CmdService cmds = CmdService.getHandle();
String[] ctxHosts =
toolCtx.getToolServiceContext().getHosts();
for (String ctxHost : ctxHosts) {
if (hostDeploymentSet.add(new NameValuePair<String>(
cmds.getHostName(ctxHost), location))) {
hostDeploymentList.add(new NameValuePair<String>
(ctxHost, location));
}
}
}