private void getProjectGroupNotifiers( ProjectGroup projectGroup, Map<String, List<ProjectNotifier>> notifiersMap ) { // perform the project group level notifications if ( projectGroup.getNotifiers() != null ) { for ( ProjectNotifier projectNotifier : (List<ProjectNotifier>) projectGroup.getNotifiers() ) { List<ProjectNotifier> projectNotifiers = notifiersMap.get( projectNotifier.getType() ); if ( projectNotifiers == null ) { projectNotifiers = new ArrayList<ProjectNotifier>(); } if ( !projectNotifier.isEnabled() ) { log.info( projectNotifier.getType() + " projectNotifier (id=" + projectNotifier.getId() + ") is disabled." ); continue; } projectNotifiers.add( projectNotifier ); notifiersMap.put( projectNotifier.getType(), projectNotifiers ); } } } }
private void getProjectNotifiers( Project project, Map<String, List<ProjectNotifier>> notifiersMap ) { if ( project.getNotifiers() != null ) { // perform the project level notifications for ( ProjectNotifier notifier : (List<ProjectNotifier>) project.getNotifiers() ) { List<ProjectNotifier> notifiers = notifiersMap.get( notifier.getType() ); if ( notifiers == null ) { notifiers = new ArrayList<ProjectNotifier>(); } if ( !notifier.isEnabled() ) { log.info( notifier.getType() + " notifier (id=" + notifier.getId() + ") is disabled." ); continue; } notifiers.add( notifier ); notifiersMap.put( notifier.getType(), notifiers ); } } }
map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_ENABLED, notifier.isEnabled() ); map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_ERROR, notifier.isSendOnError() ); map.put( ContinuumBuildAgentUtil.KEY_NOTIFIER_SEND_ON_SUCCESS, notifier.isSendOnSuccess() );
private void sendNotification( String messageId, ProjectNotifier projectNotifier, Map context ) { String notifierType = projectNotifier.getType(); if ( !projectNotifier.isEnabled() ) { getLogger().info( notifierType + " notifier (id=" + projectNotifier.getId() + ") is disabled." ); return; } Map configuration = projectNotifier.getConfiguration(); try { context.put( CONTEXT_PROJECT_NOTIFIER, projectNotifier ); Notifier notifier = notifierManager.getNotifier( notifierType ); Set recipients = recipientSource.getRecipients( String.valueOf( projectNotifier.getId() ), messageId, configuration, context ); notifier.sendNotification( messageId, recipients, configuration, context ); } catch ( NotificationException e ) { getLogger().error( "Error while trying to use the " + notifierType + " notifier.", e ); } } }
userNotifier.setEnabled( notifier.isEnabled() );
userNotifier.setEnabled( notifier.isEnabled() );
userNotifier.setEnabled( notifier.isEnabled() );
userNotifier.setEnabled( notifier.isEnabled() );