Class SubscriptionState
java.lang.Object
com.evolveum.midpoint.repo.common.subscription.SubscriptionState
- All Implemented Interfaces:
DebugDumpable
,Serializable
The state of the subscription with regards to the current situation
(subscription ID presence, time, system features, and so on).
See e.g.
-
isActive()
- isDemo()
- isInGracePeriod()
- isProductionEnvironment()
- ...- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Representation of the subscription validity interval.static enum
Enumeration for the validity status of the subscription. -
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Method Summary
Modifier and TypeMethodDescriptiondebugDump
(int indent) static @NotNull SubscriptionState
determine
(@NotNull SubscriptionId subscriptionId, @NotNull SystemFeatures systemFeatures) static SubscriptionState
error()
To be called in rare situations when there is either no information about the subscription and/or we cannot retrieve the system features.int
How many days remains to the end of the grace period (if there's one for this kind of subscription)? For example, if the subscription ends 05/24, then the grace period ends on August 31st, 2024 (assuming 3-months period), and the "no subscription" period starts on September 1st, 2024.int
Returns the # of months after the subscription period ended.@NotNull SystemFeatures
boolean
isActive()
Is the subscription active? The subscription ID must be well-formed, and within its time validity period.boolean
Should we allow clustering? In production environments ONLY with an active subscription.boolean
isDemo()
Is this a demo subscription? Note that the subscription itself may be expired.boolean
Is used generic repo (other than H2) and we detectboolean
Just a convenience method.boolean
Is the (well-formed) subscription in the grace period?boolean
Do we think we run in a production environment (regardless of the subscription ID present or not)?toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Method Details
-
determine
@NotNull public static @NotNull SubscriptionState determine(@NotNull @NotNull SubscriptionId subscriptionId, @NotNull @NotNull SystemFeatures systemFeatures) -
error
To be called in rare situations when there is either no information about the subscription and/or we cannot retrieve the system features. This can happen e.g. if the system configuration cannot be completely retrieved because of a schema exception (that should be quite rare, as the "normal" issues of e.g. missing extension schema should be handled gracefully by the repository). -
getMonthsAfter
public int getMonthsAfter()Returns the # of months after the subscription period ended. Call only with well-formed subscriptions! -
getDaysToGracePeriodGone
public int getDaysToGracePeriodGone()How many days remains to the end of the grace period (if there's one for this kind of subscription)? For example, if the subscription ends 05/24, then the grace period ends on August 31st, 2024 (assuming 3-months period), and the "no subscription" period starts on September 1st, 2024. So, on September 1st (or later), the returned value is 0; on August 31st, the returned value is 1; and so on. Call only with well-formed subscriptions! -
isActive
public boolean isActive()Is the subscription active? The subscription ID must be well-formed, and within its time validity period. (The grace period - if available - counts also as the validity.) The expired or malformed subscriptions give `false` here. -
isInGracePeriod
public boolean isInGracePeriod()Is the (well-formed) subscription in the grace period? -
isDemo
public boolean isDemo()Is this a demo subscription? Note that the subscription itself may be expired. -
isInactiveOrDemo
public boolean isInactiveOrDemo()Just a convenience method. -
isGenericRepoWithoutSubscription
public boolean isGenericRepoWithoutSubscription()Is used generic repo (other than H2) and we detect -
isProductionEnvironment
public boolean isProductionEnvironment()Do we think we run in a production environment (regardless of the subscription ID present or not)? -
isClusteringAvailable
public boolean isClusteringAvailable()Should we allow clustering? In production environments ONLY with an active subscription. -
getSystemFeatures
-
toString
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-