public ProblemSet validateNotification(String deploymentName, String notificationName) { NodeFilter filter = new NodeFilter() .setDeployment(deploymentName) .setNotification(notificationName); return validateService.validateMatchingFilter(filter); }
public ProblemSet validateNotification(String deploymentName, String notificationName) { NodeFilter filter = new NodeFilter() .setDeployment(deploymentName) .setNotification(notificationName); return validateService.validateMatchingFilter(filter); }
public Notification getNotification(String deploymentName, String notificationName) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setNotification(notificationName); List<Notification> matching = lookupService.getMatchingNodesOfType(filter, Notification.class); switch (matching.size()) { case 0: throw new ConfigNotFoundException(new ConfigProblemBuilder(Severity.FATAL, "No notification type with name \"" + notificationName + "\" could be found").build()); case 1: return matching.get(0); default: throw new IllegalConfigException(new ConfigProblemBuilder(Severity.FATAL, "More than one notification type with name \"" + notificationName + "\" found").build()); } }
public Notification getNotification(String deploymentName, String notificationName) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setNotification(notificationName); List<Notification> matching = lookupService.getMatchingNodesOfType(filter, Notification.class); switch (matching.size()) { case 0: throw new ConfigNotFoundException(new ConfigProblemBuilder(Severity.FATAL, "No notification type with name \"" + notificationName + "\" could be found").build()); case 1: return matching.get(0); default: throw new IllegalConfigException(new ConfigProblemBuilder(Severity.FATAL, "More than one notification type with name \"" + notificationName + "\" found").build()); } }