source: trunk/gsdl3/src/java/org/greenstone/gsdl3/util/GSStatus.java@ 3676

Last change on this file since 3676 was 3676, checked in by kjdon, 21 years ago

new function to determine if a status code indicates completion

  • Property svn:keywords set to Author Date Id Revision
File size: 1.0 KB
Line 
1package org.greenstone.gsdl3.util;
2
3public class GSStatus {
4
5 // responses for initial request
6 public static final int SUCCESS = 1; // request succeeded
7 public static final int ACCEPTED = 2; // request accepted but not completed
8 public static final int ERROR = 3; // error and process stopped
9
10 // responses for status requests
11 public static final int CONTINUING = 10; // request still continuing
12 public static final int COMPLETED = 11; // request finished
13 public static final int HALTED = 12; // process stopped
14
15 // other
16 public static final int INFO = 20; // just an info message that doesnt mean anything
17
18 /** returns true if teh code indicates that a process is no longer running
19 */
20 public static boolean isCompleted(int code) {
21 if (code == SUCCESS || code == ERROR || code == COMPLETED || code == HALTED) {
22 return true;
23 }
24 return false;
25 }
26
27 // there may be other types of error codes
28 public static boolean isError(int code) {
29 if (code == ERROR) {
30 return true;
31 }
32 return false;
33 }
34
35}
36
Note: See TracBrowser for help on using the repository browser.