edu.indiana.dde.mylead.dai
Class MyLeadUpdateUserImpl

java.lang.Object
  extended by uk.org.ogsadai.engine.Activity
      extended by uk.org.ogsadai.activity.sql.SQLActivity
          extended by edu.indiana.dde.mylead.dai.MyLeadActivity
              extended by edu.indiana.dde.mylead.dai.MyLeadUserActivity
                  extended by edu.indiana.dde.mylead.dai.MyLeadUpdateUserImpl

public class MyLeadUpdateUserImpl
extends MyLeadUserActivity

Handles myleadUpdateUser Elements from a Grid Data Service Document.


Nested Class Summary
 
Nested classes/interfaces inherited from class uk.org.ogsadai.activity.sql.SQLActivity
uk.org.ogsadai.activity.sql.SQLActivity.ParameterInput, uk.org.ogsadai.activity.sql.SQLActivity.StreamInput, uk.org.ogsadai.activity.sql.SQLActivity.ValueInput
 
Field Summary
 
Fields inherited from class edu.indiana.dde.mylead.dai.MyLeadUserActivity
ADDR_COL_NAMES, ADDR_TAGS, CREATOR_DN, mBadDn, mBadProtocol, mBadReplicas, mBadStorage, mBadUsers, mBadWhtBrd, mNoData, mUserId, RES_TAG_NICKNAME, RES_TAG_PROTOCOL, RES_TAGS, RESOURCE_COL_NAMES, TBL_PROTOCOL, TBL_PROTOCOL_RES, TBL_PROTOCOL_WRITER, TBL_RESOURCE_ID, TBL_RESOURCE_NNAME, TBL_WRITER_REPLICA, USER_ADDR, USER_COL_DN, USER_COL_ID, USER_COL_NAMES, USER_DN, USER_LASTMOD_DATE_COL, USER_LASTMOD_ID_COL, USER_REPLICA, USER_STORAGE, USER_TAGS, userList
 
Fields inherited from class edu.indiana.dde.mylead.dai.MyLeadActivity
AUTHORITY_ADDATTR, AUTHORITY_CREATE, AUTHORITY_DEL_REPLICA, AUTHORITY_DEL_USER, AUTHORITY_DELETEATTR, AUTHORITY_UPDATE, mActivityName, mDn, mTimingPnt, MYLEAD_DB, MYLEAD_WRITER_REPLICA, MYLEAD_WRITER_TBL, startTime
 
Fields inherited from class uk.org.ogsadai.activity.sql.SQLActivity
CREATE_DATABASE, DROP_DATABASE, EXPRESSION, mAllInput, mConnection, mConnectionManager, mCredentials, mExpression, mExpressionInput, mInputStreams, mIsTransaction, mNameToInput, mOpenConnection, mOutput, mStatement, RESULT_STREAM, SQL_PARAMETERS, STORED_PROCEDURE, WEB_ROW_SET_STREAM
 
Fields inherited from class uk.org.ogsadai.engine.Activity
mContext, mExternalInputs, mExternalOutputs, mInternalInputs, mInternalOutputs
 
Constructor Summary
MyLeadUpdateUserImpl(org.w3c.dom.Element element)
          Constructor
 
Method Summary
protected  boolean getResult()
          This method is called by processBlock, and it calls the getUserResult method in the MyLeadUserActivity class.
protected  void processUser(org.w3c.dom.Node userNode)
          This method is called to update each user.
protected  void updateResource(org.w3c.dom.Node rn, java.lang.String userDn)
          This method is called for each storage resource node to be updated.
 
Methods inherited from class edu.indiana.dde.mylead.dai.MyLeadUserActivity
addResource, getUserResult, processBlock, updateReplica
 
Methods inherited from class edu.indiana.dde.mylead.dai.MyLeadActivity
checkAuthorization, dumpLog, endProcessing, finalize, getObjectId, getParameter, getWhiteboardId, markTime, queryTimestamp, startProcessing
 
Methods inherited from class uk.org.ogsadai.activity.sql.SQLActivity
initialise, loadNextExpression, parseCommand, parseResultStream, parseSQLParameters, prepareStatement, setupInputStreamNames
 
Methods inherited from class uk.org.ogsadai.engine.Activity
cleanUp, connectsTo, getActivityConfiguration, getName, getObservableStatus, getProperties, getStatus, hasActivityConfiguration, hasProperties, processFirst, setCompleted, setError
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyLeadUpdateUserImpl

public MyLeadUpdateUserImpl(org.w3c.dom.Element element)
                     throws uk.org.ogsadai.common.exception.engine.activity.ActivityUserException,
                            uk.org.ogsadai.common.exception.engine.activity.ActivitySystemException
Constructor

Parameters:
element - Element containing Statement conforming to schema for this activity. It is assumed schema checks have been carried out.
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

getResult

protected boolean getResult()
                     throws java.sql.SQLException,
                            uk.org.ogsadai.common.exception.engine.activity.ActivitySystemException,
                            uk.org.ogsadai.common.exception.engine.activity.ActivityUserException
This method is called by processBlock, and it calls the getUserResult method in the MyLeadUserActivity class. Based on the ReturnType from that method, it returns either true or false to processBlock. The getResult method must return a boolean value even though it's not used by processBlock in this case. The reason is that getResult is a method in the underlying SQLActivity method.

Overrides:
getResult in class uk.org.ogsadai.activity.sql.SQLActivity
Returns:
boolean indicating if getResult received a success ReturnType from the getUserResult method in the MyLeadActivity class.
Throws:
java.sql.SQLException
uk.org.ogsadai.common.exception.engine.activity.ActivitySystemException
uk.org.ogsadai.common.exception.engine.activity.ActivityUserException

processUser

protected void processUser(org.w3c.dom.Node userNode)
This method is called to update each user. If an error is encountered, then one of the counters for errors with users, replicas, storage resources, or storage protocols is incremented. No errors are thrown by this method. The getResult method calling this routine then looks to those error counters to determine the return results. This method overrides the empty processUser method in the MyLeadUserActivity class.

Specified by:
processUser in class MyLeadUserActivity
Parameters:
userNode - Node containing the user data from the perform document.

updateResource

protected void updateResource(org.w3c.dom.Node rn,
                              java.lang.String userDn)
This method is called for each storage resource node to be updated.

Parameters:
rn - Node for a storage resource from the perform document.
userDn - The distinguished name of the user being processed.