for(int i=0; i<targets.length; i++) {
// if this is "domain" add a domain target
if(TargetType.DOMAIN.equals(targets[i])) {
// Add a domain target
SunTarget dom = new SunTarget(serverId);
dom.setAppServerInstance(TargetType.DOMAIN);
dom.setConnectionSource(dasConnection);
dom.setTargetType(TargetType.DOMAIN);
targetsArray[i] = dom;
continue;
}
// if this is "server" add a server target
if(DAS.equals(targets[i])) {
// Add a target for default server
SunTarget serv = new SunTarget(serverId);
serv.setAppServerInstance(DAS);
serv.setConnectionSource(dasConnection);
serv.setTargetType(TargetType.STAND_ALONE_SERVER);
targetsArray[i] = serv;
continue;
}
// for PE, it will not come here at all; go ahead and get proxies and server/cluster keysets from the proxies
if(serverProxies == null || clusterProxies == null) {
DomainConfig domainCfg = ProxyFactory.getInstance(dasConnection).getDomainRoot().getDomainConfig();
serverProxies = domainCfg.getStandaloneServerConfigMap();
clusterProxies = domainCfg.getClusterConfigMap();
}
// check if ctarget is a stand alone server
if(serverProxies.get(targets[i]) != null) {
SunTarget aTarget = new SunTarget(serverId);
aTarget.setAppServerInstance(targets[i]);
aTarget.setConnectionSource(dasConnection);
aTarget.setTargetType(TargetType.STAND_ALONE_SERVER);
targetsArray[i] = aTarget;
continue;
}
// check if ctarget is a cluster
if(clusterProxies.get(targets[i]) != null) {
SunTarget aTarget = new SunTarget(serverId);
aTarget.setAppServerInstance(targets[i]);
aTarget.setConnectionSource(dasConnection);
aTarget.setTargetType(TargetType.CLUSTER);
targetsArray[i] = aTarget;
continue;
}
// if we are here, it means given target does not exist at all - return null
return null;