public class DistributionList extends DBPersist
Distribution List
Modifier and Type | Field and Description |
---|---|
static short |
ClassId |
static short |
TYPE_BLACK |
static short |
TYPE_DIRECT |
static short |
TYPE_DYNAMIC |
static short |
TYPE_STATIC |
Constructor and Description |
---|
DistributionList() |
DistributionList(JDCConnection oConn,
java.lang.String sListGUID)
Create and load distribution list
|
DistributionList(JDCConnection oConn,
java.lang.String sListDesc,
java.lang.String sWorkAreaGUID)
Create a distribution list and load its by name
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
activeCompanies(JDCConnection oConn)
Get GUIDs for all active companies
|
java.lang.String |
activeContacts(JDCConnection oConn)
Get GUIDs for all active contacts
|
java.lang.String |
activeMembers(JDCConnection oConn)
Get e-mail address for all active members
|
int |
addCompany(java.sql.Connection oConn,
java.lang.String sCompanyGUID)
Add Contact e-mails to Static, Direct or Black List
If Contact has several addresses then all of them are added to the list
|
int |
addContact(java.sql.Connection oConn,
java.lang.String sContactGUID)
Add Contact e-mails to Static, Direct or Black List
If Contact has several addresses then all of them are added to the list
|
void |
append(JDCConnection oConn,
java.lang.String sListGUID)
Append members of a list to this DistributionList.
|
java.lang.String |
blackList(JDCConnection oConn)
Get associated Black List GUID
The Black List is that witch tp_list=BLACK_LIST AND gu_query=this.gu_list
|
java.lang.String |
clone(JDCConnection oConn)
Clone this DistributionList.
|
boolean |
contains(JDCConnection oConn,
java.lang.String sMember)
Find out if list contains a particular member
Member is searched at k_x_list_members table either at gu_company and
gu_contact or tx_email.
|
boolean |
delete(JDCConnection oConn)
Delete a register from database
The deleted register will be the one matching this DBPersist primary key,
as set at constructor or load() method.
|
static boolean |
delete(JDCConnection oConn,
java.lang.String sListGUID)
Delete Distribution List
Call k_sp_del_list stored procedure.
|
int |
deleteDuplicates(JDCConnection oConn)
Delete duplicated e-mails from a static or direct list.
|
boolean |
load(JDCConnection oConn,
java.lang.Object[] PKVals)
Load the internal value set from a register at a database table
|
boolean |
load(JDCConnection oConn,
java.lang.String sGuList)
Load the internal value set from a register at a database table
|
int |
memberCount(JDCConnection oConn)
Count active members of this list
|
void |
overwrite(JDCConnection oConn,
java.lang.String sListGUID)
Overwrite members of this DistributionList with members of given DistributionList.
|
java.lang.String |
print(JDCConnection oConn,
boolean bPrintHeader)
Print List Members to a String.
|
boolean |
store(JDCConnection oConn)
Store DistributionList
Automatically generates gu_list GUID if not explicitly set.
|
void |
substract(JDCConnection oConn,
java.lang.String sListGUID)
Remove from this DistributionList those members present at given DistributionList.
|
allcaps, allcaps, clear, clone, columns, containsKey, containsValue, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDate, getDateFormated, getDateShort, getDateTime, getDateTime24, getDecimal, getDecimalFormated, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getIntArray, getInteger, getIntegerArray, getIntervalPart, getItemMap, getItems, getMoney, getPrimaryKey, getShort, getSQLDate, getSQLTime, getString, getStringHtml, getStringNull, getTable, getTable, getTime, getTimeOfDay, getTimestamp, isEmpty, isNull, iterator, keySet, parseXML, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putAll, putAll, remove, remove, replace, replace, replace, replace, replace, replace, replace, replace, setAuditTransact, setAuditUser, setCreationDate, setPrimaryKey, size, toLowerCase, toUpperCase, toXML, toXML, toXML, values
public static final short ClassId
public static final short TYPE_STATIC
public static final short TYPE_DYNAMIC
public static final short TYPE_DIRECT
public static final short TYPE_BLACK
public DistributionList()
public DistributionList(JDCConnection oConn, java.lang.String sListGUID) throws java.sql.SQLException
oConn
- JDCConnection HDBC ConnectionsListGUID
- String List GUIDjava.sql.SQLException
public DistributionList(JDCConnection oConn, java.lang.String sListDesc, java.lang.String sWorkAreaGUID) throws java.sql.SQLException
oConn
- JDCConnection JDBC ConnectionsListDesc
- String List DescriptionsWorkAreaGUID
- String GUID of WorkArea to which list belongsjava.sql.SQLException
public int memberCount(JDCConnection oConn) throws java.sql.SQLException
oConn
- JDBC Database Connectionjava.sql.SQLException
public java.lang.String activeMembers(JDCConnection oConn) throws java.sql.SQLException, java.lang.IllegalStateException
oConn
- JDBC Database Connectionjava.sql.SQLException
java.lang.IllegalStateException
public java.lang.String activeContacts(JDCConnection oConn) throws java.sql.SQLException
oConn
- JDBC Database Connectionjava.sql.SQLException
public java.lang.String activeCompanies(JDCConnection oConn) throws java.sql.SQLException
oConn
- JDBC Database Connectionjava.sql.SQLException
public boolean contains(JDCConnection oConn, java.lang.String sMember) throws java.sql.SQLException
Find out if list contains a particular member
Member is searched at k_x_list_members table either at gu_company and gu_contact or tx_email. If list is Dynamic or Static, member is searched at gu_company and gu_contact. If list is Direct or Black, member is searched at tx_emailoConn
- Database ConnectionsMember
- If this is a Static or Dynamic list then sMember must be the GUID of Contact or Company searched.java.sql.SQLException
public boolean load(JDCConnection oConn, java.lang.Object[] PKVals) throws java.sql.SQLException
DBPersist
Load the internal value set from a register at a database table
public boolean load(JDCConnection oConn, java.lang.String sGuList) throws java.sql.SQLException
DBPersist
Load the internal value set from a register at a database table
public boolean store(JDCConnection oConn) throws java.sql.SQLException
Store DistributionList
Automatically generates gu_list GUID if not explicitly set. If value gu_category is set then this list is added to that category and removed from any previous category to which it belonged.public boolean delete(JDCConnection oConn) throws java.sql.SQLException
DBPersist
Delete a register from database
The deleted register will be the one matching this DBPersist primary key, as set at constructor or load() method.
public java.lang.String blackList(JDCConnection oConn) throws java.sql.SQLException, java.lang.IllegalStateException
Get associated Black List GUID
The Black List is that witch tp_list=BLACK_LIST AND gu_query=this.gu_listoConn
- Database Connectionjava.sql.SQLException
java.lang.IllegalStateException
- if this DistributionList has not been previously loadedpublic int addContact(java.sql.Connection oConn, java.lang.String sContactGUID) throws java.lang.IllegalStateException, java.sql.SQLException
Add Contact e-mails to Static, Direct or Black List
If Contact has several addresses then all of them are added to the listoConn
- Database ConnectionContact
- GUIDjava.sql.SQLException
java.lang.IllegalStateException
- if this DistributionList has not been previously loadedpublic int addCompany(java.sql.Connection oConn, java.lang.String sCompanyGUID) throws java.lang.IllegalStateException, java.sql.SQLException
Add Contact e-mails to Static, Direct or Black List
If Contact has several addresses then all of them are added to the listoConn
- Database ConnectionContact
- GUIDjava.sql.SQLException
java.lang.IllegalStateException
- if this DistributionList has not been previously loadedpublic void append(JDCConnection oConn, java.lang.String sListGUID) throws java.sql.SQLException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.ClassCastException
Append members of a list to this DistributionList.
Members that where already present are not touched. Results are placed at this DistributionList.
oConn
- Database ConnectionsListGUID
- GUID of DistributionList to be appendedjava.sql.SQLException
java.lang.IllegalArgumentException
- If sListGUID==nulljava.lang.IllegalStateException
- If this.gu_list is not setjava.lang.ClassCastException
- If this DistributionList type is DYNAMICpublic void overwrite(JDCConnection oConn, java.lang.String sListGUID) throws java.sql.SQLException, java.lang.IllegalArgumentException, java.lang.ClassCastException, java.lang.IllegalStateException
oConn
- Database Connectionjava.sql.SQLException
java.lang.IllegalArgumentException
- If sListGUID==nulljava.lang.IllegalStateException
- If this.gu_list is not setjava.lang.ClassCastException
- If this DistributionList type is DYNAMICpublic void substract(JDCConnection oConn, java.lang.String sListGUID) throws java.sql.SQLException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.ClassCastException
oConn
- Database Connectionjava.sql.SQLException
java.lang.IllegalArgumentException
- If sListGUID==nulljava.lang.IllegalStateException
- If this.gu_list is not setjava.lang.ClassCastException
- If this DistributionList type is DYNAMICpublic java.lang.String clone(JDCConnection oConn) throws java.sql.SQLException
oConn
- Database Connectionjava.sql.SQLException
public int deleteDuplicates(JDCConnection oConn) throws java.sql.SQLException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException
Delete duplicated e-mails from a static or direct list.
This method calls k_sp_del_duplicates stored procedure for PostgreSQL, MySQL and Microsoft SQL Server. For Oracle a direct DELETE statement is executed using ROWID for removing duplicate e-mails.oConn
- Database Connectionjava.sql.SQLException
- If the list type is not STATIC or DIRECT.java.lang.IllegalStateException
- is this DistributionList has not been previously loadedjava.lang.UnsupportedOperationException
- if the underlying RDBMS is not PostgreSQL, MySQL, SQL Server or Oracle.public java.lang.String print(JDCConnection oConn, boolean bPrintHeader) throws java.sql.SQLException
oConn
- Database ConnectionbPrintHeader
- true if column names are to be printed at first row.java.sql.SQLException
public static boolean delete(JDCConnection oConn, java.lang.String sListGUID) throws java.sql.SQLException
oConn
- Database ConnectionsListGUID
- GUID of DistributionList to be deletedjava.sql.SQLException