com.knowgate.hipermail
Class DBInetAddr

java.lang.Object
  extended byjavax.mail.Address
      extended byjavax.mail.internet.InternetAddress
          extended bycom.knowgate.hipermail.DBInetAddr
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class DBInetAddr
extends javax.mail.internet.InternetAddress

Internet Address register from k_inet_addrs

Version:
2.1
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.mail.internet.InternetAddress
address, encodedPersonal, personal
 
Constructor Summary
DBInetAddr(java.lang.String sMsgGUID, int iPart)
           
DBInetAddr(java.lang.String sMsgGUID, java.lang.String sMsgId, java.lang.String sTxEMail, java.lang.String sTxPersonal, java.lang.String sTpRecipient, java.lang.String sGuUser, java.lang.String sGuContact, java.lang.String sGuCompany)
          Constructor
 
Method Summary
 boolean equals(java.lang.Object oOtherAddr)
          Two addresses are equal if they hold the same e-mail
 java.lang.String getAddress()
          Get e-mail address
 java.lang.String getPersonal()
          Get display (personal) name
 java.lang.String getString(java.lang.String sKey)
           
 java.lang.String getStringNull(java.lang.String sKey, java.lang.String sDefault)
           
 java.lang.String getType()
           
static javax.mail.internet.InternetAddress parseAddress(java.lang.String sNamePlusEMail)
          Parse address of the form (Name) , (Name), "Name" , "Name", Name , , user@domain.com
 boolean store(JDCConnection oConn)
          This method is unsupported and will always throw an exception when called
 java.lang.String toString()
          Get Display name concatenated with e-mail into angles
 boolean write(JDCConnection oConn, int iDomainId, java.lang.String sWorkAreaId)
          Forward call to static method DBInetAddr.write()
static boolean write(JDCConnection oConn, int iDomainId, java.lang.String sWorkAreaId, java.lang.String sGuMimeMsg, java.lang.String sIdMimeMsg, java.lang.String sTxEMail, java.lang.String sTpRecipient, java.lang.String sTxPersonal)
          Write address resolving e-mails to contact and company GUIDs
 
Methods inherited from class javax.mail.internet.InternetAddress
clone, getLocalAddress, hashCode, parse, parse, setAddress, setPersonal, setPersonal, toString, toString, toUnicodeString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DBInetAddr

public DBInetAddr(java.lang.String sMsgGUID,
                  int iPart)

DBInetAddr

public DBInetAddr(java.lang.String sMsgGUID,
                  java.lang.String sMsgId,
                  java.lang.String sTxEMail,
                  java.lang.String sTxPersonal,
                  java.lang.String sTpRecipient,
                  java.lang.String sGuUser,
                  java.lang.String sGuContact,
                  java.lang.String sGuCompany)
           throws java.lang.NullPointerException,
                  java.lang.IllegalArgumentException
Constructor

Parameters:
sMsgGUID - Message GUID
sMsgId - Mime Message Identifier
sTxEMail - Mail address
sTxPersonal - Address displyed name
sTpRecipient - Recipient type { from, to, cc, bcc } case sensitive
sGuUser - GUID of User which tx_main_email is the same as this address
sGuContact - GUID of Contact which tx_main_email is the same as this address
sGuCompany - GUID of Copany which tx_main_email is the same as this address
Throws:
java.lang.NullPointerException - If sMsgGUID or sMsgId or sTxEMail or sTpRecipient is null.
java.lang.IllegalArgumentException - If sTpRecipient is not one of { from, to, cc, bcc }
Method Detail

getAddress

public java.lang.String getAddress()
Get e-mail address

Returns:
String

getString

public java.lang.String getString(java.lang.String sKey)

getStringNull

public java.lang.String getStringNull(java.lang.String sKey,
                                      java.lang.String sDefault)

equals

public boolean equals(java.lang.Object oOtherAddr)
               throws java.lang.ClassCastException
Two addresses are equal if they hold the same e-mail

Parameters:
oOtherAddr - DBInetAddr
Returns:
boolean true if e-mail of this is equal to e-mail of oOtherAddr (case insensitive comparison)
Throws:
java.lang.ClassCastException - if oOtherAddr is not of type DBInetAddr

getType

public java.lang.String getType()
Returns:
String "rfc822"

getPersonal

public java.lang.String getPersonal()
Get display (personal) name

Returns:
String

store

public boolean store(JDCConnection oConn)
              throws java.lang.UnsupportedOperationException
This method is unsupported and will always throw an exception when called

Throws:
java.lang.UnsupportedOperationException

write

public static boolean write(JDCConnection oConn,
                            int iDomainId,
                            java.lang.String sWorkAreaId,
                            java.lang.String sGuMimeMsg,
                            java.lang.String sIdMimeMsg,
                            java.lang.String sTxEMail,
                            java.lang.String sTpRecipient,
                            java.lang.String sTxPersonal)
                     throws java.sql.SQLException

Write address resolving e-mails to contact and company GUIDs

This method writes to k_inet_addr table but it first lookup the given e-mail at table k_member_address and fills gu_contact and gu_company fields of k_inet_addr if there is a contact or company at the specified workarea that has that e-mail

Parameters:
oConn - JDCConnection
iDomainId - int Domain Identifier
sWorkAreaId - String WorkArea GUID (search for matches will be restricted to this WorkArea)
sGuMimeMsg - String Message GUID
sIdMimeMsg - String Message Identifier
sTxEMail - String e-mail
sTpRecipient - String One of {to, cc, bcc}
sTxPersonal - String Display Name
Returns:
boolean true
Throws:
java.sql.SQLException

write

public boolean write(JDCConnection oConn,
                     int iDomainId,
                     java.lang.String sWorkAreaId)
              throws java.sql.SQLException

Forward call to static method DBInetAddr.write()

Parameters:
oConn - JDCConnection
iDomainId - int Domain Identifier
sWorkAreaId - String WorkArea GUID (search for matches will be restricted to this WorkArea)
Returns:
boolean true
Throws:
java.sql.SQLException

parseAddress

public static javax.mail.internet.InternetAddress parseAddress(java.lang.String sNamePlusEMail)
                                                        throws javax.mail.internet.AddressException,
                                                               java.lang.NullPointerException,
                                                               java.io.UnsupportedEncodingException
Parse address of the form (Name) , (Name), "Name" , "Name", Name , , user@domain.com

Parameters:
sNamePlusEMail - String Display name and e-mail address
Returns:
InternetAddress
Throws:
javax.mail.internet.AddressException
java.lang.NullPointerException
java.io.UnsupportedEncodingException

toString

public java.lang.String toString()
Get Display name concatenated with e-mail into angles

Returns:
String "Personal Name "