KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > config > backup > status > StatusCode


1 /*
2  * StatusCode.java
3  *
4  * Created on December 13, 2000, 6:32 AM
5  */

6
7 package com.sun.enterprise.config.backup.status;
8 import com.sun.enterprise.config.backup.BackupException;
9 import com.sun.enterprise.config.backup.utils.LoggerHelper;
10 import com.sun.enterprise.config.backup.utils.LocalStringsHelper;
11
12 //import i18n UTIL
13
//TBD FIXME
14

15 /**
16  *
17  * @author sridatta
18  */

19 public class StatusCode implements StatusConstants {
20     private String JavaDoc _status;
21     
22     /** Creates a new instance of StatusCode */
23     public StatusCode() {
24         _status = STATUS_UNKNOWN;
25     }
26     
27     public String JavaDoc getStatusCode() {
28         return _status;
29     }
30     
31     void setStatus(String JavaDoc status) throws BackupException {
32         if(status != STATUS_SUCCESS &&
33                 status != STATUS_FAILURE) {
34             throw new BackupException
35                 ("config_backup_wrong_status_code", LocalStringsHelper.getString
36                     ("config_backup_wrong_status_code", status));
37         }
38         _status = status;
39     }
40     
41     public boolean isSuccess() {
42         return (_status == STATUS_SUCCESS);
43     }
44     
45      public String JavaDoc toString() {
46         return _status;
47     }
48 }
49
Popular Tags