Class CaldavTuningService
The values used to be @Value-injected fields. That is read once,
at bean creation: an administration screen writing them would change
nothing until the next restart, which is worse than having no screen — it
looks like it worked. So the property became the default and the stored
setting became the value, and every value is read where it is used rather
than captured in a field.
The precedence is deliberate and in this order: what an administrator saved,
else what the deployment set as a property, else the coded default. An
operator who manages the instance through exo.properties keeps
working exactly as before until someone saves the screen.
The sweep's cron is not here. A cron cannot be changed at runtime — Spring reads it when the schedule is built — so offering it on a screen would be the same lie this class exists to avoid.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.exoplatform.commons.api.settings.data.ScopeWhere the saved values live: global, not per user. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonglongintlonglongorg.exoplatform.caldav.model.CaldavSyncTuningEvery value as it stands now.voidsaveTuning(org.exoplatform.caldav.model.CaldavSyncTuning tuning) Records what an administrator chose.
-
Field Details
-
TUNING_SCOPE
public static final org.exoplatform.commons.api.settings.data.Scope TUNING_SCOPEWhere the saved values live: global, not per user.
-
-
Constructor Details
-
CaldavTuningService
public CaldavTuningService()
-
-
Method Details
-
getTuning
public org.exoplatform.caldav.model.CaldavSyncTuning getTuning()Every value as it stands now.- Returns:
- the tuning in force
-
saveTuning
public void saveTuning(org.exoplatform.caldav.model.CaldavSyncTuning tuning) Records what an administrator chose.Every value is bounded here rather than in the screen: a form validates what someone types, a service validates what reaches it. A window of ten years is refused because it turns every first page load of the day into a full download of a decade of history.
- Parameters:
tuning- what to store- Throws:
IllegalArgumentException- when a value is out of range, carrying the message code the screen shows
-
getThrottleMinutes
public long getThrottleMinutes()- Returns:
- how long a synchronisation triggered by opening the agenda stays valid
-
getPastDays
public long getPastDays()- Returns:
- how far back the imported window reaches, in days
-
getFutureDays
public long getFutureDays()- Returns:
- how far forward the imported window reaches, in days
-
getSweepStaleMinutes
public long getSweepStaleMinutes()- Returns:
- how long since a successful sync makes a binding worth sweeping
-
getSweepBatchSize
public int getSweepBatchSize()- Returns:
- how many stale bindings one sweep looks at
-