Codota Logo
com.ocadotechnology.newrelic.alertsconfigurator.configuration.channel
Code IndexAdd Codota to your IDE (free)

How to use com.ocadotechnology.newrelic.alertsconfigurator.configuration.channel

Best Java code snippets using com.ocadotechnology.newrelic.alertsconfigurator.configuration.channel (Showing top 12 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: ocadotechnology/newrelic-alerts-configurator

public static Channel teamEmailChannel() {
  return EmailChannel.builder()
      .channelName("My Team - email")
      .emailAddress("my-team@my-company.com")
      .includeJsonAttachment(true)
      .build();
}
origin: ocadotechnology/newrelic-alerts-configurator

  public static Channel slackChannel() {
    return SlackChannel.builder()
        .channelName("My Team - slack")
        .slackUrl("https://hooks.slack.com/services/aaaaaaaaa/bbbbbbbbb/cccccccccccccccccccccccc")
        .teamChannel("newrelic-alerts")
        .build();
  }
}
origin: ocadotechnology/newrelic-alerts-configurator

  /**
   * Returns channel type in string format.
   *
   * @return channel type
   */
  default String getTypeString() {
    return getType().name().toLowerCase();
  }
}
origin: ocadotechnology/newrelic-alerts-configurator

private AlertsChannel toAlertsChannel(Channel channel) {
  return AlertsChannel.builder()
    .name(channel.getChannelName())
    .type(channel.getTypeString())
    .configuration(channel.getChannelTypeSupport().generateAlertsChannelConfiguration(api))
    .build();
}
origin: ocadotechnology/newrelic-alerts-configurator

  @Override
  public AlertsChannelConfiguration generateAlertsChannelConfiguration(NewRelicApi api) {
    WebhookChannel webhookChannel = (WebhookChannel) channel;
    return AlertsChannelConfiguration.builder()
        .baseUrl(webhookChannel.getBaseUrl())
        .authUsername(webhookChannel.getAuthUsername())
        .authPassword(webhookChannel.getAuthPassword())
        .build();
  }
}
origin: ocadotechnology/newrelic-alerts-configurator

  @Override
  public AlertsChannelConfiguration generateAlertsChannelConfiguration(NewRelicApi api) {
    SlackChannel slackChannel = (SlackChannel) channel;
    return AlertsChannelConfiguration.builder()
      .url(slackChannel.getSlackUrl())
      .channel(slackChannel.getTeamChannel())
      .build();
  }
}
origin: ocadotechnology/newrelic-alerts-configurator

@Override
public AlertsChannelConfiguration generateAlertsChannelConfiguration(NewRelicApi api) {
  UserChannel userChannel = (UserChannel) channel;
  int userId = getUserId(api, userChannel.getUserEmail());
  AlertsChannelConfiguration.AlertsChannelConfigurationBuilder builder = AlertsChannelConfiguration.builder();
  builder.userId(userId);
  return builder.build();
}
origin: ocadotechnology/newrelic-alerts-configurator

  @Override
  public AlertsChannelConfiguration generateAlertsChannelConfiguration(NewRelicApi api) {
    EmailChannel emailChannel = (EmailChannel) channel;
    AlertsChannelConfiguration.AlertsChannelConfigurationBuilder builder = AlertsChannelConfiguration.builder();
    builder.recipients(emailChannel.getEmailAddress());
    if (BooleanUtils.isTrue(emailChannel.getIncludeJsonAttachment())) {
      builder.includeJsonAttachment(emailChannel.getIncludeJsonAttachment());
    }
    return builder.build();
  }
}
origin: ocadotechnology/newrelic-alerts-configurator

  private static boolean isUserChannel(AlertsChannel channel) {
    String userChannelType = ChannelType.USER.name().toLowerCase();
    return userChannelType.equals(channel.getType());
  }
}
origin: ocadotechnology/newrelic-alerts-configurator

  @Override
  public AlertsChannelConfiguration generateAlertsChannelConfiguration(NewRelicApi api) {
    PagerDutyChannel pagerDutyChannel = (PagerDutyChannel) channel;
    return AlertsChannelConfiguration.builder()
        .serviceKey(pagerDutyChannel.getServiceKey())
        .build();
  }
}
origin: ocadotechnology/newrelic-alerts-configurator

EmailChannel updatedEmailChannel = EmailChannel.builder()
    .channelName(EMAIL_CHANNEL_NAME)
    .emailAddress("different recipients")
    .build();
AlertsChannel updatedEmailAlertChannel = createAlertChannel(updatedEmailChannel);
when(alertsChannelsApiMock.create(updatedEmailAlertChannel))
origin: ocadotechnology/newrelic-alerts-configurator

private AlertsChannel createAlertChannel(Integer id, Channel channel) {
  return AlertsChannel.builder()
      .id(id)
      .name(channel.getChannelName())
      .type(channel.getTypeString())
      .configuration(channel.getChannelTypeSupport().generateAlertsChannelConfiguration(apiMock))
      .links(new AlertsChannelLinks(emptyList()))
      .build();
}
com.ocadotechnology.newrelic.alertsconfigurator.configuration.channel

Most used classes

  • EmailChannel
    Email channel configuration. Configuration parameters: * #channelName * #emailAddress * #includ
  • Channel
    Notification channel configuration. Implementations: * EmailChannel * SlackChannel * PagerDutyC
  • ChannelTypeSupport
    This interface represents support object, that is used to transform implementation of Channel to Ale
  • EmailChannel$EmailChannelBuilder
  • SlackChannel
    Slack channel configuration. Configuration parameters: * #channelName * #slackUrl * #teamChanne
  • PagerDutyChannel,
  • SlackChannel$SlackChannelBuilder,
  • UserChannel,
  • WebhookChannel,
  • UserChannelTypeSupport
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now