Class MonitorMetaEventUtil


  • public class MonitorMetaEventUtil
    extends java.lang.Object
    Utility class for operations related to monitor events metadata.
    Since:
    17.0.0
    Version:
    $Revision: 26586 $ $Date: 2024-08-26 21:06:04 -0300 (Mon, 26 Aug 2024) $
    See Also:
    MonitorMetaEventDocumentType
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isSimilar​(java.lang.String str1, java.lang.String str2)
      Returns if two strings are similar enough so they do not need both to be provided as information to the AI.
      static void recreateIndex()
      Recreates the monitor meta event index, also reindexing current active events.
      static void scheduleReindexEvent​(IMonitorEventSPI event)
      Schedules a event to be reindexed after the current transaction is committed.
      static void scheduleRemoveEventFromIndex​(java.lang.String eventId)
      Schedules a event to be removed from the index after the current transaction is committed.
      • Methods inherited from class java.lang.Object

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

      • MonitorMetaEventUtil

        public MonitorMetaEventUtil()
    • Method Detail

      • recreateIndex

        public static void recreateIndex()
        Recreates the monitor meta event index, also reindexing current active events.
        Since:
        17.0.0
      • scheduleReindexEvent

        public static void scheduleReindexEvent​(IMonitorEventSPI event)
                                         throws PortalException
        Schedules a event to be reindexed after the current transaction is committed. This adds, updates or removes the event's meta data document from the index as necessary.
        Parameters:
        event - the event.
        Throws:
        PortalException
        Since:
        17.0.0
      • scheduleRemoveEventFromIndex

        public static void scheduleRemoveEventFromIndex​(java.lang.String eventId)
                                                 throws PortalException
        Schedules a event to be removed from the index after the current transaction is committed.
        Parameters:
        eventId - the event identifier.
        Throws:
        PortalException
        Since:
        17.0.0
      • isSimilar

        public static boolean isSimilar​(java.lang.String str1,
                                        java.lang.String str2)
        Returns if two strings are similar enough so they do not need both to be provided as information to the AI.

        This method classify two strings as similar if their alphanumeric characters are equal. This way if they differ only in spaces and punctuation they will still be considered similar.

        Parameters:
        str1 - the first string.
        str2 - the second string.
        Returns:
        true if the strings are similar.
        Since:
        17.0.0