Class NonstopConfiguration

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class NonstopConfiguration
    extends java.lang.Object
    implements java.lang.Cloneable
    Configuration class of nonstop caches
    Author:
    Abhishek Sanoujam, Eugene Kononov
    • Field Detail

      • BULK_OPS_TIMEOUT_MULTIPLY_FACTOR

        public static final java.lang.String BULK_OPS_TIMEOUT_MULTIPLY_FACTOR
        System Property name for bulk operations multiply factor
        See Also:
        Constant Field Values
      • DEFAULT_ENABLED

        public static final boolean DEFAULT_ENABLED
        Default value of nonstop attribute
        See Also:
        Constant Field Values
      • DEFAULT_IMMEDIATE_TIMEOUT

        public static final boolean DEFAULT_IMMEDIATE_TIMEOUT
        Default value of immediateTimeout attribute
        See Also:
        Constant Field Values
      • DEFAULT_TIMEOUT_MILLIS

        public static final int DEFAULT_TIMEOUT_MILLIS
        Default value of timeoutMillis attribute
        See Also:
        Constant Field Values
      • DEFAULT_SEARCH_TIMEOUT_MILLIS

        public static final int DEFAULT_SEARCH_TIMEOUT_MILLIS
        Default value of searchTimeoutMillis attribute
        See Also:
        Constant Field Values
      • DEFAULT_BULK_OP_TIMEOUT_FACTOR

        public static final int DEFAULT_BULK_OP_TIMEOUT_FACTOR
        Default value of timeout multiplication factor for bulk operations like removeAll or size
      • DEFAULT_TIMEOUT_BEHAVIOR

        public static final TimeoutBehaviorConfiguration DEFAULT_TIMEOUT_BEHAVIOR
        Default value of timeoutBehavior attribute
    • Constructor Detail

      • NonstopConfiguration

        public NonstopConfiguration()
    • Method Detail

      • freezeConfig

        public void freezeConfig()
        Freeze the config. Once frozen, 'enabled' can't be changed
      • isEnabled

        public boolean isEnabled()
        Returns true if nonstop is enabled in config
        Returns:
        true if nonstop is enabled in config
      • setEnabled

        public void setEnabled​(boolean enabled)
        Set the value of nonstop is enabled or not
        Parameters:
        enabled - the new value
      • enabled

        public NonstopConfiguration enabled​(boolean nonstop)
        Set the value of nonstop
        Parameters:
        nonstop -
        Returns:
        this configuration instance
      • isImmediateTimeout

        public boolean isImmediateTimeout()
        Returns true if immediateTimeout is set to true
        Returns:
        true if immediateTimeout is set to true
      • setImmediateTimeout

        public void setImmediateTimeout​(boolean immediateTimeout)
        Set the value of immediateTimeout
        Parameters:
        immediateTimeout - the new value
      • immediateTimeout

        public NonstopConfiguration immediateTimeout​(boolean immediateTimeout)
        Set the value of immediateTimeout
        Parameters:
        immediateTimeout -
        Returns:
        this configuration instance
      • getTimeoutMillis

        public long getTimeoutMillis()
        Returns the value of timeout in milliseconds
        Returns:
        the value of timeout in milliseconds
      • setTimeoutMillis

        public void setTimeoutMillis​(long timeoutMillis)
        Set the value of timeoutMillis
        Parameters:
        timeoutMillis - the new value
      • getSearchTimeoutMillis

        public long getSearchTimeoutMillis()
        Returns the value of the search timeout in milliseconds
        Returns:
        the value of the search timeout in milliseconds
      • setSearchTimeoutMillis

        public void setSearchTimeoutMillis​(long searchTimeoutMillis)
        Set the value of the search timeout
        Parameters:
        searchTimeoutMillis - the new value
      • getBulkOpsTimeoutMultiplyFactor

        public int getBulkOpsTimeoutMultiplyFactor()
        returns the time out multiplication factor for bulk cache operations
        Returns:
        the value of factor
      • setBulkOpsTimeoutMultiplyFactor

        public void setBulkOpsTimeoutMultiplyFactor​(int bulkOpsTimeoutMultiplyFactor)
        Sets the value of the multiplication factor for bulk cache operations
        Parameters:
        bulkOpsTimeoutMultiplyFactor - the new value
      • timeoutMillis

        public NonstopConfiguration timeoutMillis​(long timeoutMillis)
        Set the value of timeoutMillis
        Parameters:
        timeoutMillis - the new value
        Returns:
        this configuration instance
      • searchTimeoutMillis

        public NonstopConfiguration searchTimeoutMillis​(long searchTimeoutMillis)
        Set the value of the search timeout
        Parameters:
        searchTimeoutMillis - the new value of the search timeout in milliseconds
        Returns:
        this configuration instance
      • getTimeoutBehavior

        public TimeoutBehaviorConfiguration getTimeoutBehavior()
        Returns value of timeoutBehavior configured
        Returns:
        value of timeoutBehavior configured
      • addTimeoutBehavior

        public void addTimeoutBehavior​(TimeoutBehaviorConfiguration timeoutBehavior)
        Set the value of timeoutBehavior
        Parameters:
        timeoutBehavior -
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • clone

        public NonstopConfiguration clone()
                                   throws java.lang.CloneNotSupportedException
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException