Class RepositoryHistoryManager


  • public class RepositoryHistoryManager
    extends BaseTable
    This class is the manager for the history records belonging to the repository connector.

    repohistory
    FieldTypeDescription        
    idBIGINTPrimary Key
    ownerVARCHAR(32)Reference:repoconnections.connectionname
    starttimeBIGINT
    endtimeBIGINT
    datasizeBIGINT
    activitytypeVARCHAR(64)
    entityidLONGTEXT
    resultcodeVARCHAR(255)
    resultdescLONGTEXT


    • Method Detail

      • install

        public void install​(java.lang.String parentTable,
                            java.lang.String parentField)
                     throws ManifoldCFException
        Install or upgrade the table.
        Parameters:
        parentTable - is the parent table.
        parentField - is the parent field.
        Throws:
        ManifoldCFException
      • deleteOwner

        public void deleteOwner​(java.lang.String owner)
                         throws ManifoldCFException
        Delete all records associated with given owner.
        Parameters:
        owner - is the name of the owner.
        Throws:
        ManifoldCFException
      • deleteOldRows

        public void deleteOldRows​(long timeCutoff)
                           throws ManifoldCFException
        Delete records older than a specified time.
        Parameters:
        timeCutoff - is the time, earlier than which records are removed.
        Throws:
        ManifoldCFException
      • addRow

        public java.lang.Long addRow​(java.lang.String connectionName,
                                     long startTime,
                                     long endTime,
                                     long dataSize,
                                     java.lang.String activityType,
                                     java.lang.String entityIdentifier,
                                     java.lang.String resultCode,
                                     java.lang.String resultDescription)
                              throws ManifoldCFException
        Add row to table, and reanalyze if necessary.
        Throws:
        ManifoldCFException
      • simpleReport

        public IResultSet simpleReport​(java.lang.String connectionName,
                                       FilterCriteria criteria,
                                       SortOrder sort,
                                       int startRow,
                                       int maxRowCount)
                                throws ManifoldCFException
        Get a simple history, based on the passed-in filtering criteria and sort order. The resultset returned should have the following columns: "activity","starttime","elapsedtime","resultcode","resultdesc","bytes","identifier".
        Throws:
        ManifoldCFException
      • countHistoryRows

        public long countHistoryRows​(java.lang.String connectionName,
                                     FilterCriteria criteria)
                              throws ManifoldCFException
        Count the number of rows specified by a given set of criteria. This can be used to make decisions as to whether a query based on those rows will complete in an acceptable amount of time.
        Parameters:
        connectionName - is the name of the connection.
        criteria - is the filtering criteria, which selects the records of interest.
        Returns:
        the number of rows included by the criteria.
        Throws:
        ManifoldCFException
      • maxActivityCountReport

        public IResultSet maxActivityCountReport​(java.lang.String connectionName,
                                                 FilterCriteria filterCriteria,
                                                 SortOrder sort,
                                                 BucketDescription idBucket,
                                                 long interval,
                                                 int startRow,
                                                 int maxRowCount)
                                          throws ManifoldCFException
        Get a bucketed history, with sliding window, of maximum activity level. The resultset returned should have the following columns: "starttime","endtime","activitycount","idbucket". An activity is counted as being within the interval window on a prorated basis, which can lead to fractional counts.
        Throws:
        ManifoldCFException
      • maxByteCountReport

        public IResultSet maxByteCountReport​(java.lang.String connectionName,
                                             FilterCriteria filterCriteria,
                                             SortOrder sort,
                                             BucketDescription idBucket,
                                             long interval,
                                             int startRow,
                                             int maxRowCount)
                                      throws ManifoldCFException
        Get a bucketed history, with sliding window, of maximum byte count. The resultset returned should have the following columns: "starttime","endtime","bytecount","idbucket".
        Throws:
        ManifoldCFException
      • addBucketExtract

        protected void addBucketExtract​(java.lang.StringBuilder sb,
                                        java.util.ArrayList list,
                                        java.lang.String columnPrefix,
                                        java.lang.String columnName,
                                        BucketDescription bucketDesc)
        Turn a bucket description into a return column. This is complicated by the fact that the extraction code is inherently case sensitive. So if case insensitive is desired, that means we whack the whole thing to lower case before doing the match.
      • addCriteria

        protected boolean addCriteria​(java.lang.StringBuilder sb,
                                      java.util.ArrayList list,
                                      java.lang.String fieldPrefix,
                                      java.lang.String connectionName,
                                      FilterCriteria criteria,
                                      boolean whereEmitted)
        Add criteria clauses to query.
      • emitClauseStart

        protected boolean emitClauseStart​(java.lang.StringBuilder sb,
                                          boolean whereEmitted)
        Emit a WHERE or an AND, depending...
      • addOrdering

        protected void addOrdering​(java.lang.StringBuilder sb,
                                   java.lang.String[] completeFieldList,
                                   SortOrder sort)
        Add ordering.
      • addLimits

        protected void addLimits​(java.lang.StringBuilder sb,
                                 int startRow,
                                 int maxRowCount)
        Add limit and offset.