001: /***
002: * jwma Java WebMail
003: * Copyright (c) 2000-2003 jwma team
004: *
005: * jwma is free software; you can distribute and use this source
006: * under the terms of the BSD-style license received along with
007: * the distribution.
008: ***/package dtw.webmail.plugin.std;
009:
010: import java.util.Locale;
011: import dtw.webmail.JwmaKernel;
012: import dtw.webmail.model.JwmaMailIdentityImpl;
013: import dtw.webmail.plugin.RandomAppendPlugin;
014: import dtw.webmail.util.AssociatedAbstractIdentifiable;
015: import org.apache.log4j.Logger;
016: import org.exolab.castor.jdo.TimeStampable;
017:
018: /**
019: * Class implementing a specialized <tt>JwmaMailIdentityImpl</tt>
020: * for being persisted with the Castor Plugins.
021: *
022: * @author Dieter Wimberger
023: * @version 0.9.7 07/02/2003
024: */
025: public class CastorMailIdentity extends AssociatedAbstractIdentifiable
026: implements JwmaMailIdentityImpl, TimeStampable {
027:
028: //logging
029: private static Logger log = Logger
030: .getLogger(CastorMailIdentity.class);
031:
032: //instance attributes
033: private String m_Name = "";
034: private String m_Signature = "";
035: private boolean m_AutoSign = true;
036: private String m_ReplyTo = "";
037: private String m_From = "";
038: private String m_RndAppendType = RandomAppendPlugin.TYPE_NONE;
039: private String m_Note = "";
040: private String m_RelatedContact;
041: private long m_Timestamp = TimeStampable.NO_TIMESTAMP;
042:
043: /**
044: * Constructs a <tt>CastorMailIdentity</tt> instance.
045: */
046: public CastorMailIdentity() {
047: super ();
048: }//constructor
049:
050: public String getName() {
051: return m_Name;
052: }//getName
053:
054: public void setName(String name) {
055: m_Name = name;
056: }//setName
057:
058: public String getReplyTo() {
059: return m_ReplyTo;
060: }//getReplyTo
061:
062: public void setReplyTo(String addr) {
063: m_ReplyTo = addr;
064: }//setReplyTo
065:
066: public String getFrom() {
067: return m_From;
068: }//getFrom
069:
070: public void setFrom(String addr) {
071: m_From = addr;
072: }//setFrom
073:
074: public String getSignature() {
075: return m_Signature;
076: }//getSignature
077:
078: public void setSignature(String sig) {
079: m_Signature = sig;
080: }//setSignature
081:
082: public String getRelatedContact() {
083: return m_RelatedContact;
084: }//getRelatedContact
085:
086: public void setRelatedContact(String uid) {
087: m_RelatedContact = uid;
088: }//setRelatedContact
089:
090: public boolean isAutoSigning() {
091: return m_AutoSign;
092: }//isAutoSigning
093:
094: public void setAutoSigning(boolean b) {
095: m_AutoSign = b;
096: }//setAutoSigning
097:
098: public String getNote() {
099: return m_Note;
100: }//getNote
101:
102: public void setNote(String note) {
103: m_Note = note;
104: }//setNote
105:
106: public String getRandomAppendType() {
107: return m_RndAppendType;
108: }//getRandomAppendType
109:
110: public void setRandomAppendType(String type) {
111: m_RndAppendType = type;
112: }//setRandomAppendType
113:
114: public void setRandomAppendType(String type, Locale loc) {
115: RandomAppendPlugin rap = JwmaKernel.getReference()
116: .getRandomAppendPlugin();
117: if (type == null || type.length() == 0 || rap == null
118: || !rap.supportsAppendType(type, loc)) {
119: m_RndAppendType = RandomAppendPlugin.TYPE_NONE;
120: } else {
121: m_RndAppendType = type;
122: }
123: }//setRandomAppendType
124:
125: public boolean isRandomAppendAllowed() {
126: return (!m_RndAppendType.equals(RandomAppendPlugin.TYPE_NONE));
127: }//isRandomAppendAllowed
128:
129: public long jdoGetTimeStamp() {
130: return m_Timestamp;
131: }//jdoGetTimeStamp
132:
133: public void jdoSetTimeStamp(long timeStamp) {
134: m_Timestamp = timeStamp;
135: }//jdoSetTimeStamp
136:
137: }//CastorMailIdentity
|