logger.debug("========================================== 7 ==> Creating agent transitive effect model!");
if (logger.isDebugEnabled()) logger.debug("========================================== 7 ==> Creating agent transitive effect model!");
    private void processEnclaveTransitiveEffects(Vector hosts, Vector nodes, Vector agents) {             if (hosts.size() == 0 && nodes.size() == 0 && agents.size() == 0) {             logger.debug("========================================== 11 ==> processEnclaveTransitiveEffects - no assets to process");            return;         }                ThreatDescription metaModel;                TransitiveEffectDescription  transEffect;        Vector childTEs = new Vector();                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 ENCLAVE threats            if (dtm == null || !(dtm.getAssetType().equals(AssetType.ENCLAVE)) ) { continue; } // no threats to process                        TransitiveEffectDescription  hostTransEffect = null;            TransitiveEffectDescription  nodeTransEffect = null;            TransitiveEffectDescription  agentTransEffect = null;            TransitiveEffectDescription  childTE = null;            TransitiveEffectDescription  grandchildTE = null;            //Look up all transitive effects for this transitive effect            childTE = transEffect.getTransitiveEvent().getTransitiveEffect(); //this could be a node or agent TE            if (childTE != null) { //see if there is a grandchild TE                grandchildTE = childTE.getTransitiveEvent().getTransitiveEffect(); // this could only be an agent TE                if (grandchildTE != null ) { // then it must be agent typed                    if (grandchildTE.getTransitiveAssetType().equals(AssetType.AGENT)) {                        agentTransEffect = grandchildTE;                    } else { //error!                        logger.warn("Found a transEffect beneath TWO trans effects (on event["+grandchildTE.getTransitiveEvent().getName()+"])that was not on an agent container! IGNORING IT. It was: "+transEffect.getTransitiveAssetType() );                    }                } else { // the childTE could either be an agent or node container                    if (childTE.getTransitiveAssetType().equals(AssetType.AGENT)) {                        agentTransEffect = childTE;                    } else if (childTE.getTransitiveAssetType().equals(AssetType.NODE)) {                        nodeTransEffect = childTE;                    } else { //error!                        logger.warn("Found a transEffect beneath ONE trans effects (on event["+childTE.getTransitiveEvent().getName()+"])that was not on an agent or node container! IGNORING IT. It was: "+transEffect.getTransitiveAssetType() );                    }                }            }            if (transEffect.getTransitiveAssetType().equals(AssetType.HOST)) {                hostTransEffect = transEffect;            } else if (transEffect.getTransitiveAssetType().equals(AssetType.AGENT)) {                if (agentTransEffect != null) { // then we had a child/grandchild TE agent container already!                    logger.warn("Found an agent transEffect on an enclave threat (on threat["+dtm.getName()+"])that had a grand/child trans effect on an agent container! IGNORING IT. ");                } else {                    agentTransEffect = transEffect;                }            } else if (transEffect.getTransitiveAssetType().equals(AssetType.NODE)) {                if (nodeTransEffect != null) { // then we had a child/grandchild TE node container already!                    logger.warn("Found a node transEffect on an enclave threat (on threat["+dtm.getName()+"])that had a grand/child trans effect on a node container! IGNORING IT. ");                } else {                    nodeTransEffect = transEffect;                }            } else { //error!                logger.warn("Found a transEffect on an enclave threat (on threat["+dtm.getName()+"])that was NOT a HOST, NODE or AGENT container! IGNORING IT. It was: "+transEffect.getTransitiveAssetType());            }                            //Add hosts to transEffectModel            if (hostTransEffect != null && hosts.size() > 0) {                TransitiveEffectModel tem = hostTransEffect.getInstantiation();                if (tem == null) {                    logger.debug("========================================== 7 ==> Creating host transitive effect model!");                    tem = hostTransEffect.instantiate(us.nextUID());                    this.blackboard.publishAdd(tem);                }                                        Iterator it = hosts.iterator();                while (it.hasNext()) {                    logger.debug("========================================== 8 ==> Adding host to transitive effect model!");                    tem.addAsset((AssetTechSpecInterface)it.next());                }                    }                            //Add nodes to transEffectModel            if (nodeTransEffect != null && nodes.size() > 0) {                TransitiveEffectModel tem = nodeTransEffect.getInstantiation();                if (tem == null) {                    logger.debug("========================================== 7 ==> Creating node transitive effect model!");                    tem = nodeTransEffect.instantiate(us.nextUID());                    this.blackboard.publishAdd(tem);                }                                        Iterator it = nodes.iterator();                while (it.hasNext()) {                    logger.debug("========================================== 8 ==> Adding node to transitive effect model!");                    tem.addAsset((AssetTechSpecInterface)it.next());                }                    }            //Add agents to transEffectModel            if (agentTransEffect != null && agents.size() > 0) {                TransitiveEffectModel tem = agentTransEffect.getInstantiation();                if (tem == null) {                    logger.debug("========================================== 7 ==> Creating agent transitive effect model!");                    tem = agentTransEffect.instantiate(us.nextUID());                    this.blackboard.publishAdd(tem);                }                                        Iterator it = agents.iterator();                while (it.hasNext()) {                    logger.debug("========================================== 8 ==> Adding agent to transitive effect model!");                    tem.addAsset((AssetTechSpecInterface)it.next());                }                    }                    }            }