use of com.ctrip.xpipe.redis.console.alert.decorator.Decorator in project x-pipe by ctripcorp.
the class DecoratorManager method generateTitleAndContent.
public Pair<String, String> generateTitleAndContent(Map<ALERT_TYPE, Set<AlertEntity>> alerts) {
Decorator decorator = decorators.get(ScheduledAlertMessageDecorator.ID);
ScheduledAlertMessageDecorator scheduledDecorator = (ScheduledAlertMessageDecorator) decorator;
String content = scheduledDecorator.generateBody(alerts);
String title = scheduledDecorator.generateTitle();
return new Pair<>(title, content);
}
use of com.ctrip.xpipe.redis.console.alert.decorator.Decorator in project x-pipe by ctripcorp.
the class DecoratorManager method generateTitleAndContent.
/* There's another option to generate content for recover message
So the @param isAlertMessage is the pivot to switch between two phases
*/
public Pair<String, String> generateTitleAndContent(AlertEntity alert, boolean isAlertMessage) {
Decorator decorator = getDecorator(isAlertMessage);
String content = decorator.generateContent(alert);
String title = decorator.generateTitle(alert);
return new Pair<>(title, content);
}
Aggregations