Class ObserverHelper
- java.lang.Object
-
- org.ametys.cms.content.indexing.solr.observation.ObserverHelper
-
public final class ObserverHelper extends Object
This helper centralize a few common helper methods
-
-
Field Summary
Fields Modifier and Type Field Description private static int
_suspended
-
Constructor Summary
Constructors Modifier Constructor Description private
ObserverHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isNotSuspendedObservationForIndexation()
Is events observation suspended for indexation?static void
restartObservationForIndexation()
Expert method
Listen to events again after a call tosuspendObservationForIndexation()
You have to callrestartObservationForIndexation()
the same number of times you called beforesuspendObservationForIndexation()
static void
suspendObservationForIndexation()
Expert method
This should only be used when there is only one thread working at that time (i.e.
-
-
-
Field Detail
-
_suspended
private static int _suspended
-
-
Constructor Detail
-
ObserverHelper
private ObserverHelper()
-
-
Method Detail
-
suspendObservationForIndexation
public static void suspendObservationForIndexation()
Expert method
This should only be used when there is only one thread working at that time (i.e. during the initialization of the application) and that you manually do the global indexing after your long process.
All threads will not index anymore after observed events
CallrestartObservationForIndexation()
to listen to events again.
You have to callrestartObservationForIndexation()
the same number of times you called beforesuspendObservationForIndexation()
-
isNotSuspendedObservationForIndexation
public static boolean isNotSuspendedObservationForIndexation()
Is events observation suspended for indexation?- Returns:
- true if events are not suspended, false otherwise.
-
restartObservationForIndexation
public static void restartObservationForIndexation()
Expert method
Listen to events again after a call tosuspendObservationForIndexation()
You have to callrestartObservationForIndexation()
the same number of times you called beforesuspendObservationForIndexation()
-
-