1 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 15 19 public class StatusCode implements StatusConstants { 20 private String _status; 21 22 23 public StatusCode() { 24 _status = STATUS_UNKNOWN; 25 } 26 27 public String getStatusCode() { 28 return _status; 29 } 30 31 void setStatus(String 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 toString() { 46 return _status; 47 } 48 } 49 | Popular Tags |