- /**
- * __last_hash is the hash value computed
- * when the object was last checked against
- * a IClientDocument generated by the
- * object's parent IClient instance.
- * @return Returns the __last_hash.
- */
- public long get__last_hash() {
- return __last_hash;
+ }
+
+ /**
+ * calculate a hash for the object with all housekeeping fields at standard
+ * values. (isRegisterable is an immutable attribute property)
+ */
+ synchronized protected void doHash() {
+ __last_hash = 0;
+ VorbaId thisid = vorbaId;
+ IVorbaIdFactory factory = __vorba;
+ boolean stored = __stored_in_document;
+ vorbaId = null;
+ __vorba = null;
+ __last_hash = this.hashCode();
+ vorbaId = thisid;
+ __vorba = factory;
+ __stored_in_document = stored;
+ }
+
+ /**
+ * TODO: combine two versions of the same collection object to resolve
+ * asynchronous updates to the same vamsas object Merges two vamsas objects,
+ * one of which is a later version of the earlier (ie they have the same
+ * vorbaId but one is a later version recently read from the vamsasDocument
+ * collection.
+ *
+ * @return
+ */
+ protected boolean merge(object laterCopy) {
+ return true;
+ }
+
+ /**
+ *
+ * @return true if object is registered
+ */
+ public boolean isRegistered() {
+ return (registerable) ? (vorbaId != null) : false;
+ }
+
+ /**
+ * Method to get fixed reference for the object in the vamsas document.
+ *
+ * @returns null if object is neither registered or not associated with a
+ * properly instantiated VorbaIdFactory.
+ */
+ public VorbaId getVorbaId() {
+ if (registerable && vorbaId == null) {
+ // Try to use the associated factory.
+ if (__vorba != null)
+ if ((vorbaId = __vorba.makeVorbaId()) == null)
+ return null; // Factory not valid.
+ else {
+ this.setInstanceIdField();
+ return vorbaId;
+ }