public class ApplicationViewHelper {
private static final SimpleDateFormat formatter = new SimpleDateFormat("MMM dd, yyyy hh:mm aaa");
public static boolean isApplicationUp(ApplicationConfig appConfig) {
DowntimeRecorder recorder = ApplicationDowntimeService.getInstance().getDowntimeRecorder();
boolean isUp = true;
if (appConfig.isCluster()) {
for (ApplicationConfig childAppConfig : appConfig.getApplications()) {
if (!recorder.isApplicationUp(childAppConfig)) {
// once an application is detected that is down, there is no need to proceed
// further
isUp = false;
break;
}
}
}
else {
isUp = recorder.isApplicationUp(appConfig);
}
return isUp;
}