package org.greenstone.gsdl3.util; public class GSStatus { // responses for initial request public static final int SUCCESS = 1; // request succeeded public static final int ACCEPTED = 2; // request accepted but not completed public static final int ERROR = 3; // error and process stopped // responses for status requests public static final int CONTINUING = 10; // request still continuing public static final int COMPLETED = 11; // request finished public static final int HALTED = 12; // process stopped // other public static final int INFO = 20; // just an info message that doesnt mean anything /** returns true if teh code indicates that a process is no longer running */ public static boolean isCompleted(int code) { if (code == SUCCESS || code == ERROR || code == COMPLETED || code == HALTED) { return true; } return false; } // there may be other types of error codes public static boolean isError(int code) { if (code == ERROR) { return true; } return false; } }