Search in sources :

Example 1 with ProgressStatusEventSet

use of org.glassfish.api.admin.progress.ProgressStatusEventSet in project Payara by payara.

the class ProgressStatusEventJsonProprietaryReader method readProgressStatusEvent.

public static ProgressStatusEvent readProgressStatusEvent(JsonParser jp) throws IOException {
    String id = null;
    JsonToken token = null;
    ProgressStatusEvent result = null;
    while ((token = jp.nextToken()) != JsonToken.END_OBJECT) {
        if (token == JsonToken.START_OBJECT) {
            String nm = jp.getCurrentName();
            if ("set".equals(nm)) {
                result = new ProgressStatusEventSet(id);
                readToPSEventSet((ProgressStatusEventSet) result, jp);
            } else if ("progres".equals(nm)) {
                result = new ProgressStatusEventProgress(id);
                readToPSEventProgress((ProgressStatusEventProgress) result, jp);
            } else if ("complete".equals(nm)) {
                result = new ProgressStatusEventComplete(id);
                readToPSEventComplete((ProgressStatusEventComplete) result, jp);
            } else if ("create-child".equals(nm)) {
                result = new ProgressStatusEventCreateChild(id);
                readToPSEventCreateChild((ProgressStatusEventCreateChild) result, jp);
            }
        } else {
            String fieldname = jp.getCurrentName();
            if ("id".equals(fieldname)) {
                // move to value
                jp.nextToken();
                id = jp.getText();
            }
        }
    }
    return result;
}
Also used : ProgressStatusEventComplete(org.glassfish.api.admin.progress.ProgressStatusEventComplete) ProgressStatusEventCreateChild(org.glassfish.api.admin.progress.ProgressStatusEventCreateChild) ProgressStatusEvent(org.glassfish.api.admin.progress.ProgressStatusEvent) JsonToken(com.fasterxml.jackson.core.JsonToken) ProgressStatusEventProgress(org.glassfish.api.admin.progress.ProgressStatusEventProgress) ProgressStatusEventSet(org.glassfish.api.admin.progress.ProgressStatusEventSet)

Aggregations

JsonToken (com.fasterxml.jackson.core.JsonToken)1 ProgressStatusEvent (org.glassfish.api.admin.progress.ProgressStatusEvent)1 ProgressStatusEventComplete (org.glassfish.api.admin.progress.ProgressStatusEventComplete)1 ProgressStatusEventCreateChild (org.glassfish.api.admin.progress.ProgressStatusEventCreateChild)1 ProgressStatusEventProgress (org.glassfish.api.admin.progress.ProgressStatusEventProgress)1 ProgressStatusEventSet (org.glassfish.api.admin.progress.ProgressStatusEventSet)1