1 17 18 package org.apache.james.imapserver.store; 19 20 30 public class MailboxException extends Exception 31 { 32 33 public final static String ALREADY_EXISTS_LOCALLY 34 = "Already exists locally"; 35 public final static String ALREADY_EXISTS_REMOTELY 36 = "Already exists remotely"; 37 public final static String IF_CREATED_LOCAL 38 = "If created, mailbox would be local"; 39 public final static String IF_CREATED_REMOTE 40 = "If created, mailbox would be remote"; 41 public final static String NOT_LOCAL 42 = "Does not exist locally, no further information available"; 43 public final static String LOCAL_BUT_DELETED 44 = "Was local but has been deleted."; 45 46 protected String status = null; 47 protected String remoteServer = null; 48 49 private String responseCode = null; 50 51 56 public MailboxException( String message ) 57 { 58 super( message ); 59 } 60 61 67 public MailboxException( String message, String aStatus ) 68 { 69 super( message ); 70 this.status = aStatus; 71 } 72 73 80 public MailboxException( String message, String aStatus, String aServer ) 81 { 82 super( message ); 83 this.status = aStatus; 84 this.remoteServer = aServer; 85 } 86 87 public String getStatus() 88 { 89 return status; 90 } 91 92 public String getRemoteServer() 93 { 94 return remoteServer; 95 } 96 97 public boolean isRemote() 98 { 99 return ( status.equals( ALREADY_EXISTS_REMOTELY ) 100 || status.equals( IF_CREATED_REMOTE ) ); 101 } 102 103 public String getResponseCode() 104 { 105 return responseCode; 106 } 107 108 public void setResponseCode( String responseCode ) 109 { 110 this.responseCode = responseCode; 111 } 112 } 113 | Popular Tags |