Class 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
    Name of this policy (to be used to activate it) is KeepLatestOnly
    • Constructor Detail

      • KeepLatestContainerOnlyPolicy

        public KeepLatestContainerOnlyPolicy()
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: Policy
        Returns unique name of the policy so it can be referenced by name
        Specified by:
        getName in interface Policy
        Returns:
        name of the policy
      • getInterval

        public long getInterval()
        Description copied from interface: Policy
        Returns interval (in milliseconds) how often the policy should be applied.
        Specified by:
        getInterval in interface Policy
        Returns:
        interval in milliseconds
      • start

        public void start()
        Description copied from interface: Policy
        Performs operation to start the policy - is executed only once when the policy is created
        Specified by:
        start in interface Policy
      • stop

        public void stop()
        Description copied from interface: Policy
        Performs operation to stop the policy - is executed only once when the policy is destroyed
        Specified by:
        stop in interface Policy
      • apply

        public void apply​(KieServerRegistry kieServerRegistry,
                          KieServer kieServer)
        Description copied from interface: Policy
        Applies given policy on kie server. Actual operations depends on implementation though they can do any operation based on given parameters. kieServer should be used to alter state of the kie server while kieServerRegistry should be used to locate information to evaluate if policy can be applied
        Specified by:
        apply in interface Policy
        Parameters:
        kieServerRegistry - registry of the kie server
        kieServer - actual instance representing kie server to perform operations on containers