edu.indiana.dde.mylead.dai
Class MyLeadDeleteAttr

java.lang.Object
  extended by edu.indiana.dde.mylead.dai.MyLeadDeleteAttr

public class MyLeadDeleteAttr
extends java.lang.Object

Abstract base class for building myLEAD objects from a Grid Data Service Document.Used in deleting a metadata attribute either as part of an update or just as an attribute deletion.


Field Summary
protected  int mUserId
           
 
Constructor Summary
MyLeadDeleteAttr(int userId, java.sql.Connection dbConnect, OrderedTimerLog timerLog)
          Constructor
 
Method Summary
protected  ReturnType deleteAttr(long objId, byte objTypeId, int attrId, int attrType, int clobId, long lastUpdate)
          This method is used to delete a metadata attribute for the specified object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mUserId

protected int mUserId
Constructor Detail

MyLeadDeleteAttr

public MyLeadDeleteAttr(int userId,
                        java.sql.Connection dbConnect,
                        OrderedTimerLog timerLog)
                 throws uk.org.ogsadai.common.exception.engine.activity.ActivityUserException,
                        uk.org.ogsadai.common.exception.engine.activity.ActivitySystemException
Constructor

Parameters:
userId - Internal ID for the user
dbConnect - The activity's connection to the database.
timerLog - Instance of OrderedTimerLog class which wraps a logger that logs an ordered list of messages and the time received.
Throws:
uk.org.ogsadai.common.exception.engine.activity.ActivitySystemException - If there is a problem constructing the activity due to an implementation error or OGSA-DAI confguration problem.
uk.org.ogsadai.common.exception.engine.activity.ActivityUserException - If there is a problem constructing the activity due to a user mistake such as an invalid setting.
Method Detail

deleteAttr

protected ReturnType deleteAttr(long objId,
                                byte objTypeId,
                                int attrId,
                                int attrType,
                                int clobId,
                                long lastUpdate)
This method is used to delete a metadata attribute for the specified object. If the lastUpdate parameter is greater than zero, then the lastUpdated field for any subsequent attributes of the same type for the same object are updated. (this is needed for deletions but not for replacements). The CLOB and the queryable attributes and elements (if any) will also be deleted.
This method assumes that the calling routine has it wrapped in a transaction and that the calling routine will commit or rollback based on the ReturnType returned. The reason for this is that this method will be used by the update implementation (and possibly other methods) where this method is called to delete the existing metadata attribute and then a replacement attribute is added. The delete should not be committed until the replacement is added. Parameters:

Parameters:
objId - long int with the internal ID of the object
objTypeId - byte (TINYINT) with internal ID of the object type (file, collection, etc.)
attrId - int with the internal ID of the attribute to be deleted
attrType - int with the internal ID of the type for the attribute to be deleted.
clobId - int with the internal ID of the attribute's CLOB.
lastUpdate - long int with the lastUpdate of the CLOB to be deleted. Any subsequent CLOB for the same metadata attribute type for the same object will have a later value for the lastUpdate. In the database this is a timestamp data type, but it can be expressed as a long int of the format YYYYMMDDHHMMSS and is passed as such as an XML attribute in query results.
If 0 is passed as the value for this parameter, then no update is performed. This saves some processing for updates where an insert will be done to the same position or the cardinality is known to be one.
Returns:
ReturnType with the status of the inserts