Package com.seyren.core.exception

Examples of com.seyren.core.exception.NotificationFailedException


                    .withMessage(emailHelper.createBody(check, subscription, alerts));
           
            mailSender.send(createMimeMessage(email));
           
        } catch (Exception e) {
            throw new NotificationFailedException("Failed to send notification to " + subscription.getTarget() + " from " + seyrenConfig.getSmtpFrom(), e);
        }
       
    }
View Full Code Here


            for (String channel : channels) {
                String message = createMessage(check);
                sendMessage(seyrenConfig.getIrcCatHost(), seyrenConfig.getIrcCatPort(), message, channel);
            }
        } catch (IOException ioe) {
            throw new NotificationFailedException("Could not send message", ioe);
        }
    }
View Full Code Here

           
            HttpResponse response=client.execute(post);
            if(response.getStatusLine().getStatusCode()/100 != 2)
                throw new IOException("API request failed: "+response.getStatusLine());
        } catch (IOException e) {
            throw new NotificationFailedException("Sending notification to Twilio at " + twilioUrl + " failed.", e);
        } finally {
            HttpClientUtils.closeQuietly(client);
        }
    }
View Full Code Here

                result = pagerDuty.notify(resolution);
            } else {
                LOGGER.warn("Did not send notification to PagerDuty for check in state: {}", check.getState());
            }
        } catch (Exception e) {
            throw new NotificationFailedException("Failed to send notification to PagerDuty", e);
        }

        if (result != null && !"success".equals(result.status())) {
            throw new NotificationFailedException("Failed to send notification to PagerDuty: '" + result.status() + "', " + result.message());
        }
    }
View Full Code Here

            HttpEntity responseEntity = response.getEntity();
            if(responseEntity!=null) {
                LOGGER.info("Response : {} ", EntityUtils.toString(responseEntity));
            }
        } catch (Exception e) {
            throw new NotificationFailedException("Failed to send notification to HTTP", e);
        } finally {
            post.releaseConnection();
            HttpClientUtils.closeQuietly(client);
        }
    }
View Full Code Here

            nameValuePairs.add(new BasicNameValuePair("priority", pushoverMsgPriority));

            post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
            client.execute(post);
        } catch (IOException e) {
            throw new NotificationFailedException("Sending notification to Pushover failed.", e);
        } finally {
            HttpClientUtils.closeQuietly(client);
        }
    }
View Full Code Here

        try {
            HttpEntity entity = new StringEntity(MAPPER.writeValueAsString(body), ContentType.APPLICATION_JSON);
            post.setEntity(entity);
            client.execute(post);
        } catch (IOException e) {
            throw new NotificationFailedException("Sending notification to Hubot at " + hubotUrl + " failed.", e);
        } finally {
            HttpClientUtils.closeQuietly(client);
        }
    }
View Full Code Here

                sendMessage(message, MessageColor.GREEN, roomIds, from, token, true);
            } else {
                LOGGER.warn("Did not send notification to HipChat for check in state: {}", check.getState());
            }
        } catch (Exception e) {
            throw new NotificationFailedException("Failed to send notification to HipChat", e);
        }
    }
View Full Code Here

                snmp.send(trap, target, null, null);
            } else {
                LOGGER.info("Seyren notification failed for {} because the Snmp instance was null", check.getName());
            }
        } catch (IOException e) {
            throw new NotificationFailedException("Sending notification via SNMP trap failed.", e);
        }
    }
View Full Code Here

    private Snmp createSnmpConnection() {
        try {
            return new Snmp(new DefaultUdpTransportMapping());
        } catch (IOException e) {
            throw new NotificationFailedException("Sending notification via SNMP trap failed.", e);
        }
    }
View Full Code Here

TOP

Related Classes of com.seyren.core.exception.NotificationFailedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.