Class KeepLatestContainerOnlyPolicy
- java.lang.Object
-
- org.kie.server.services.impl.policy.KeepLatestContainerOnlyPolicy
-
- All Implemented Interfaces:
Policy
public class KeepLatestContainerOnlyPolicy extends Object implements Policy
Policy that will dispose older container and leave only latest one - latest according to version of ReleaseId. Policy by default is scheduled to run once a day, though it can be reconfigured with system properties:- policy.klo.interval - interval how often (expressed as duration) the policy should be applied
- policy.klo.unit - time unit that the interval was specified in - if not given milliseconds are assumed
KeepLatestOnly
-
-
Constructor Summary
Constructors Constructor Description KeepLatestContainerOnlyPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(KieServerRegistry kieServerRegistry, KieServer kieServer)Applies given policy on kie server.longgetInterval()Returns interval (in milliseconds) how often the policy should be applied.StringgetName()Returns unique name of the policy so it can be referenced by namevoidstart()Performs operation to start the policy - is executed only once when the policy is createdvoidstop()Performs operation to stop the policy - is executed only once when the policy is destroyedStringtoString()
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:PolicyReturns unique name of the policy so it can be referenced by name
-
getInterval
public long getInterval()
Description copied from interface:PolicyReturns interval (in milliseconds) how often the policy should be applied.- Specified by:
getIntervalin interfacePolicy- Returns:
- interval in milliseconds
-
start
public void start()
Description copied from interface:PolicyPerforms operation to start the policy - is executed only once when the policy is created
-
stop
public void stop()
Description copied from interface:PolicyPerforms operation to stop the policy - is executed only once when the policy is destroyed
-
apply
public void apply(KieServerRegistry kieServerRegistry, KieServer kieServer)
Description copied from interface:PolicyApplies given policy on kie server. Actual operations depends on implementation though they can do any operation based on given parameters.kieServershould be used to alter state of the kie server whilekieServerRegistryshould be used to locate information to evaluate if policy can be applied
-
-