{
message = generateMessage( project, build );
}
catch ( ContinuumException e )
{
throw new NotificationException( "Can't generate the message.", e );
}
jabberClient.setHost( getHost( notifier.getConfiguration() ) );
jabberClient.setPort( getPort( notifier.getConfiguration() ) );
jabberClient.setUser( getUsername( notifier.getConfiguration() ) );
jabberClient.setPassword( getPassword( notifier.getConfiguration() ) );
jabberClient.setImDomainName( getImDomainName( notifier.getConfiguration() ) );
jabberClient.setSslConnection( isSslConnection( notifier.getConfiguration() ) );
try
{
jabberClient.connect();
jabberClient.logon();
if ( notifier.getConfiguration() != null &&
StringUtils.isNotEmpty( (String) notifier.getConfiguration().get( ADDRESS_FIELD ) ) )
{
String address = (String) notifier.getConfiguration().get( ADDRESS_FIELD );
String[] recipients = StringUtils.split( address, "," );
for ( String recipient : recipients )
{
if ( isGroup( notifier.getConfiguration() ) )
{
jabberClient.sendMessageToGroup( recipient, message );
}
else
{
jabberClient.sendMessageToUser( recipient, message );
}
}
}
}
catch ( JabberClientException e )
{
throw new NotificationException( "Exception while sending message.", e );
}
finally
{
try
{