com.ibm.tivoli.maximo.skd.max.service

Class ActivityMaxDataManager

  • java.lang.Object
    • com.ibm.tivoli.maximo.skd.max.service.ActivityMaxDataManager
  • All Implemented Interfaces:
    IMaxDataManager


    public class ActivityMaxDataManager
    extends java.lang.Object
    implements IMaxDataManager
    Data Manager component for the new Scheduler Max application.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.util.HashMap woClassMap 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      com.ibm.json.java.JSONArray bulkLoadDataObjects(Schedule schedule, DataSpec dataSpec, java.lang.Long offsetRecord)
      Loads a list of activity records according to the parameters used as input.
      void commitChanges(MboRemote projectMbo, MboSetRemote activitySet, java.lang.String selectedIDs)
      Commits any changes that have been saved for the activities of a given Project (Schedule).
      protected void executeCommitQuery(java.lang.String projectId, UserInfo userInfo, java.lang.StringBuilder objectIDs, java.sql.Connection connection, int dbType, MXLogger sqlLogger)
      Commits a batch of changes
      com.ibm.json.java.JSONArray fetchChildren(Schedule schedule, DataSpec dataSpec, java.lang.String workOrderNumber, java.lang.Long offsetRecord, java.lang.Integer level) 
      Activity findById(Schedule schedule, java.lang.String id, DataSpec dataSpec) 
      int getCompareRowCount(Schedule leftModel, long rightModelId, DataSpec dataSpec) 
      protected java.lang.String getCompleteQueryWhere(MboRemote projectMbo, UserInfo userInfo, java.lang.String objectName, java.util.Map queryMap)
      Get the complete where clause
      protected java.lang.String getDefaultRestriction(MboRemote projectMbo, java.lang.String objectName)
      Get default restriction for object
      protected java.lang.String getDefaultStatusRestriction()
      Get the default restriction where clause
      int getPageCount(Schedule schedule, DataSpec dataSpec, boolean parentOnly) 
      int getRowCount(Schedule schedule, DataSpec dataSpec, boolean parentOnly) 
      protected java.lang.String getStartEndDateRestriction(MboRemote projectMbo)
      Get the default restriction where clause
      protected java.lang.String getWOClassRestriction(java.lang.String objectName)
      Get the workorder class restriction for object
      com.ibm.json.java.JSONArray loadDataObjects(Schedule schedule, DataSpec dataSpec, java.util.List activityIDs)
      Loads a list of activity records according to the parameters used as input.
      com.ibm.json.java.JSONArray loadDataObjects(Schedule schedule, DataSpec dataSpec, java.lang.Long offsetRecord, boolean parentOnly)
      Loads a list of activity records according to the parameters used as input.
      com.ibm.json.java.JSONArray loadDiffDataObjects(Schedule leftSchedule, long otherProjectID, DataSpec dataSpec, java.lang.Long offsetRecord)
      Loads a list of activity records according to the parameters used as input.
      com.ibm.json.java.JSONArray loadMissingDataObjects(Schedule leftSchedule, long otherProjectID, DataSpec dataSpec)
      Loads a list of activity records according to the parameters used as input.
      void populateDataObjects(MboRemote projectMbo, java.util.Map queryMap)
      Populates the SKDACTIVITY table using the values obtained by the execution of the Work Queries.
      void processChanges(MboRemote projectMbo, java.util.List activityChanges)
      Processes a set of changes for the activities associated with the selected Schedule.
      protected void updateChildrenActivities(java.lang.String projectId, java.lang.String workOrderNumbers, java.lang.Integer timeDiff, int dbType, java.sql.Connection connection, MXLogger sqlLogger, UserInfo userInfo) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • woClassMap

        public static java.util.HashMap woClassMap
    • Constructor Detail

      • ActivityMaxDataManager

        public ActivityMaxDataManager(MXServer mxServer)
    • Method Detail

      • populateDataObjects

        public void populateDataObjects(MboRemote projectMbo,
                                        java.util.Map queryMap)
                                 throws java.rmi.RemoteException,
                                        MXException
        Populates the SKDACTIVITY table using the values obtained by the execution of the Work Queries.
        Specified by:
        populateDataObjects in interface IMaxDataManager
        Parameters:
        queryMap - - A Map of Work Queries to be used as input for this process.
        Throws:
        java.rmi.RemoteException
        MXException
      • loadDataObjects

        public com.ibm.json.java.JSONArray loadDataObjects(Schedule schedule,
                                                           DataSpec dataSpec,
                                                           java.lang.Long offsetRecord,
                                                           boolean parentOnly)
                                                    throws java.rmi.RemoteException,
                                                           MXException
        Loads a list of activity records according to the parameters used as input.
        Specified by:
        loadDataObjects in interface IMaxDataManager
        Parameters:
        schedule - project schedule (contains access to the schedule information)
        dataSpec - data spec details: pageSize, fields, sorts, etc
        offsetRecord - - The ID of the last object previously retrieved.
        Returns:
        - A list of activities in JSON format.
        Throws:
        java.rmi.RemoteException
        MXException
      • processChanges

        public void processChanges(MboRemote projectMbo,
                                   java.util.List activityChanges)
                            throws java.rmi.RemoteException,
                                   MXException
        Processes a set of changes for the activities associated with the selected Schedule. These changes are the result of any modifications that have been done in the Gantt view for the selected Schedule.
        Specified by:
        processChanges in interface IMaxDataManager
        Parameters:
        schedule - - Schedule model object.
        activityChanges - - Set of changes made in the Gantt view.
        Throws:
        java.rmi.RemoteException
        MXException
      • commitChanges

        public void commitChanges(MboRemote projectMbo,
                                  MboSetRemote activitySet,
                                  java.lang.String selectedIDs)
                           throws java.rmi.RemoteException,
                                  MXException
        Commits any changes that have been saved for the activities of a given Project (Schedule). This method is responsible for replicating the changes persisted in the SKDACTIVITY table into the WORKORDER table.
        Specified by:
        commitChanges in interface IMaxDataManager
        Parameters:
        projectMbo -
        activitySet -
        selectedIDs -
        Throws:
        java.rmi.RemoteException
        MXException
      • getCompareRowCount

        public int getCompareRowCount(Schedule leftModel,
                                      long rightModelId,
                                      DataSpec dataSpec)
                               throws java.rmi.RemoteException,
                                      MXException
        Parameters:
        schedule -
        dataSpec -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • fetchChildren

        public com.ibm.json.java.JSONArray fetchChildren(Schedule schedule,
                                                         DataSpec dataSpec,
                                                         java.lang.String workOrderNumber,
                                                         java.lang.Long offsetRecord,
                                                         java.lang.Integer level)
                                                  throws java.rmi.RemoteException,
                                                         MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • loadDiffDataObjects

        public com.ibm.json.java.JSONArray loadDiffDataObjects(Schedule leftSchedule,
                                                               long otherProjectID,
                                                               DataSpec dataSpec,
                                                               java.lang.Long offsetRecord)
                                                        throws java.rmi.RemoteException,
                                                               MXException
        Loads a list of activity records according to the parameters used as input.
        Parameters:
        schedule - project schedule (contains access to the schedule information)
        dataSpec - data spec details: pageSize, fields, sorts, etc
        Returns:
        - A list of activities in JSON format.
        Throws:
        java.rmi.RemoteException
        MXException
      • bulkLoadDataObjects

        public com.ibm.json.java.JSONArray bulkLoadDataObjects(Schedule schedule,
                                                               DataSpec dataSpec,
                                                               java.lang.Long offsetRecord)
                                                        throws java.rmi.RemoteException,
                                                               MXException
        Loads a list of activity records according to the parameters used as input.
        Specified by:
        bulkLoadDataObjects in interface IMaxDataManager
        Parameters:
        schedule - project schedule (contains access to the schedule information)
        dataSpec - data spec details: pageSize, fields, sorts, etc
        Returns:
        - A list of activities in JSON format.
        Throws:
        java.rmi.RemoteException
        MXException
      • executeCommitQuery

        protected void executeCommitQuery(java.lang.String projectId,
                                          UserInfo userInfo,
                                          java.lang.StringBuilder objectIDs,
                                          java.sql.Connection connection,
                                          int dbType,
                                          MXLogger sqlLogger)
                                   throws MXApplicationException
        Commits a batch of changes
        Parameters:
        projectId -
        userInfo -
        objectIDs -
        connection -
        dbType -
        sqlLogger -
        Throws:
        MXApplicationException
      • getCompleteQueryWhere

        protected java.lang.String getCompleteQueryWhere(MboRemote projectMbo,
                                                         UserInfo userInfo,
                                                         java.lang.String objectName,
                                                         java.util.Map queryMap)
                                                  throws MXException,
                                                         java.rmi.RemoteException
        Get the complete where clause
        Parameters:
        objectName -
        queryMap -
        Returns:
        complete where clause
        Throws:
        MXException
        java.rmi.RemoteException
      • getDefaultRestriction

        protected java.lang.String getDefaultRestriction(MboRemote projectMbo,
                                                         java.lang.String objectName)
                                                  throws SchedulerException
        Get default restriction for object
        Parameters:
        objectName -
        Returns:
        default restriction
        Throws:
        SchedulerException
      • getDefaultStatusRestriction

        protected java.lang.String getDefaultStatusRestriction()
                                                        throws SchedulerException
        Get the default restriction where clause
        Returns:
        default restriction
        Throws:
        SchedulerException
      • getWOClassRestriction

        protected java.lang.String getWOClassRestriction(java.lang.String objectName)
                                                  throws SchedulerException
        Get the workorder class restriction for object
        Parameters:
        objectName -
        Returns:
        workorder class restriction
        Throws:
        SchedulerException
      • getStartEndDateRestriction

        protected java.lang.String getStartEndDateRestriction(MboRemote projectMbo)
                                                       throws SchedulerException
        Get the default restriction where clause
        Returns:
        default restriction
        Throws:
        SchedulerException
      • updateChildrenActivities

        protected void updateChildrenActivities(java.lang.String projectId,
                                                java.lang.String workOrderNumbers,
                                                java.lang.Integer timeDiff,
                                                int dbType,
                                                java.sql.Connection connection,
                                                MXLogger sqlLogger,
                                                UserInfo userInfo)
                                         throws MXException
        Throws:
        MXException
      • loadDataObjects

        public com.ibm.json.java.JSONArray loadDataObjects(Schedule schedule,
                                                           DataSpec dataSpec,
                                                           java.util.List activityIDs)
                                                    throws java.rmi.RemoteException,
                                                           MXException
        Loads a list of activity records according to the parameters used as input.
        Specified by:
        loadDataObjects in interface IMaxDataManager
        Parameters:
        schedule - project schedule (contains access to the schedule information)
        dataSpec - data spec details: pageSize, fields, sorts, etc
        offsetRecord - - The ID of the last object previously retrieved.
        Returns:
        - A list of activities in JSON format.
        Throws:
        java.rmi.RemoteException
        MXException
      • loadMissingDataObjects

        public com.ibm.json.java.JSONArray loadMissingDataObjects(Schedule leftSchedule,
                                                                  long otherProjectID,
                                                                  DataSpec dataSpec)
                                                           throws java.rmi.RemoteException,
                                                                  MXException
        Loads a list of activity records according to the parameters used as input.
        Parameters:
        schedule - project schedule (contains access to the schedule information)
        dataSpec - data spec details: pageSize, fields, sorts, etc
        Returns:
        - A list of activities in JSON format.
        Throws:
        java.rmi.RemoteException
        MXException