psdi.app.recontask.engine

Class ComparisonStatementHelper

  • java.lang.Object
    • psdi.app.recontask.engine.ComparisonStatementHelper


  • public class ComparisonStatementHelper
    extends java.lang.Object
    End to end access to one object set in the database: takes attribute names at the input, produces AssetValueSet object at the other end
    • Field Detail

      • type

        protected int type
        The statement type
      • attributes

        protected java.util.List attributes
        all retrievable attributes from running this statement; may remain empty
      • specAttributes

        protected java.util.List specAttributes
      • loaded

        protected boolean loaded
      • units

        protected java.util.Map units
        Map for requested units to their attributes; may remain null; (as of 20050202 used for deployed assets only, authorized have their own mechanism to read measurement units)

      • key: unit feild name
      • value: attribute feild name
  • unitToAttributeIndex

    protected int[] unitToAttributeIndex
    maps measurement unit attribute order in the SQL statement to position of their corresponding value attributes in the AssetData object
  • objectName

    protected java.lang.String objectName
    MBO object name; same as the database table or a view underlying the MBO. NO VIRTUAL SETS/FIELDS ALLOWED
  • recordData

    protected ReconValueSet recordData
    The records read from the database
  • attributesByObjects

    protected java.util.HashMap attributesByObjects
  • linkValue

    protected java.util.Map linkValue
  • Constructor Detail

    • ComparisonStatementHelper

      public ComparisonStatementHelper(ReconInfo reconInfo,
                                       java.lang.String objectName)
      Parameters:
      userInfo -
      objectName -
  • Method Detail

    • prepare

      public void prepare()
                   throws MXException,
                          java.rmi.RemoteException,
                          java.sql.SQLException
      Throws:
      MXException
      java.rmi.RemoteException
      java.sql.SQLException
    • getSelectClauseForUnits

      public java.lang.String getSelectClauseForUnits()
    • initializeReconValueSet

      public void initializeReconValueSet()
                                   throws MXException,
                                          java.rmi.RemoteException
      Initialize the data structure that holds what's read from the database
      Throws:
      MXException
      java.rmi.RemoteException
    • addAttribute

      public void addAttribute(java.lang.String attribute)
    • addAttribute

      public void addAttribute(java.lang.String attribute,
                               java.lang.String unit)
    • getType

      public int getType()
      Returns:
      Returns the type
    • getOperationType

      public int getOperationType()
      Returns:
      Returns the type with some detail hidden
    • isFilter

      public boolean isFilter()
      Returns:
      Returns true if this is an authorized or deployed asset filter
    • isForDataSet1

      public boolean isForDataSet1()
      Returns:
      Returns true if the expression relates to an authorized asset
    • getDataSet

      protected DataSet getDataSet()
    • changeType

      public void changeType(int type)
      Parameters:
      type - The type to set. Will not overwrite FILTER types
    • getObjectName

      public java.lang.String getObjectName()
      Returns:
      Returns the objectName.
    • getAttributes

      public java.util.List getAttributes()
      Returns:
      iterator over the attribute names
    • getSpecAttributes

      public java.util.List getSpecAttributes()
      Returns:
      iterator over the attribute names
    • reset

      public void reset()
    • getRecordData

      public ReconValueSet getRecordData()
      Returns:
      Returns the recordData.
    • getRecordCount

      public int getRecordCount(java.lang.String qualifiedName)
                         throws MXException,
                                java.rmi.RemoteException,
                                java.sql.SQLException
      the qualified name should be in the form of,
      ObjectName
      Or
      ObjectName?ClassstructureID
      Throws:
      MXException
      java.rmi.RemoteException
      java.sql.SQLException
    • addAttributeByObject

      public void addAttributeByObject(java.lang.String objectName,
                                       java.lang.String attributeName)
    • getUnitsMap

      public java.util.Map getUnitsMap()
    • getUnitToAttributeIndex

      public int[] getUnitToAttributeIndex()
    • setLoaded

      public void setLoaded(boolean loaded)
    • isLoaded

      public boolean isLoaded()
    • setLinkValue

      public void setLinkValue(java.util.Map linkValue)