edu.indiana.dde.mylead.dai
Class MyLeadQueryActivity

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.MyLeadQueryActivity
Direct Known Subclasses:
MyLeadQryAllWrkspcImpl, MyLeadQryByIdImpl, MyLeadQueryImpl

public abstract class MyLeadQueryActivity
extends MyLeadActivity

Handles Query related 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
protected static int CFILTER_ATTR
           
protected static int CFILTER_ELEMENT
           
protected static int CFILTER_FULL
           
static java.lang.String CFILTER_GUID_VAL
           
protected static int CFILTER_GUIDONLY
           
protected static int CFILTER_NONE
           
static java.lang.String CFILTER_SCHEMA_VAL
           
protected static int CFILTER_SIZE
           
protected static int HFILTER_CHILDREN
           
static java.lang.String HFILTER_CHILDREN_VAL
           
protected static int HFILTER_SET
           
protected static int HFILTER_SUBTREE
           
static java.lang.String HFILTER_SUBTREE_VAL
           
protected static int HFILTER_TARGET
           
static java.lang.String HFILTER_TARGET_VAL
           
protected  java.lang.String mCFilter
           
protected  int mCFilterType
           
protected  edu.indiana.dde.mylead.dai.MyLeadQueryActivity.ParentChildFilterHolder mChildFilter
           
protected  java.util.ArrayList mExclAttr
           
protected  java.util.ArrayList mExclNode
           
protected  org.w3c.dom.NodeList mFilterNodes
           
protected  int mGuidCnt
           
protected  java.util.ArrayList mGuids
           
protected  java.lang.String mHFilter
           
protected  int mHFilterType
           
protected  int mLimit
           
protected  int mOffset
           
protected  edu.indiana.dde.mylead.dai.MyLeadQueryActivity.ParentChildFilterHolder mParentFilter
           
protected  org.w3c.dom.Node mQueryNode
           
protected  org.w3c.dom.Node mTargetNode
           
 
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
MyLeadQueryActivity(org.w3c.dom.Element element)
          Constructor
 
Method Summary
protected  ReturnType fillGlobalId()
          This routine assumes that the temp_objects has already been populated with the objects to be included in the result.
protected  ReturnType fillResults(java.lang.StringBuffer resultStr)
          This routine assumes that the temp_objects has already been populated with the objects to be included in the result.
 void processBlock()
          This method will return the output on the outputStream.
 
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
getResult, 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
 

Field Detail

HFILTER_TARGET_VAL

public static final java.lang.String HFILTER_TARGET_VAL
See Also:
Constant Field Values

HFILTER_SUBTREE_VAL

public static final java.lang.String HFILTER_SUBTREE_VAL
See Also:
Constant Field Values

HFILTER_CHILDREN_VAL

public static final java.lang.String HFILTER_CHILDREN_VAL
See Also:
Constant Field Values

HFILTER_TARGET

protected static final int HFILTER_TARGET
See Also:
Constant Field Values

HFILTER_SUBTREE

protected static final int HFILTER_SUBTREE
See Also:
Constant Field Values

HFILTER_CHILDREN

protected static final int HFILTER_CHILDREN
See Also:
Constant Field Values

HFILTER_SET

protected static final int HFILTER_SET
See Also:
Constant Field Values

CFILTER_GUID_VAL

public static final java.lang.String CFILTER_GUID_VAL
See Also:
Constant Field Values

CFILTER_SCHEMA_VAL

public static final java.lang.String CFILTER_SCHEMA_VAL
See Also:
Constant Field Values

CFILTER_NONE

protected static final int CFILTER_NONE
See Also:
Constant Field Values

CFILTER_GUIDONLY

protected static final int CFILTER_GUIDONLY
See Also:
Constant Field Values

CFILTER_FULL

protected static final int CFILTER_FULL
See Also:
Constant Field Values

CFILTER_ATTR

protected static final int CFILTER_ATTR
See Also:
Constant Field Values

CFILTER_ELEMENT

protected static final int CFILTER_ELEMENT
See Also:
Constant Field Values

CFILTER_SIZE

protected static final int CFILTER_SIZE
See Also:
Constant Field Values

mHFilter

protected java.lang.String mHFilter

mHFilterType

protected int mHFilterType

mParentFilter

protected edu.indiana.dde.mylead.dai.MyLeadQueryActivity.ParentChildFilterHolder mParentFilter

mChildFilter

protected edu.indiana.dde.mylead.dai.MyLeadQueryActivity.ParentChildFilterHolder mChildFilter

mCFilter

protected java.lang.String mCFilter

mCFilterType

protected int mCFilterType

mGuids

protected java.util.ArrayList mGuids

mGuidCnt

protected int mGuidCnt

mFilterNodes

protected org.w3c.dom.NodeList mFilterNodes

mExclAttr

protected java.util.ArrayList mExclAttr

mExclNode

protected java.util.ArrayList mExclNode

mLimit

protected int mLimit

mOffset

protected int mOffset

mQueryNode

protected org.w3c.dom.Node mQueryNode

mTargetNode

protected org.w3c.dom.Node mTargetNode
Constructor Detail

MyLeadQueryActivity

public MyLeadQueryActivity(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

fillResults

protected ReturnType fillResults(java.lang.StringBuffer resultStr)
This routine assumes that the temp_objects has already been populated with the objects to be included in the result. This method then fills the temp_results table based on the content filter. If no filter type has been set, then only the object tags (with the resource IDs) are included in the result - same as if the content flag was GUID ONLY.
This method includes a timestamp in the myQuery root tag of the result returned. This is the date/time of when the CLOBs were retrieved using the mySQL YYYYMMDDHHMMSS format where YYYY is 1970 or later. This timestamp can be passed back as an optional parameter in updates to be sure a user is viewing current results when performing an update.

Parameters:
resultStr - StringBuffer in which results should be stored
Returns:
ReturnType with one of the following values:
ReturnType.OPERATION_SUCCESSFUL
ReturnType.SQL_ERROR
ReturnType.MYLEAD_INTERNAL_ERROR

fillGlobalId

protected ReturnType fillGlobalId()
This routine assumes that the temp_objects has already been populated with the objects to be included in the result. This method then fills the temp_results table with the object opening and closing tags with the objects global ID as a property named resourceID.

Returns:
ReturnType with one of the following values:
ReturnType.OPERATION_SUCCESSFUL
ReturnType.SQL_ERROR
ReturnType.MYLEAD_INTERNAL_ERROR

processBlock

public void processBlock()
This method will return the output on the outputStream. After the MyLeadQueryActivity constructor, all of the parameters have been parsed from the input perform document. OGSA-DAI will then call processBlock() until there are no more results. When this method is called, if there is not a connection, a connection will be acquired (or processing is complete). If a connection is established (either new or already existing) then getResult() will be called. The getResult() method is implemented by each class that extends the MyLeadQueryActivity class. The output will be written to mOutput. No Exceptions are thrown since they will be flagged as a status flag with the activity and the output stream will be closed. On error endProcessing is called and the ERROR status is set.

Specified by:
processBlock in class uk.org.ogsadai.engine.Activity