Package com.storedobject.job
Class MessageGroup
java.lang.Object
com.storedobject.core.StoredObject
com.storedobject.job.MessageGroup
- All Implemented Interfaces:
Displayable
,StringFiller
,HasId
,RequiresApproval
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static MessageGroup
create
(String name, TransactionManager tm) Create a new message group if it doesn't exist.static MessageGroup
static MessageGroup
getName()
Gets the unique index condition of this object.static int
hints()
static void
static String[]
links()
static ObjectIterator
<MessageGroup> <P extends PersonRole>
List<Contact> listContacts
(int contactType) Get the list of contacts belonging to this message group.static boolean
notify
(String groupName, TransactionManager tm, Object... messageParameters) Create and send a message to all members of this group.void
send
(Person person, TransactionControl tc, Object... messageParameters) Create and send a message to all members of this group and to an additional person.void
send
(Person person, TransactionManager tm, Object... messageParameters) Create and send a message to all members of this group and to an additional person.void
send
(TransactionControl tc, Object... messageParameters) Create and send a message to all members of this group.void
send
(TransactionManager tm, Object... messageParameters) Create and send a message to all members of this group.static void
send
(String groupName, Person person, TransactionControl tc, Object... messageParameters) Create and send a message to all members of this group and to an additional person.static void
send
(String groupName, Person person, TransactionManager tm, Object... messageParameters) Create and send a message to all members of this group and to an additional person.static void
send
(String groupName, TransactionControl tc, Object... messageParameters) Create and send a message to all members of this group.static void
send
(String groupName, TransactionManager tm, Object... messageParameters) Create and send a message to all members of this group.void
void
setTemplate
(Id templateId) void
setTemplate
(MessageTemplate template) void
setTemplate
(BigDecimal idValue) toString()
String representation of the instance.void
This will be invoked by the system whenever the object is saved to the DB.Methods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toDisplay, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateDelete, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
-
Constructor Details
-
MessageGroup
public MessageGroup()
-
-
Method Details
-
columns
-
hints
public static int hints() -
indices
-
getUniqueCondition
Description copied from class:StoredObject
Gets the unique index condition of this object.- Overrides:
getUniqueCondition
in classStoredObject
- Returns:
- Unique index condition.
-
getFor
-
get
-
list
-
links
-
setName
-
getName
-
setTemplate
-
setTemplate
-
setTemplate
-
getTemplateId
-
getTemplate
-
validateData
Description copied from class:StoredObject
This will be invoked by the system whenever the object is saved to the DB. It will be invoked in all cases, while creating new objects and updating/deleting/un-deleting existing objects. If any exception is raised by this method, the process of saving to the DB will be abandoned.
Note: This method is mainly used to validate the data of all attributes of the object, and it may be used by others for validating the object. For example, front-end data-entry systems can use this method for validating the object.
- Overrides:
validateData
in classStoredObject
- Parameters:
tm
- Current transaction manager.- Throws:
Exception
- If data is invalid.
-
create
Create a new message group if it doesn't exist.- Parameters:
name
- Name of the group.tm
- Transaction manager.- Returns:
- Message group instance.
-
listMembers
-
listContacts
Get the list of contacts belonging to this message group.- Type Parameters:
P
- Contact role type.- Parameters:
contactType
- Type of contact (0: SMS, 1: Email, 2: Application)- Returns:
- List.
-
listUsers
-
send
Create and send a message to all members of this group.- Parameters:
tm
- Transaction Manager.messageParameters
- Parameters for creating message from the associated template.- Throws:
Throwable
- If message can not be created.
-
send
public void send(Person person, TransactionManager tm, Object... messageParameters) throws Throwable Create and send a message to all members of this group and to an additional person.- Parameters:
person
- Additional person to receive the messagetm
- Transaction Manager.messageParameters
- Parameters for creating message from the associated template.- Throws:
Throwable
- If message can not be created.
-
send
Create and send a message to all members of this group.- Parameters:
tc
- Transaction Control.messageParameters
- Parameters for creating message from the associated template.- Throws:
Throwable
- If message can not be created.
-
send
public void send(Person person, TransactionControl tc, Object... messageParameters) throws Throwable Create and send a message to all members of this group and to an additional person.- Parameters:
person
- Additional person to receive the messagetc
- Transaction Control.messageParameters
- Parameters for creating message from the associated template.- Throws:
Throwable
- If message can not be created.
-
send
public static void send(String groupName, TransactionManager tm, Object... messageParameters) throws Throwable Create and send a message to all members of this group. No message will be sent if the message group does not exist.- Parameters:
groupName
- Name of the message group.tm
- Transaction Manager.messageParameters
- Parameters for creating message from the associated template.- Throws:
Throwable
- If message can not be created.
-
send
public static void send(String groupName, TransactionControl tc, Object... messageParameters) throws Throwable Create and send a message to all members of this group. No message will be sent if the message group does not exist.- Parameters:
groupName
- Name of the message group.tc
- Transaction Control.messageParameters
- Parameters for creating message from the associated template.- Throws:
Throwable
- If message can not be created.
-
send
public static void send(String groupName, Person person, TransactionManager tm, Object... messageParameters) throws Throwable Create and send a message to all members of this group and to an additional person. No message will be sent if the message group does not exist.- Parameters:
groupName
- Name of the message group.person
- Additional person to receive the messagetm
- Transaction Manager.messageParameters
- Parameters for creating message from the associated template.- Throws:
Throwable
- If message can not be created.
-
send
public static void send(String groupName, Person person, TransactionControl tc, Object... messageParameters) throws Throwable Create and send a message to all members of this group and to an additional person. No message will be sent if the message group does not exist.- Parameters:
groupName
- Name of the message group.person
- Additional person to receive the message (Could be null).tc
- Transaction Control.messageParameters
- Parameters for creating message from the associated template.- Throws:
Throwable
- If message can not be created.
-
toString
Description copied from class:StoredObject
String representation of the instance. Mostly used for logging purposes.- Overrides:
toString
in classStoredObject
- Returns:
- String representation of the instance.
-
notify
Create and send a message to all members of this group.Note: If the message group does not exist a new one will be created.
- Parameters:
groupName
- Name of the message group.tm
- Transaction manager.messageParameters
- Parameters for creating message from the associated template.- Returns:
- True if the message is successfully created for delivery.
-