Class ObjectStoreSettings.Builder

java.lang.Object
org.mule.sdk.api.store.ObjectStoreSettings.Builder
Enclosing class:
ObjectStoreSettings

public static class ObjectStoreSettings.Builder extends Object
A Builder for creating ObjectStoreSettings
Since:
1.0
  • Method Details

    • persistent

      public ObjectStoreSettings.Builder persistent(boolean persistent)
      Sets whether the store should be persistent or transient.

      If not invoked, the described ObjectStore will be persistent by default.

      Parameters:
      persistent - true if the store should be persistent
      Returns:
      this builder
    • maxEntries

      public ObjectStoreSettings.Builder maxEntries(Integer maxEntries)
      Sets the max number of entries allowed. Exceeding entries will be removed when expiration thread runs
      Parameters:
      maxEntries - the number of entries allowed
      Returns:
      this builder
    • entryTtl

      public ObjectStoreSettings.Builder entryTtl(Long entryTtl)
      Sets the entry timeout in milliseconds.
      Parameters:
      entryTtl - timeout in milliseconds
      Returns:
      this builder
    • expirationInterval

      public ObjectStoreSettings.Builder expirationInterval(Long expirationInterval)
      Sets how frequently should the expiration thread run.

      If not set, it will default to ObjectStoreSettings.DEFAULT_EXPIRATION_INTERVAL, but will only be used by the runtime if entryTtl(Long) or maxEntries(Integer) was also invoked.

      Setting this to a value lower or equal than zero is also equivalent to disabling expiration.

      Parameters:
      expirationInterval - interval in milliseconds. Greater than zero
      Returns:
      this builder
    • build

      public ObjectStoreSettings build()
      Returns the built settings object. this instance should be discarded and no longer used after invoking this method
      Returns:
      the built ObjectStoreSettings object