1 18 19 20 package sync4j.framework.core; 21 22 import java.util.Hashtable ; 23 24 32 public final class StatusCode { 33 34 public static final int IN_PROGRESS = 101; 35 public static final int OK = 200; 36 public static final int ITEM_ADDED = 201; 37 public static final int ACCEPTED_FOR_PROCESSING = 202; 38 public static final int NONAUTHORITATIVE_RESPONSE = 203; 39 public static final int NO_CONTENT = 204; 40 public static final int RESET_CONTENT = 205; 41 public static final int PARTIAL_CONTENT = 206; 42 public static final int CONFLICT_RESOLVED_WITH_MERGE = 207; 43 public static final int CONFLICT_RESOLVED_WITH_CLIENT_COMMAND_WINNING = 208; 44 public static final int CONFLICT_RESOLVED_WITH_DUPLICATE = 209; 45 public static final int DELETE_WITHOUT_ARCHIVE = 210; 46 public static final int ITEM_NOT_DELETED = 211; 47 public static final int AUTHENTICATION_ACCEPTED = 212; 48 public static final int CHUNKED_ITEM_ACCEPTED = 213; 49 public static final int OPERATION_CANCELLED_OK = 214; 50 public static final int NOT_EXECUTED = 215; 51 public static final int ATOMIC_ROLLBACK_OK = 216; 52 public static final int MULTIPLE_CHOICES = 300; 53 public static final int MOVED_PERMANENTLY = 301; 54 public static final int FOUND = 302; 55 public static final int SEE_ANOTHER_URI = 303; 56 public static final int NOT_MODIFIED = 304; 57 public static final int USE_PROXY = 305; 58 public static final int BAD_REQUEST = 400; 59 public static final int INVALID_CREDENTIALS = 401; 60 public static final int PAYMENT_REQUIRED = 402; 61 public static final int FORBIDDEN = 403; 62 public static final int NOT_FOUND = 404; 63 public static final int COMMAND_NOT_ALLOWED = 405; 64 public static final int OPTIONAL_FEATURE_NOT_SUPPORTED = 406; 65 public static final int MISSING_CREDENTIALS = 407; 66 public static final int REQUEST_TIMEOUT = 408; 67 public static final int UPDATE_CONFLICT = 409; 68 public static final int GONE = 410; 69 public static final int SIZE_REQUIRED = 411; 70 public static final int INCOMPLETE_COMMAND = 412; 71 public static final int REQUESTED_ENTITY_TOO_LARGE = 413; 72 public static final int URI_TOO_LONG = 414; 73 public static final int UNSUPPORTED_MEDIA_TYPE = 415; 74 public static final int REQUESTED_SIZE_TOO_BIG = 416; 75 public static final int RETRY_LATER = 417; 76 public static final int ALREADY_EXISTS = 418; 77 public static final int CONFLICT_RESOLVED_WITH_SERVER_DATA = 419; 78 public static final int DEVICE_FULL = 420; 79 public static final int UNKNOWN_SEARCH_GRAMMAR = 421; 80 public static final int BAD_CGI_SCRIPT = 422; 81 public static final int SOFT_DELETE_CONFLICT = 423; 82 public static final int OBJECT_SIZE_MISMATCH = 424; 83 public static final int PERMISSION_DENIED = 425; 84 public static final int COMMAND_FAILED = 500; 85 public static final int COMMAND_NOT_IMPLEMENTED = 501; 86 public static final int BAD_GATEWAY = 502; 87 public static final int SERVICE_UNAVAILABLE = 503; 88 public static final int GATEWAY_TIMEOUT = 504; 89 public static final int VERSION_NOT_SUPPORTED = 505; 90 public static final int PROCESSING_ERROR = 506; 91 public static final int ATOMIC_FAILED = 507; 92 public static final int REFRESH_REQUIRED = 508; 93 public static final int RECIPIENT_EXCEPTION_RESERVED1 = 509; 94 public static final int DATASTORE_FAILURE = 510; 95 public static final int SERVER_FAILURE = 511; 96 public static final int SYNCHRONIZATION_FAILED = 512; 97 public static final int PROTOCOL_VERSION_NOT_SUPPORTED = 513; 98 public static final int OPERATION_CANCELLED = 514; 99 public static final int ATOMIC_ROLLBACK_FAILED = 516; 100 public static final int ATOMIC_RESPONSE_TOO_LARGE_TO_FIT = 517; 101 102 106 public static final int SESSION_EXPIRED = 10000; 107 public static final int SESSION_ABORTED = 20000; 108 109 private static Hashtable descriptions = null; 110 111 static { 112 descriptions = new Hashtable (71); 113 114 descriptions.put(new Integer (IN_PROGRESS ), "IN PROGRESS" ); 115 descriptions.put(new Integer (OK ), "OK" ); 116 descriptions.put(new Integer (ITEM_ADDED ), "ITEM ADDED" ); 117 descriptions.put(new Integer (ACCEPTED_FOR_PROCESSING ), "ACCEPTED FOR PROCESSING" ); 118 descriptions.put(new Integer (NONAUTHORITATIVE_RESPONSE ), "NONAUTHORITATIVE RESPONSE" ); 119 descriptions.put(new Integer (NO_CONTENT ), "NO CONTENT" ); 120 descriptions.put(new Integer (RESET_CONTENT ), "RESET CONTENT" ); 121 descriptions.put(new Integer (PARTIAL_CONTENT ), "PARTIAL CONTENT" ); 122 descriptions.put(new Integer (CONFLICT_RESOLVED_WITH_MERGE ), "CONFLICT RESOLVED WITH MERGE" ); 123 descriptions.put(new Integer (CONFLICT_RESOLVED_WITH_CLIENT_COMMAND_WINNING), "CONFLICT RESOLVED WITH CLIENT COMMAND WINNING"); 124 descriptions.put(new Integer (CONFLICT_RESOLVED_WITH_DUPLICATE ), "CONFLICT RESOLVED WITH DUPLICATE" ); 125 descriptions.put(new Integer (DELETE_WITHOUT_ARCHIVE ), "DELETE WITHOUT ARCHIVE" ); 126 descriptions.put(new Integer (ITEM_NOT_DELETED ), "ITEM NOT DELETED" ); 127 descriptions.put(new Integer (AUTHENTICATION_ACCEPTED ), "AUTHENTICATION ACCEPTED" ); 128 descriptions.put(new Integer (CHUNKED_ITEM_ACCEPTED ), "CHUNKED_ITEM_ACCEPTED" ); 129 descriptions.put(new Integer (OPERATION_CANCELLED_OK ), "OPERATION_CANCELLED_OK" ); 130 descriptions.put(new Integer (NOT_EXECUTED ), "NOT_EXECUTED" ); 131 descriptions.put(new Integer (ATOMIC_ROLLBACK_OK ), "ATOMIC_ROLLBACK_OK" ); 132 descriptions.put(new Integer (MULTIPLE_CHOICES ), "MULTIPLE CHOICES" ); 133 descriptions.put(new Integer (MOVED_PERMANENTLY ), "MOVED PERMANENTLY" ); 134 descriptions.put(new Integer (FOUND ), "FOUND" ); 135 descriptions.put(new Integer (SEE_ANOTHER_URI ), "SEE ANOTHER URI" ); 136 descriptions.put(new Integer (NOT_MODIFIED ), "NOT MODIFIED" ); 137 descriptions.put(new Integer (USE_PROXY ), "USE PROXY" ); 138 descriptions.put(new Integer (BAD_REQUEST ), "BAD REQUEST" ); 139 descriptions.put(new Integer (INVALID_CREDENTIALS ), "INVALID CREDENTIALS" ); 140 descriptions.put(new Integer (PAYMENT_REQUIRED ), "PAYMENT REQUIRED" ); 141 descriptions.put(new Integer (FORBIDDEN ), "FORBIDDEN" ); 142 descriptions.put(new Integer (NOT_FOUND ), "NOT FOUND" ); 143 descriptions.put(new Integer (COMMAND_NOT_ALLOWED ), "COMMAND NOT ALLOWED" ); 144 descriptions.put(new Integer (OPTIONAL_FEATURE_NOT_SUPPORTED ), "OPTIONAL FEATURE NOT SUPPORTED" ); 145 descriptions.put(new Integer (MISSING_CREDENTIALS ), "MISSING CREDENTIALS" ); 146 descriptions.put(new Integer (REQUEST_TIMEOUT ), "REQUEST TIMEOUT" ); 147 descriptions.put(new Integer (UPDATE_CONFLICT ), "UPDATE CONFLICT" ); 148 descriptions.put(new Integer (GONE ), "GONE" ); 149 descriptions.put(new Integer (SIZE_REQUIRED ), "SIZE REQUIRED" ); 150 descriptions.put(new Integer (INCOMPLETE_COMMAND ), "INCOMPLETE COMMAND" ); 151 descriptions.put(new Integer (REQUESTED_ENTITY_TOO_LARGE ), "REQUESTED ENTITY TOO LARGE" ); 152 descriptions.put(new Integer (URI_TOO_LONG ), "URI TOO LONG" ); 153 descriptions.put(new Integer (UNSUPPORTED_MEDIA_TYPE ), "UNSUPPORTED MEDIA TYPE" ); 154 descriptions.put(new Integer (REQUESTED_SIZE_TOO_BIG ), "REQUESTED SIZE TOO BIG" ); 155 descriptions.put(new Integer (RETRY_LATER ), "RETRY LATER" ); 156 descriptions.put(new Integer (ALREADY_EXISTS ), "ALREADY EXISTS" ); 157 descriptions.put(new Integer (CONFLICT_RESOLVED_WITH_SERVER_DATA ), "CONFLICT RESOLVED WITH SERVER DATA" ); 158 descriptions.put(new Integer (DEVICE_FULL ), "DEVICE FULL" ); 159 descriptions.put(new Integer (UNKNOWN_SEARCH_GRAMMAR ), "UNKNOWN SEARCH GRAMMAR" ); 160 descriptions.put(new Integer (BAD_CGI_SCRIPT ), "BAD CGI SCRIPT" ); 161 descriptions.put(new Integer (SOFT_DELETE_CONFLICT ), "SOFT DELETE CONFLICT" ); 162 descriptions.put(new Integer (OBJECT_SIZE_MISMATCH ), "OBJECT_SIZE_MISMATCH" ); 163 descriptions.put(new Integer (PERMISSION_DENIED ), "PERMISSION_DENIED" ); 164 descriptions.put(new Integer (COMMAND_FAILED ), "COMMAND FAILED" ); 165 descriptions.put(new Integer (COMMAND_NOT_IMPLEMENTED ), "COMMAND NOT IMPLEMENTED" ); 166 descriptions.put(new Integer (BAD_GATEWAY ), "BAD GATEWAY" ); 167 descriptions.put(new Integer (SERVICE_UNAVAILABLE ), "SERVICE UNAVAILABLE" ); 168 descriptions.put(new Integer (GATEWAY_TIMEOUT ), "GATEWAY TIMEOUT" ); 169 descriptions.put(new Integer (VERSION_NOT_SUPPORTED ), "VERSION NOT SUPPORTED" ); 170 descriptions.put(new Integer (PROCESSING_ERROR ), "PROCESSING ERROR" ); 171 descriptions.put(new Integer (ATOMIC_FAILED ), "ATOMIC FAILED" ); 172 descriptions.put(new Integer (REFRESH_REQUIRED ), "REFRESH REQUIRED" ); 173 descriptions.put(new Integer (RECIPIENT_EXCEPTION_RESERVED1 ), "RECIPIENT EXCEPTION RESERVED1" ); 174 descriptions.put(new Integer (DATASTORE_FAILURE ), "DATASTORE FAILURE" ); 175 descriptions.put(new Integer (SERVER_FAILURE ), "SERVER FAILURE" ); 176 descriptions.put(new Integer (SYNCHRONIZATION_FAILED ), "SYNCHRONIZATION FAILED" ); 177 descriptions.put(new Integer (PROTOCOL_VERSION_NOT_SUPPORTED ), "PROTOCOL VERSION NOT SUPPORTED" ); 178 descriptions.put(new Integer (OPERATION_CANCELLED ), "OPERATION_CANCELLED" ); 179 descriptions.put(new Integer (ATOMIC_ROLLBACK_FAILED ), "ATOMIC_ROLLBACK_FAILED" ); 180 descriptions.put(new Integer (ATOMIC_RESPONSE_TOO_LARGE_TO_FIT ), "ATOMIC_RESPONSE_TOO_LARGE_TO_FIT" ); 181 descriptions.put(new Integer (SESSION_EXPIRED ), "SESSION_EXPIRED" ); 182 descriptions.put(new Integer (SESSION_ABORTED ), "SESSION_ABORTED" ); 183 } 184 185 190 public static String getStatusDescription(int code) { 191 return (String )descriptions.get(new Integer (code)); 192 } 193 194 201 private StatusCode() 202 { 203 } 204 205 } | Popular Tags |