logger.debug("========================================== 7 ==> Creating a child agent transitive effect model!");
if (logger.isDebugEnabled()) logger.debug("========================================== 7 ==> Creating a child agent transitive effect model!");
    private void processHostTransitiveEffects(Vector nodes, Vector agents) {             if (nodes.size() == 0 && agents.size() == 0) {             logger.debug("========================================== 11 ==> processHostTransitiveEffects - no assets to process");            return;         }                ThreatDescription metaModel;                TransitiveEffectDescription  nodeTransEffect = null;        TransitiveEffectDescription  agentTransEffect = null;        TransitiveEffectDescription  transEffect = null;        Iterator i = threatDescriptions.iterator();        while (i.hasNext()) {                        metaModel = (ThreatDescription)i.next();            transEffect = metaModel.getEventThreatCauses().getTransitiveEffect();            if (transEffect == null ) { continue; } // no transitive effect to process                        DefaultThreatModel dtm = metaModel.getInstantiation();            //Look only for HOST threats            if (dtm == null || !(dtm.getAssetType().equals(AssetType.HOST)) ) { continue; } // only process host threats                        nodeTransEffect = null;            agentTransEffect = null;                        if (transEffect.getTransitiveAssetType().equals(AssetType.HOST)) { //then there may be another trans effect on agents, look for it                logger.warn("Found a transEffect on a host threat (on threat["+dtm.getName()+"])that was on a HOST container! IGNORING IT. ");            }            else if (transEffect.getTransitiveAssetType().equals(AssetType.NODE)) { //then there may be another trans effect on agents, look for it                nodeTransEffect = transEffect;                                //look for a child trans eefect -- must be of agent type since it's under a node trans effect                agentTransEffect = nodeTransEffect.getTransitiveEvent().getTransitiveEffect();                                if (agentTransEffect != null && !(agentTransEffect.getTransitiveAssetType().equals(AssetType.AGENT))) { //then there must be an error -- node trans effects can only contain agents                    logger.warn("Found a transEffect beneath a node trans effect (on event["+nodeTransEffect.getTransitiveEvent().getName()+"])that was not on an agent container! IGNORING IT. It was: "+agentTransEffect.getTransitiveAssetType() );                    agentTransEffect = null;                }            }               else if (transEffect.getTransitiveAssetType().equals(AssetType.AGENT)) { //then there cannot be anymore transeffects below this one                agentTransEffect = transEffect;            }                            TransitiveEffectModel node_tem = null;            TransitiveEffectModel agent_tem= null;                        //Now, search the node assets, if a nodeTransEffect exists. Add a node if its host is a member of the current threat.            if (nodeTransEffect != null) { //get its instantiation                node_tem = nodeTransEffect.getInstantiation();                if (node_tem == null) {                    logger.debug("========================================== 7 ==> Creating node transitive effect model!");                    node_tem = nodeTransEffect.instantiate(us.nextUID());                    this.blackboard.publishAdd(node_tem);                }                Iterator it = nodes.iterator();                while (it.hasNext()) {                                    AssetTechSpecInterface node = (AssetTechSpecInterface)it.next();                    if (dtm.containsAsset(node.getHost()) ) { // then this node should be added to the transitive effect                        logger.debug("========================================== 9 ==> Adding node["+node.getName()+"] to transitive effect model!");                        node_tem.addAsset(node);                    } else {//                        logger.debug("========================================== 9.5 ==> Node not added to transitive effect model! Host Threat="+dtm.getName()+" did not contain this node's["+node.getName()+"] host="+node.getHost().getName());                        logger.debug("############################################ 9.5 ==> Node not added to transitive effect model! Host Threat="+dtm.getName());                        logger.debug("############################################ 9.5 did not contain this node's["+node.getName()+"] host");                        logger.debug("############################################ 9.5  host="+node.getHost().getName());                    }                }               }                        //Now, search the agent assets, if an agentTransEffect exists. Add an agent if its host is a member of the current threat, or node is a member of the nodeTransEffect.            if (agentTransEffect != null) { //get its instantiation                agent_tem = agentTransEffect.getInstantiation();                if (agent_tem == null) {                    logger.debug("========================================== 7 ==> Creating a child agent transitive effect model!");                    agent_tem = agentTransEffect.instantiate(us.nextUID());                    this.blackboard.publishAdd(agent_tem);                }                                Iterator it = agents.iterator();                while (it.hasNext()) {                                    AssetTechSpecInterface agent = (AssetTechSpecInterface)it.next();                    //Add this agent ONLY if its node is in the parent (node) transEffect. If no node transEffect                    //exists, then add only if its host is in the threat.                    if (node_tem != null && node_tem.containsAsset(agent.getNode()) ) {                         logger.debug("========================================== 9.1 ==> Adding agent["+agent.getName()+"] to transitive effect model! Agent's Node is in parent transEffect");                        agent_tem.addAsset(agent);                    } else if (dtm.containsAsset(agent.getHost()) ) { // then this node should be added to the transitive effect                        logger.debug("========================================== 9.1 ==> Adding agent["+agent.getName()+"] to transitive effect model! Agent's host is in threat");                        agent_tem.addAsset(agent);                    } else {                        logger.debug("========================================== 9.5 ==> Agent not added to transitive effect model! Host Threat="+dtm.getName()+" did not contain this agent's["+agent.getName()+"] host="+agent.getHost().getName());                    }                }               }        }          }