Search in sources :

Example 36 with TextStringBuilder

use of org.apache.commons.text.TextStringBuilder in project gobblin by apache.

the class AutomaticTroubleshooterImpl method getIssueSummaryMessage.

@Override
public String getIssueSummaryMessage() throws TroubleshooterException {
    List<Issue> issues = issueRepository.getAll();
    TextStringBuilder sb = new TextStringBuilder();
    sb.appendln("");
    sb.appendln("vvvvv============= Issues (summary) =============vvvvv");
    for (int i = 0; i < issues.size(); i++) {
        Issue issue = issues.get(i);
        sb.appendln("%s) %s %s %s | source: %s", i + 1, issue.getSeverity().toString(), issue.getCode(), issue.getSummary(), issue.getSourceClass());
    }
    sb.append("^^^^^=============================================^^^^^");
    return sb.toString();
}
Also used : Issue(org.apache.gobblin.runtime.troubleshooter.Issue) TextStringBuilder(org.apache.commons.text.TextStringBuilder)

Example 37 with TextStringBuilder

use of org.apache.commons.text.TextStringBuilder in project gobblin by apache.

the class AutomaticTroubleshooterImpl method getIssueDetailsMessage.

@Override
public String getIssueDetailsMessage() throws TroubleshooterException {
    List<Issue> issues = issueRepository.getAll();
    TextStringBuilder sb = new TextStringBuilder();
    sb.appendln("");
    sb.appendln("vvvvv============= Issues (detailed) =============vvvvv");
    for (int i = 0; i < issues.size(); i++) {
        Issue issue = issues.get(i);
        sb.appendln("%s) %s %s %s", i + 1, issue.getSeverity().toString(), issue.getCode(), issue.getSummary());
        sb.appendln("\tsource: %s", issue.getSourceClass());
        if (issue.getDetails() != null) {
            sb.appendln("\t" + issue.getDetails().replaceAll(System.lineSeparator(), System.lineSeparator() + "\t"));
        }
        if (issue.getProperties() != null) {
            issue.getProperties().forEach((key, value) -> {
                sb.appendln("\t%s: %s", key, value);
            });
        }
    }
    sb.append("^^^^^================================================^^^^^");
    return sb.toString();
}
Also used : Issue(org.apache.gobblin.runtime.troubleshooter.Issue) TextStringBuilder(org.apache.commons.text.TextStringBuilder)

Aggregations

TextStringBuilder (org.apache.commons.text.TextStringBuilder)37 PreparedStatement (java.sql.PreparedStatement)4 ResultSet (java.sql.ResultSet)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Issue (org.apache.gobblin.runtime.troubleshooter.Issue)4 QueryStatement (com.djrapitops.plan.storage.database.queries.QueryStatement)3 Nullable (javax.annotation.Nullable)3 StringTokenizer (org.apache.commons.text.StringTokenizer)3 Test (org.junit.jupiter.api.Test)3 ServerUUID (com.djrapitops.plan.identification.ServerUUID)2 com.haulmont.cuba.core.global (com.haulmont.cuba.core.global)2 SecurityJpqlGenerator (com.haulmont.cuba.core.global.filter.SecurityJpqlGenerator)2 ConditionsTree (com.haulmont.cuba.gui.components.filter.ConditionsTree)2 FakeFilterSupport (com.haulmont.cuba.gui.components.filter.FakeFilterSupport)2 FilterParser (com.haulmont.cuba.gui.components.filter.FilterParser)2 FilterEditor (com.haulmont.cuba.gui.components.filter.edit.FilterEditor)2 FilterEntity (com.haulmont.cuba.security.entity.FilterEntity)2 ComponentBuilder (net.md_5.bungee.api.chat.ComponentBuilder)2 HoverEvent (net.md_5.bungee.api.chat.HoverEvent)2