return tempServiceExtInfo;
}
private void takeObjectsAction(LinkedList l) {
Vertex v = null;
LinkedList <ServiceExtInfo> svcextinfolist;
for (Object n: l) {
if (n instanceof HostExtInfo) {
_graphManager.addHostExtInfo((HostExtInfo)n);
} else if (n instanceof ServiceExtInfo) {
// As ServiceExtInfo are stored in the vertex but the
// hosts are not created yet, store the info in a temporary HashMap
// that will be used later when hosts are already processed
svcextinfolist = getExtInfoMap().get(((ServiceExtInfo)n).getHostName());
if (svcextinfolist == null) {
svcextinfolist = new LinkedList<ServiceExtInfo>();
getExtInfoMap().put(((ServiceExtInfo)n).getHostName(),svcextinfolist);
}
svcextinfolist.add((ServiceExtInfo)n);
} else if (n instanceof Host) {
try {
if (_graphManager.getType() == GraphTypes.Directed)
v = _graphManager.addVertex(new DirectedSparseVertex(), ((Host)n).getName());
else if (_graphManager.getType() == GraphTypes.UnDirected) {
v = _graphManager.addVertex(new UndirectedSparseVertex(), ((Host)n).getName());
}
v.setUserDatum("host", (Host)n, UserData.CLONE);
} catch (UniqueLabelException ule) {}
} else if (n instanceof ErrorMapper) {
ErrorMapper err = (ErrorMapper)n;
if (_statusErrorsTypeDisplayed[err.getType()] == 0) {
MapperEvent me = new MapperEvent(this);
me.setMapperType(MapperActionType.DisplayError);
me.setParams(err);
fireMapperActionRequested(me);
_statusErrorsTypeDisplayed[err.getType()] = 1;
}
} else if (n instanceof ObjectHostGroup) {
_graphManager.addHostGroup((ObjectHostGroup)n);
}
}
String[] verts;
int i = 0;
v = null;
for (Object n: l) {
if (n instanceof Host) {
verts = ((Host)n).getParentsString().split(",");
LinkedList <Object>lparents = new LinkedList<Object>();
v = _graphManager.getVertex(((Host)n).getName());
// get temporary list of svcextinfo for this host.
svcextinfolist = getExtInfoMap().get(((Host)n).getName());
if (svcextinfolist != null) {
for (ServiceExtInfo sei : svcextinfolist) {
_graphManager.addServiceExtInfo(sei);
}
svcextinfolist.clear(); // clear the list of svcextinfo's
getExtInfoMap().remove(((Host)n).getName()); // remove the host referece in the list
}
for (i = 0; i < verts.length; i++) {
try {
_graphManager.addEdge(verts[i].trim(), ((Host)n).getName());
} catch (GraphException ge) {
MapperEvent me = new MapperEvent(this);
me.setMapperType(MapperActionType.DisplayError);
ErrorMapper em = new ErrorMapper(ge.getMessage());
me.setParams(em);
fireMapperActionRequested(me);
}
lparents.add(_graphManager.getVertex(verts[i].trim()));
}
if (v != null)
v.addUserDatum("parents", lparents, UserData.REMOVE);
}
}
_graphManager.adjustVerticesPhysicalLevel();
}