Package com.groiss.messaging
Class Recipient
java.lang.Object
com.groiss.store.PersistentObject
com.groiss.store.ExportablePersistentObject
com.groiss.messaging.Recipient
- All Implemented Interfaces:
KeyValuePair<String,
,String> Exportable
,Persistent
,Serializable
,Cloneable
The recipients of a message.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Defines the various kinds of agents -
Field Summary
Fields inherited from class com.groiss.store.PersistentObject
filled, oid
Fields inherited from interface com.groiss.store.Persistent
emptyKeys
-
Constructor Summary
ConstructorDescriptionCreate an empty recipient.Recipient
(Persistent templ, short pos) Create a recipient for a template. -
Method Summary
Modifier and TypeMethodDescriptiongetAgent()
Return the agent.Return the agent-string, is used for types email, stepagent, or formfield.Return the type of the agent.String[][]
getKeys()
A class may return key field groups in order to identify already existing objects of that class.Get the object name in localized form.Return the organizational unit, used only if agent is a role.short
getPos()
Return the position of the recipient in the recipient list.Get the recipient type (to, cc, bccc).short
Return the recipient type as numer. 0=To, 1=CC, 2=BCCThis method must return the table name of the database table in which this persistent object is stored.Return the message template or tracker object this template belongs to.void
isValid()
The recipient is valid only if type is user or role and agent is not null OR if type is email, stepagent, or formfield and agentString is not null OR type is owner.Set the recipient to a user or role.setAgentString
(String email) Set the recipient to an email.Set the agent type.setOrgUnit
(OrgUnit ou) Set the organizational unit.Set the recipient type (to, cc, bccc).setRecTypeShort
(short s) Get the recipient type from number.setTemplate
(MessageTemplate template) Set the template the recipient belongs to.toString()
Methods inherited from class com.groiss.store.PersistentObject
afterDelete, afterInsert, afterRead, afterUpdate, beforeDelete, beforeInsert, beforeUpdate, clone, dbFields, equals, getKey, getLocalClassName, getOid, getValue, hashCode, isFilled, onDelete, onInsert, onRead, onUpdate, setFilled, setOid, setOid, toListString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.groiss.store.Exportable
beforeImport, exportFields, getAdditionalObjects, getRequiredObjects, getRequiredReferences
Methods inherited from interface com.groiss.store.Persistent
afterDelete, afterInsert, afterRead, afterUpdate, beforeDelete, beforeInsert, beforeUpdate, dbFields, getKey, getLocalClassName, getOid, getStore, getValue, isFilled, setFilled, setOid, setOid, toListString
-
Constructor Details
-
Recipient
public Recipient()Create an empty recipient. -
Recipient
Create a recipient for a template.
-
-
Method Details
-
getTableName
Description copied from interface:Persistent
This method must return the table name of the database table in which this persistent object is stored.- Returns:
- The table name of the database table in which this persistent object is stored.
-
getAgent
Return the agent. -
getOrgUnit
Return the organizational unit, used only if agent is a role. -
getAgentString
Return the agent-string, is used for types email, stepagent, or formfield. -
getAgentType
Return the type of the agent. -
getRecTypeShort
public short getRecTypeShort()Return the recipient type as numer. 0=To, 1=CC, 2=BCC -
getTemplate
Return the message template or tracker object this template belongs to. -
setAgent
Set the recipient to a user or role. -
setAgentString
Set the recipient to an email. -
setOrgUnit
Set the organizational unit. Only used, if the agent is a local or hierarchical role. -
setAgentType
Set the agent type. -
getRecType
Get the recipient type (to, cc, bccc). -
setRecType
Set the recipient type (to, cc, bccc). -
setRecTypeShort
Get the recipient type from number. SeegetRecTypeShort()
for keys. -
setTemplate
Set the template the recipient belongs to. -
getPos
public short getPos()Return the position of the recipient in the recipient list. -
isValid
public void isValid()The recipient is valid only if type is user or role and agent is not null OR if type is email, stepagent, or formfield and agentString is not null OR type is owner.- Specified by:
isValid
in interfacePersistent
- Overrides:
isValid
in classPersistentObject
-
toString
-
getKeys
Description copied from interface:Persistent
A class may return key field groups in order to identify already existing objects of that class. A key field group must uniquely identify an object. Multiple such key field groups can be defined. Each of the key field groups must be unique for an object to be unique (thus, group1 matches OR group2 matches etc.).The first key field group is occasionally treated in a special manner as the primary business key. E.g. the export import functionality checks for object existence according to just the first key field group.
If no key field groups can be provided by the implementing class an empty result must be returned - use
Persistent.emptyKeys
to do so.- Specified by:
getKeys
in interfacePersistent
- Overrides:
getKeys
in classPersistentObject
- Returns:
- An array of arrays containing object field names of those fields which
constitute key field groups for uniquely identifying objects of classes implementing this
interface. An example would be
{{"name", "birthdate"},{"ssn"}}
for a class defining two key field groups. The first one contains the fieldsname
andbirthdate
, the second key field group has just one fieldssn
.
-
getLocalObjectName
Description copied from class:PersistentObject
Get the object name in localized form. Subclasses should override this method!- Specified by:
getLocalObjectName
in interfacePersistent
- Overrides:
getLocalObjectName
in classPersistentObject
- Returns:
- the name of the objects in localized form
-