Class SubscriptionState.TimeValidity
java.lang.Object
com.evolveum.midpoint.repo.common.subscription.SubscriptionState.TimeValidity
- All Implemented Interfaces:
Serializable
- Enclosing class:
- SubscriptionState
@VisibleForTesting
public static class SubscriptionState.TimeValidity
extends Object
implements Serializable
Representation of the subscription validity interval.
- See Also:
-
Constructor Summary
ConstructorDescriptionTimeValidity
(@NotNull LocalDate firstDayAfter, @NotNull Period gracePeriod, @NotNull SubscriptionState.TimeValidityStatus status) -
Method Summary
Modifier and TypeMethodDescriptionint
daysToGracePeriodGone
(@NotNull LocalDate now) determine
(@NotNull SubscriptionId subscriptionId) int
getMonthsAfter
(@NotNull LocalDate now) How many months passed since the first day after the subscription validity to now.boolean
isActive()
Is this state generally considered "active"? As for the grace period, note that not all subscriptions have it.boolean
toString()
-
Constructor Details
-
TimeValidity
public TimeValidity(@NotNull @NotNull LocalDate firstDayAfter, @NotNull @NotNull Period gracePeriod, @NotNull @NotNull SubscriptionState.TimeValidityStatus status)
-
-
Method Details
-
determine
@VisibleForTesting public static SubscriptionState.TimeValidity determine(@NotNull @NotNull SubscriptionId subscriptionId) -
getMonthsAfter
How many months passed since the first day after the subscription validity to now. Incomplete months are counted as well. For example, if the subscription ends 05/24, then the first month starts on June 1st, 2024 (inclusive), the second month starts on July 1st, 2024 (inclusive), and so on. -
daysToGracePeriodGone
-
isActive
public boolean isActive()Is this state generally considered "active"? As for the grace period, note that not all subscriptions have it. For those that do, it is considered still active, although with potential limitations. -
isInGracePeriod
public boolean isInGracePeriod() -
toString
-