|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.fc.WTObject
wt.notify.ObjectSubscription
The ObjectSubscription
class represents subscription requests
on Notifiable
objects. Each subscription object represents
the interest of a single subscriber on an event that may occur to a Notifiable
object. The event can be post-filtered by a name-value pair, where name
is the name of an attribute and value is the String representation of
the value of the attribute. Expiration dates can be associated with subscriptions.
The action to be performed upon occurrence of the event depends on the
subscriber. If the subscriber is a user, an email message notifying the
user of the event is sent. The subscription objects contain attributes
to be used when constructing the message (subject, HTML template name
and message body).
Use the newObjectSubscription
static factory method(s),
not the ObjectSubscription
constructor, to construct instances
of this class. Instances must be constructed using the static factory(s),
in order to ensure proper initialization of the instance.
Supported API: true
Extendable: false
Field Summary | |
protected static String |
ATTR_VALUE_MAP
Label for the attribute; Name of the attribute; used to post-filter the event: target is checked if attribute value is the same as specified; ignored if null. |
private static int |
ATTR_VALUE_MAP_UPPER_LIMIT
|
private WTStringMap |
attrValueMap
|
private static String |
CLASSNAME
|
private AdminDomainRef |
domainRef
|
private AclEntrySet |
entrySet
|
static String |
EVENT_KEY
Label for the attribute; Event key. |
private static int |
EVENT_KEY_UPPER_LIMIT
|
private String |
eventKey
|
static String |
EXPIRATION_TIME
Label for the attribute; Time when the subscription expires; null means that the subscription doesn't expire. |
private Timestamp |
expirationTime
|
static long |
EXTERNALIZATION_VERSION_UID
|
private boolean |
inheritedDomain
|
static String |
MESSAGE_BODY
Label for the attribute; Body of the notification message. |
private static int |
MESSAGE_BODY_UPPER_LIMIT
|
private String |
messageBody
|
protected static long |
OLD_FORMAT_VERSION_UID
|
private Ownership |
ownership
|
private static String |
RESOURCE
|
(package private) static long |
serialVersionUID
|
private String |
subject
|
static String |
SUBJECT
Label for the attribute; Notification message subject. |
private static int |
SUBJECT_UPPER_LIMIT
|
static String |
SUBSCRIBER_REF
Label for the attribute; Reference to the subscriber (user or a object event listener persistable object). |
private ObjectReference |
subscriberRef
|
static String |
SUBSCRIPTION_KEY
Label for the attribute; Optional user-defined key used to identify all subscriptions resulting from the same user action (created by call to the server method). |
private static int |
SUBSCRIPTION_KEY_UPPER_LIMIT
|
private String |
subscriptionKey
|
static String |
TARGET_REF
Label for the attribute; Reference to the target object. |
private ObjectReference |
targetRef
|
static String |
TEMPLATE_NAME
Label for the attribute; Name of the template used to create a notification message. |
private static int |
TEMPLATE_NAME_UPPER_LIMIT
|
private String |
templateName
|
private static boolean |
VERBOSE_EXECUTION
|
Fields inherited from class wt.fc.WTObject |
CREATE_TIMESTAMP, MODIFY_TIMESTAMP |
Fields inherited from interface wt.admin.DomainAdministered |
DOMAIN_REF, INHERITED_DOMAIN |
Fields inherited from interface wt.ownership.Ownable |
OWNERSHIP |
Fields inherited from interface wt.fc.Persistable |
IDENTITY, PERSIST_INFO, TYPE |
Fields inherited from interface wt.access.AdHocControlled |
ENTRY_SET |
Fields inherited from interface wt.identity.DisplayIdentification |
DISPLAY_IDENTIFIER, DISPLAY_IDENTITY, DISPLAY_TYPE |
Constructor Summary | |
ObjectSubscription()
|
Method Summary | |
private void |
attrValueMapValidate(WTStringMap a_AttrValueMap)
|
boolean |
checkAttributeValues(Object object)
Determines whether the object passed as argument matches the subscription, as far as attribute values are concerned. |
boolean |
equals(Object obj)
Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifier s. |
private void |
eventKeyValidate(String a_EventKey)
|
private String |
eventToString(String event)
Returns just the name of the event. |
Enumeration |
getAttributeNames()
Returns an enumeration containing all attribute names. |
String |
getAttributeValue(String name)
Returns the attribute value for the named attribute. |
protected WTStringMap |
getAttrValueMap()
Gets the value of the attribute: ATTR_VALUE_MAP. |
String |
getConceptualClassname()
Deprecated. |
AdminDomainRef |
getDomainRef()
Gets the object for the association that plays role: DOMAIN_REF. |
AclEntrySet |
getEntrySet()
Gets the value of the attribute: ENTRY_SET. |
String |
getEventKey()
Gets the value of the attribute: EVENT_KEY. |
Timestamp |
getExpirationTime()
Gets the value of the attribute: EXPIRATION_TIME. |
String |
getMessageBody()
Gets the value of the attribute: MESSAGE_BODY. |
Ownership |
getOwnership()
Gets the object for the association that plays role: OWNERSHIP. |
String |
getSubject()
Gets the value of the attribute: SUBJECT. |
ObjectReference |
getSubscriberRef()
Gets the value of the attribute: SUBSCRIBER_REF. |
String |
getSubscriptionKey()
Gets the value of the attribute: SUBSCRIPTION_KEY. |
Notifiable |
getTarget()
Returns the target of an object subscription. |
ObjectReference |
getTargetRef()
Gets the value of the attribute: TARGET_REF. |
String |
getTemplateName()
Gets the value of the attribute: TEMPLATE_NAME. |
boolean |
hasAttributes()
Returns 'true' if there are attribute-value pairs defined; 'false' otherwise. |
int |
hashCode()
Returns a hash code for this object based upon its ObjectIdentifier . |
private String |
idToString(ObjectIdentifier id)
Returns just the class name and oid. |
protected void |
initialize()
Supports initialization, following construction of an instance. |
protected void |
initialize(ObjectSubscription subscription)
Supports initialization, following construction of an instance. |
boolean |
isEquivalent(ObjectSubscription subscription)
Returns true if both subscriptions have the same type of subscriber (either a user reference or an object listener reference) and have the same target object, event, subject, message body and template. |
boolean |
isInheritedDomain()
Gets the value of the attribute: INHERITED_DOMAIN. |
private void |
messageBodyValidate(String a_MessageBody)
|
static ObjectSubscription |
newObjectSubscription()
No-arg constructor. |
static ObjectSubscription |
newObjectSubscription(ObjectSubscription subscription)
Copy constructor. |
void |
readExternal(ObjectInput input)
Reads the non-transient fields of this class from an external source. |
void |
readExternal(PersistentRetrieveIfc input)
Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store. |
private boolean |
readOldVersion(ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source, which is not the current version. |
protected boolean |
readVersion(ObjectSubscription thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
void |
removeAttribute(String name)
Removes attribute given its name. |
void |
setAttributeValue(String name,
String value)
Sets an attribute value for the named attribute. |
protected void |
setAttrValueMap(WTStringMap a_AttrValueMap)
Sets the value of the attribute: ATTR_VALUE_MAP. |
void |
setDomainRef(AdminDomainRef a_DomainRef)
Sets the object for the association that plays role: DOMAIN_REF. |
void |
setEntrySet(AclEntrySet a_EntrySet)
Sets the value of the attribute: ENTRY_SET. |
void |
setEventKey(String a_EventKey)
Sets the value of the attribute: EVENT_KEY. |
void |
setExpirationTime(Timestamp a_ExpirationTime)
Sets the value of the attribute: EXPIRATION_TIME. |
void |
setInheritedDomain(boolean a_InheritedDomain)
Sets the value of the attribute: INHERITED_DOMAIN. |
void |
setMessageBody(String a_MessageBody)
Sets the value of the attribute: MESSAGE_BODY. |
void |
setOwnership(Ownership a_Ownership)
Sets the object for the association that plays role: OWNERSHIP. |
void |
setSubject(String a_Subject)
Sets the value of the attribute: SUBJECT. |
protected void |
setSubscriberRef(ObjectReference a_SubscriberRef)
Sets the value of the attribute: SUBSCRIBER_REF. |
void |
setSubscriptionKey(String a_SubscriptionKey)
Sets the value of the attribute: SUBSCRIPTION_KEY. |
void |
setTarget(Notifiable target)
Sets the target of an object subscription. |
protected void |
setTargetRef(ObjectReference a_TargetRef)
Sets the value of the attribute: TARGET_REF. |
void |
setTemplateName(String a_TemplateName)
Sets the value of the attribute: TEMPLATE_NAME. |
private void |
subjectValidate(String a_Subject)
|
private void |
templateNameValidate(String a_TemplateName)
|
String |
toString()
Returns a string representation of the object subscription object. |
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
void |
writeExternal(PersistentStoreIfc output)
Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store. |
Methods inherited from class wt.fc.WTObject |
checkAttributes, duplicate, finalize, getClassInfo, getCreateTimestamp, getDisplayIdentifier, getDisplayIdentity, getDisplayType, getIdentity, getModifyTimestamp, getPersistInfo, getType, readVersion, setPersistInfo |
Methods inherited from class java.lang.Object |
clone, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface wt.fc.NetFactor |
getClassInfo |
Methods inherited from interface wt.fc.Persistable |
checkAttributes, getIdentity, getPersistInfo, getType, setPersistInfo |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
public static final String TARGET_REF
private ObjectReference targetRef
public static final String SUBSCRIBER_REF
private ObjectReference subscriberRef
public static final String EVENT_KEY
private static int EVENT_KEY_UPPER_LIMIT
private String eventKey
protected static final String ATTR_VALUE_MAP
private static int ATTR_VALUE_MAP_UPPER_LIMIT
private WTStringMap attrValueMap
public static final String TEMPLATE_NAME
private static int TEMPLATE_NAME_UPPER_LIMIT
private String templateName
public static final String SUBJECT
private static int SUBJECT_UPPER_LIMIT
private String subject
public static final String MESSAGE_BODY
private static int MESSAGE_BODY_UPPER_LIMIT
private String messageBody
public static final String EXPIRATION_TIME
private Timestamp expirationTime
public static final String SUBSCRIPTION_KEY
private static int SUBSCRIPTION_KEY_UPPER_LIMIT
private String subscriptionKey
private boolean inheritedDomain
private AdminDomainRef domainRef
private Ownership ownership
private AclEntrySet entrySet
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
private static boolean VERBOSE_EXECUTION
Constructor Detail |
public ObjectSubscription()
Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class WTObject
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class WTObject
input
-
IOException
ClassNotFoundException
protected boolean readVersion(ObjectSubscription thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public void writeExternal(PersistentStoreIfc output) throws SQLException, DatastoreException
(Not intended for general use.)
Supported API: false
writeExternal
in interface ObjectMappable
writeExternal
in class WTObject
output
-
SQLException
DatastoreException
public void readExternal(PersistentRetrieveIfc input) throws SQLException, DatastoreException
(Not intended for general
use.)
Supported API: false
readExternal
in interface ObjectMappable
readExternal
in class WTObject
input
-
SQLException
DatastoreException
public String getConceptualClassname()
getConceptualClassname
in interface NetFactor
public ObjectReference getTargetRef()
protected void setTargetRef(ObjectReference a_TargetRef)
a_TargetRef
- public ObjectReference getSubscriberRef()
protected void setSubscriberRef(ObjectReference a_SubscriberRef)
a_SubscriberRef
- public String getEventKey()
public void setEventKey(String a_EventKey) throws WTPropertyVetoException
a_EventKey
-
WTPropertyVetoException
private void eventKeyValidate(String a_EventKey) throws WTPropertyVetoException
a_EventKey
-
WTPropertyVetoException
protected WTStringMap getAttrValueMap()
protected void setAttrValueMap(WTStringMap a_AttrValueMap) throws WTPropertyVetoException
a_AttrValueMap
-
WTPropertyVetoException
private void attrValueMapValidate(WTStringMap a_AttrValueMap) throws WTPropertyVetoException
a_AttrValueMap
-
WTPropertyVetoException
public String getTemplateName()
public void setTemplateName(String a_TemplateName) throws WTPropertyVetoException
a_TemplateName
-
WTPropertyVetoException
private void templateNameValidate(String a_TemplateName) throws WTPropertyVetoException
a_TemplateName
-
WTPropertyVetoException
public String getSubject()
public void setSubject(String a_Subject) throws WTPropertyVetoException
a_Subject
-
WTPropertyVetoException
private void subjectValidate(String a_Subject) throws WTPropertyVetoException
a_Subject
-
WTPropertyVetoException
public String getMessageBody()
public void setMessageBody(String a_MessageBody) throws WTPropertyVetoException
a_MessageBody
-
WTPropertyVetoException
private void messageBodyValidate(String a_MessageBody) throws WTPropertyVetoException
a_MessageBody
-
WTPropertyVetoException
public Timestamp getExpirationTime()
public void setExpirationTime(Timestamp a_ExpirationTime) throws WTPropertyVetoException
a_ExpirationTime
-
WTPropertyVetoException
public String getSubscriptionKey()
public void setSubscriptionKey(String a_SubscriptionKey)
a_SubscriptionKey
- public static ObjectSubscription newObjectSubscription(ObjectSubscription subscription) throws WTException
subscription
-
WTException
protected void initialize(ObjectSubscription subscription) throws WTException
subscription
-
WTException
public static ObjectSubscription newObjectSubscription() throws WTException
WTException
public void setTarget(Notifiable target) throws WTException
target
- target of subscription
WTException
public Notifiable getTarget()
public String toString()
toString
in class WTObject
public boolean isEquivalent(ObjectSubscription subscription)
subscription
-
public String getAttributeValue(String name)
name
- attribute name
public void setAttributeValue(String name, String value)
name
- attribute namevalue
- String
representation of the named attribute's valuepublic void removeAttribute(String name)
name
- public Enumeration getAttributeNames()
public boolean hasAttributes()
public boolean checkAttributeValues(Object object) throws WTException
object
-
WTException
public boolean isInheritedDomain()
isInheritedDomain
in interface DomainAdministered
public void setInheritedDomain(boolean a_InheritedDomain) throws WTPropertyVetoException
setInheritedDomain
in interface DomainAdministered
a_InheritedDomain
-
WTPropertyVetoException
public AdminDomainRef getDomainRef()
getDomainRef
in interface DomainAdministered
public void setDomainRef(AdminDomainRef a_DomainRef)
setDomainRef
in interface DomainAdministered
a_DomainRef
- public Ownership getOwnership()
getOwnership
in interface Ownable
public void setOwnership(Ownership a_Ownership)
setOwnership
in interface Ownable
a_Ownership
- public AclEntrySet getEntrySet()
getEntrySet
in interface AdHocControlled
public void setEntrySet(AclEntrySet a_EntrySet)
setEntrySet
in interface AdHocControlled
a_EntrySet
- public boolean equals(Object obj)
ObjectIdentifier
s.
Changed or stale copies are still considered equal by this method.
Delegates to PersistenceHelper.equals(Persistable,Object)
.
Warning: Certain core Windchill operations may depend upon
equals
being ObjectIdentifier
-based. Changes
to the default implementation should be done with care, if at all.
Supported API: false
equals
in class WTObject
obj
-
public int hashCode()
ObjectIdentifier
.
Delegates to PersistenceHelper.hashCode(Persistable)
.
Warning: Certain core Windchill operations may depend upon
hashCode
being ObjectIdentifier-based
. Changes
to the default implementation should be done with care, if at all.
Supported API: false
hashCode
in class WTObject
protected void initialize() throws WTException
initialize
in class WTObject
WTException
private String eventToString(String event)
private String idToString(ObjectIdentifier id)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |