use of com.dtp.common.em.NotifyTypeEnum in project dynamic-tp by dromara.
the class NotifyHelper method getNotifyItem.
public static NotifyItem getNotifyItem(DtpExecutor dtpExecutor, NotifyTypeEnum typeEnum) {
List<NotifyItem> notifyItems = dtpExecutor.getNotifyItems();
val notifyItemOpt = notifyItems.stream().filter(x -> typeEnum.getValue().equalsIgnoreCase(x.getType()) && x.isEnabled()).findFirst();
if (!notifyItemOpt.isPresent()) {
log.debug("DynamicTp notify, no such [{}] notify item configured, threadPoolName: {}", typeEnum.getValue(), dtpExecutor.getThreadPoolName());
return null;
}
return notifyItemOpt.get();
}
Aggregations