protected void sendEvent( final Stock stock, final String eventListName, final EventValue event, final EmailFilterEventSource eventSource, final EventInfo eventInfo) { if (AnalysisClient.getEmailMsgQeueingFilter().contains(eventSource)) { jmsTemplate.send( eventQueue, new MessageCreator() { public Message createMessage(Session session) throws JMSException { SingleEventMessage message = new SingleEventMessage( eventListName, endDate, stock, event, ConfigThreadLocal.getAll()); message.setObjectProperty( MessageProperties.ANALYSE_SOURCE.getKey(), eventSource); // Source message.setObjectProperty( MessageProperties.TREND.getKey(), event.getEventType().name()); // Bearish or Bullish or Other? message.setObjectProperty(MessageProperties.SEND_EMAIL.getKey(), Boolean.TRUE); if (eventInfo != null) message.setObjectProperty( MessageProperties.EVENT_INFO.getKey(), eventInfo.getEventReadableDef()); return message; } }); } }
public void sendValidityMetricsMsg( final FullRatingOrdinator ordinator, final String eventListName) { if (AnalysisClient.getEmailMsgQeueingFilter().contains(EmailFilterEventSource.Metrics)) { jmsTemplate.send( eventQueue, new MessageCreator() { public Message createMessage(Session session) throws JMSException { SymbolEvents symbolEvents = new SymbolEvents(AnalysisClient.ANY_STOCK); StandardEventKey eventKey = new StandardEventKey(new Date(), EventDefinition.SCREENER, EventType.INFO); String messageTxt = String.format( "Percentage of unfound trends %.2f %%.\n" + "Percentage of not credible trends %.2f %%.\n" + "Percentage of staled trends %.2f %%.\n" + "Percentage of under performing %.2f %%.\n" + "Percentage of invalid trends %.2f %%.\n" + "Unfound trends :\n %s \nNot credible trends :\n %s \nStaled trends :\n %s \nUnder perf :\n %s \nInvalid trends :\n %s\n", ordinator.getNotToBefoundPerCentage() * 100, ordinator.getNotCrediblePerCentage() * 100, ordinator.getStaledPerCentage() * 100, ordinator.getIgnoredPerCentage() * 100, ordinator.getInvalidPerCentage() * 100, ordinator.getNotToBeFoundTrends(), ordinator.getNotCredibleTrends(), ordinator.getStaledTrends(), ordinator.getIgnoredTrends(), ordinator.getInvalidTrends()); symbolEvents.addEventResultElement( eventKey, new AlertEventValue(eventKey, messageTxt, eventListName), EventDefinition.SCREENER.getEventDefinitionRef()); SymbolEventsMessage message = new SymbolEventsMessage(eventListName, symbolEvents, ConfigThreadLocal.getAll()); message.setObjectProperty( MessageProperties.ANALYSE_SOURCE.getKey(), EmailFilterEventSource.Metrics); message.setObjectProperty(MessageProperties.SEND_EMAIL.getKey(), Boolean.TRUE); message.setObjectProperty(MessageProperties.TREND.getKey(), EventType.INFO.name()); return message; } }); } }