1 17 18 package org.apache.james.imapserver; 19 20 30 public class MailboxException extends Exception { 31 32 public final static String ALREADY_EXISTS_LOCALLY 33 = "Already exists locally"; 34 public final static String ALREADY_EXISTS_REMOTELY 35 = "Already exists remotely"; 36 public final static String IF_CREATED_LOCAL 37 = "If created, mailbox would be local"; 38 public final static String IF_CREATED_REMOTE 39 = "If created, mailbox would be remote"; 40 public final static String NOT_LOCAL 41 = "Does not exist locally, no further information available"; 42 public final static String LOCAL_BUT_DELETED 43 = "Was local but has been deleted."; 44 45 protected String status = null; 46 protected String remoteServer = null; 47 48 53 public MailboxException(String message) { 54 super(message); 55 } 56 57 63 public MailboxException(String message, String aStatus) { 64 super(message); 65 this.status = aStatus; 66 } 67 68 75 public MailboxException(String message, String aStatus, String aServer) { 76 super(message); 77 this.status = aStatus; 78 this.remoteServer = aServer; 79 } 80 81 public String getStatus() { 82 return status; 83 } 84 85 public String getRemoteServer() { 86 return remoteServer; 87 } 88 89 public boolean isRemote() { 90 return ( status.equals(ALREADY_EXISTS_REMOTELY) 91 || status.equals(IF_CREATED_REMOTE) ) ; 92 } 93 } 94 | Popular Tags |