Class LoggerUtility



  • public final class LoggerUtility
    extends java.lang.Object
    The Class LoggerUtility.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <L extends TrimLogger<T>,T>
      void
      clearLogs​(java.util.Collection<L> aLoggers)
      Functionality to address multiple TrimLogger instances to clear the provided TrimLogger instances (multi-threaded).
      static <L extends TrimLogger<T>,T>
      void
      deleteLogs​(org.refcodes.criteria.Criteria aCriteria, java.util.Collection<L> aLoggers)
      Functionality to query multiple TrimLogger instances with the same query to delete log lines from the provided TrimLogger instances (multi-threaded).
      static <L extends QueryLogger<T>,T>
      org.refcodes.tabular.Records<T>
      findLogs​(org.refcodes.criteria.Criteria aCriteria, org.refcodes.tabular.Header<T> aHeader, int aLimit, java.util.Collection<L> aLoggers, org.refcodes.controlflow.InvocationStrategy aRecordServeStrategy)
      Functionality to query multiple QueryLogger instances with the same query and returning a single composite Records instance containing all Record instances returned by the queried QueryLogger instances (multi-threaded).
      static java.lang.String getSchemaName​(java.lang.String aSchemaBody, int aIndex)
      Required to create a schema name for a Logger being part of a composite Logger (or its sub-types) and which is being created by a LoggerFactory.
      static java.lang.String getSchemaName​(java.lang.String aSchemaPrefix, java.lang.String aSchemaSuffix)
      Required to create a schema name for a Logger being part of a parted Logger (or its sub-types) and which is being created by a LoggerFactory.
      • Methods inherited from class java.lang.Object

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

      • getSchemaName

        public static java.lang.String getSchemaName​(java.lang.String aSchemaBody,
                                                     int aIndex)
        Required to create a schema name for a Logger being part of a composite Logger (or its sub-types) and which is being created by a LoggerFactory.
        Parameters:
        aSchemaBody - The body part of the schema name.
        aIndex - The index number of the encapsulated Logger in question.
        Returns:
        The schema name created in a uniform way.
      • getSchemaName

        public static java.lang.String getSchemaName​(java.lang.String aSchemaPrefix,
                                                     java.lang.String aSchemaSuffix)
        Required to create a schema name for a Logger being part of a parted Logger (or its sub-types) and which is being created by a LoggerFactory.
        Parameters:
        aSchemaPrefix - The prefix part of the schema name.
        aSchemaSuffix - The suffix part of the schema name.
        Returns:
        The schema name created in a uniform way.
      • findLogs

        public static <L extends QueryLogger<T>,T> org.refcodes.tabular.Records<T> findLogs​(org.refcodes.criteria.Criteria aCriteria,
                                                                                            org.refcodes.tabular.Header<T> aHeader,
                                                                                            int aLimit,
                                                                                            java.util.Collection<L> aLoggers,
                                                                                            org.refcodes.controlflow.InvocationStrategy aRecordServeStrategy)
        Functionality to query multiple QueryLogger instances with the same query and returning a single composite Records instance containing all Record instances returned by the queried QueryLogger instances (multi-threaded). This functionality is in common for both composite as well as parted QueryLogger (or its sub-classes) instances.
        Type Parameters:
        L - The Logger type to be used.
        T - The type of the Record instances managed by the Logger.
        Parameters:
        aCriteria - The query for querying the provides QueryLogger (or sub-classes).
        aHeader - The Header specifying the Header to be contained in the result.
        aLimit - The maximum number of elements to be returned by each individual logger. TODO: To avoid a quick and dirty solution for this parameter to specify the number of elements in the result, some strategy is to be applied to querying the encapsulated QueryLogger instances, just dividing the limit by the number of encapsulated QueryLogger instances will often enough result in too few elements in the result. A memory wasting approach would be to pass the limit to the CompositeRecords, which stops serving elements when the limit is reached :-(
        aLoggers - The QueryLogger instances (or its sub-types) which are to be queried.
        aRecordServeStrategy - The strategy with which to serve the Record instances in the returned Records instance, meaning which encapsulated QueryLogger's result is to be served next upon the Iterator.next() invocation. The InvocationStrategy.ROUND_ROBIN is proposed as of timeouts and "forgotten" results in case one of the QueryLogger's result is fetched too late (this depends on how long the underlying physical data sink provides for the result).
        Returns:
        A Records instance containing all the found Record instances.
      • deleteLogs

        public static <L extends TrimLogger<T>,T> void deleteLogs​(org.refcodes.criteria.Criteria aCriteria,
                                                                  java.util.Collection<L> aLoggers)
        Functionality to query multiple TrimLogger instances with the same query to delete log lines from the provided TrimLogger instances (multi-threaded).
        Type Parameters:
        L - The Logger type to be used.
        T - The type of the Record instances managed by the Logger.
        Parameters:
        aCriteria - The Criteria to be used when querying the TrimLogger instances.
        aLoggers - The TrimLogger instances (or its sub-types) which are to be queried.
      • clearLogs

        public static <L extends TrimLogger<T>,T> void clearLogs​(java.util.Collection<L> aLoggers)
        Functionality to address multiple TrimLogger instances to clear the provided TrimLogger instances (multi-threaded).
        Type Parameters:
        L - The Logger type to be used.
        T - The type of the Record instances managed by the Logger.
        Parameters:
        aLoggers - The TrimLogger instances (or its sub-types) which are to be used.