findOneByLocal(true); } else { $src_amh = AlarmingManagementHostQuery::create()->findPk($src_amh_id); } if ($src_amh !== NULL) { foreach ($host_lst as $tgt_host) { // build interface instance $if_cls_nam = $tgt_host->getInterfaceClass(); require_once "AlarmInterface/RemoteInterface/$if_cls_nam.php"; $if_cls = new ReflectionClass($if_cls_nam); $if = $if_cls->newInstance(); $if->processAlarm( $inst_addr, $evt_time, $evt_spec, $serv_infl, $perc_sev, $src_amh->getName(), $src_amh->getHostAddr(), $tgt_host->getHostAddr()); } } else throw new Exception("Could not eval source host."); } function registerHost( $host_name = null, HostAddr $host_addr = null, &$amh_id) { if ($host_name == null || $host_addr == null) { $amh = AlarmingManagementHostQuery::create()->findOneByLocal(true); } else { $amh = AlarmingManagementHostQuery::create()->findOneByHostAddrVal($host_addr->getValue()); if ($amh == NULL) { $amh = new AlarmingManagementHost(); $amh->setName($host_addr); $amh->setHostAddr($host_addr); $amh->setLocal(false); $amh->save(); } } if ($amh == null) { $amh_id = null; } else { $amh_id = $amh->getId(); } } static function getHostAddrList( $aed_id, &$local_proc, &$host_lst) { $local_proc = false; $host_lst = array(); $amh_lst = AlarmingManagementHostQuery::create()->find(); $afi_lst = AlarmForwardingInstructionQuery::create()->find(); $fes_lst = ForwardingEventSelectorQuery::create()->findByAedId($aed_id); foreach ($afi_lst as $afi) { $afi_id = $afi->getId(); if ($afi->getEvtSelMode()->getValue() == SelectMode::SM_EXCL) { $prc_afi = TRUE; foreach ($fes_lst as $fes) { if ($fes->getAfiId() == $afi_id) { $prc_afi = FALSE; break; } } } else { $prc_afi = FALSE; foreach ($fes_lst as $fes) { if ($fes->getAfiId() == $afi_id) { $prc_afi = TRUE; break; } } } if ($prc_afi) { $dest_host_sel = $afi->getDestHostSel(); foreach ($amh_lst as $amh) { if (in_array($amh->getId(), $dest_host_sel)) { if ($amh->getLocal()) { $local_proc = true; } else { $host_lst[] = $amh; } } } } } } } ?>