com.hazelcast.config

## Class NearCacheConfigReadOnly

- java.lang.Object
- - com.hazelcast.config.NearCacheConfig
  - - com.hazelcast.config.NearCacheConfigReadOnly

- All Implemented Interfaces:
    NamedConfig, DataSerializable, IdentifiedDataSerializable, Serializable

  Deprecated.
  this class will be removed in 4.0; it is meant for internal usage only.

      public class NearCacheConfigReadOnly
      extends NearCacheConfig

  Contains configuration for a Near Cache (read-only).
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.hazelcast.config.NearCacheConfig

      `NearCacheConfig.LocalUpdatePolicy`

  - ### Field Summary

    - ### Fields inherited from class com.hazelcast.config.NearCacheConfig

      `DEFAULT_EVICTION_POLICY, DEFAULT_INVALIDATE_ON_CHANGE, DEFAULT_LOCAL_UPDATE_POLICY, DEFAULT_MAX_IDLE_SECONDS, DEFAULT_MAX_SIZE, DEFAULT_MEMORY_FORMAT, DEFAULT_SERIALIZE_KEYS, DEFAULT_TTL_SECONDS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NearCacheConfigReadOnly()` Deprecated.
    `NearCacheConfigReadOnly(NearCacheConfig config)` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `EvictionConfig` | `getEvictionConfig()` Deprecated. Returns the eviction configuration for this Near Cache.
    `int` | `getId()` Deprecated. Returns type identifier for this class.
    `NearCachePreloaderConfig` | `getPreloaderConfig()` Deprecated. Returns the `NearCachePreloaderConfig` of this Near Cache.
    `NearCacheConfig` | `setCacheLocalEntries(boolean cacheLocalEntries)` Deprecated. Sets if local entries are also cached in the Near Cache.
    `NearCacheConfig` | `setEvictionConfig(EvictionConfig evictionConfig)` Deprecated. Sets the eviction configuration for this Near Cache.
    `NearCacheConfig` | `setEvictionPolicy(String evictionPolicy)` Deprecated. Sets the eviction policy.
    `NearCacheConfig` | `setInMemoryFormat(InMemoryFormat inMemoryFormat)` Deprecated. Sets the data type used to store entries.
    `NearCacheConfig` | `setInMemoryFormat(String inMemoryFormat)` Deprecated.
    `NearCacheConfig` | `setInvalidateOnChange(boolean invalidateOnChange)` Deprecated. Sets if Near Cache entries are invalidated when the entries in the backing data structure are changed (updated or removed).
    `NearCacheConfig` | `setLocalUpdatePolicy(NearCacheConfig.LocalUpdatePolicy localUpdatePolicy)` Deprecated. Sets the `NearCacheConfig.LocalUpdatePolicy` of this Near Cache.
    `NearCacheConfig` | `setMaxIdleSeconds(int maxIdleSeconds)` Deprecated. Set the maximum number of seconds each entry can stay in the Near Cache as untouched (not-read).
    `NearCacheConfig` | `setMaxSize(int maxSize)` Deprecated. Sets the maximum size of the Near Cache.
    `NearCacheConfig` | `setName(String name)` Deprecated. Sets the name of the Near Cache.
    `NearCacheConfig` | `setPreloaderConfig(NearCachePreloaderConfig preloaderConfig)` Deprecated. Sets the `NearCachePreloaderConfig` of this Near Cache.
    `NearCacheConfig` | `setSerializeKeys(boolean serializeKeys)` Deprecated. Sets if the Near Cache key is stored in serialized format or by-reference.
    `NearCacheConfig` | `setTimeToLiveSeconds(int timeToLiveSeconds)` Deprecated. Returns the maximum number of seconds for each entry to stay in the Near Cache (time to live).

    - ### Methods inherited from class com.hazelcast.config.NearCacheConfig

      `equals, getAsReadOnly, getEvictionPolicy, getFactoryId, getInMemoryFormat, getLocalUpdatePolicy, getMaxIdleSeconds, getMaxSize, getName, getTimeToLiveSeconds, hashCode, isCacheLocalEntries, isInvalidateOnChange, isSerializeKeys, readData, toString, writeData`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### NearCacheConfigReadOnly

          public NearCacheConfigReadOnly()

      Deprecated.

    - #### NearCacheConfigReadOnly

          public NearCacheConfigReadOnly(NearCacheConfig config)

      Deprecated.

  - ### Method Detail

    - #### setName

          public NearCacheConfig setName(String name)

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Sets the name of the Near Cache.
      Specified by:
        `setName` in interface `NamedConfig`
      Overrides:
        `setName` in class `NearCacheConfig`
      Parameters:
        `name` - the name of the Near Cache
      Returns:
        this Near Cache config instance

    - #### setTimeToLiveSeconds

          public NearCacheConfig setTimeToLiveSeconds(int timeToLiveSeconds)

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Returns the maximum number of seconds for each entry to stay in the Near Cache (time to live).

      Entries that are older than `timeToLiveSeconds` will automatically be evicted from the Near Cache.

      Accepts any integer between `0` and `Integer.MAX_VALUE`. The value `0` means `Integer.MAX_VALUE`. The default is `0`.

      Overrides:
        `setTimeToLiveSeconds` in class `NearCacheConfig`
      Parameters:
        `timeToLiveSeconds` - the maximum number of seconds for each entry to stay in the Near Cache
      Returns:
        this Near Cache config instance

    - #### setMaxSize

          public NearCacheConfig setMaxSize(int maxSize)

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Sets the maximum size of the Near Cache.

      When the maxSize is reached, the Near Cache is evicted based on the policy defined.

      Accepts any integer between `0` and `Integer.MAX_VALUE`. The value `0` means `Integer.MAX_VALUE`. The default is `0`.

      Overrides:
        `setMaxSize` in class `NearCacheConfig`
      Parameters:
        `maxSize` - the maximum size of the Near Cache
      Returns:
        this Near Cache config instance

    - #### setEvictionPolicy

          public NearCacheConfig setEvictionPolicy(String evictionPolicy)

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Sets the eviction policy.

      Valid values are:

      - `LRU` (Least Recently Used)
      - `LFU` (Least Frequently Used)
      - `NONE` (no extra eviction, time-to-live-seconds or max-idle-seconds may still apply)
      - `RANDOM` (random entry)

      `LRU` is the default. Regardless of the eviction policy used, time-to-live-seconds and max-idle-seconds will still apply.

      Overrides:
        `setEvictionPolicy` in class `NearCacheConfig`
      Parameters:
        `evictionPolicy` - the eviction policy for the Near Cache
      Returns:
        this Near Cache config instance

    - #### setMaxIdleSeconds

          public NearCacheConfig setMaxIdleSeconds(int maxIdleSeconds)

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Set the maximum number of seconds each entry can stay in the Near Cache as untouched (not-read).

      Entries that are not read (touched) more than `maxIdleSeconds` value will get removed from the Near Cache.

      Accepts any integer between `0` and `Integer.MAX_VALUE`. The value `0` means `Integer.MAX_VALUE`. The default is `0`.

      Overrides:
        `setMaxIdleSeconds` in class `NearCacheConfig`
      Parameters:
        `maxIdleSeconds` - maximum number of seconds each entry can stay in the Near Cache as untouched (not-read)
      Returns:
        this Near Cache config instance

    - #### setSerializeKeys

          public NearCacheConfig setSerializeKeys(boolean serializeKeys)

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Sets if the Near Cache key is stored in serialized format or by-reference. NOTE: It's not supported to disable the key serialization when the in-memory-format is `NATIVE`. You can still set this value to `false`, but it will have no effect.
      Overrides:
        `setSerializeKeys` in class `NearCacheConfig`
      Parameters:
        `serializeKeys` - `true` if the key is stored in serialized format, `false` if stored by-reference
      Returns:
        this Near Cache config instance

    - #### setInvalidateOnChange

          public NearCacheConfig setInvalidateOnChange(boolean invalidateOnChange)

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Sets if Near Cache entries are invalidated when the entries in the backing data structure are changed (updated or removed).

      When this setting is enabled, a Hazelcast instance with a Near Cache listens for cluster-wide changes on the entries of the backing data structure and invalidates its corresponding Near Cache entries. Changes done on the local Hazelcast instance always invalidate the Near Cache immediately.

      Overrides:
        `setInvalidateOnChange` in class `NearCacheConfig`
      Parameters:
        `invalidateOnChange` - `true` to enable Near Cache invalidations, `false` otherwise
      Returns:
        this Near Cache config instance

    - #### setInMemoryFormat

          public NearCacheConfig setInMemoryFormat(InMemoryFormat inMemoryFormat)

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Sets the data type used to store entries.

      Possible values:

      - `BINARY`: keys and values are stored as binary data
      - `OBJECT`: values are stored in their object forms
      - `NATIVE`: keys and values are stored in native memory
      The default value is `BINARY`.
      Overrides:
        `setInMemoryFormat` in class `NearCacheConfig`
      Parameters:
        `inMemoryFormat` - the data type used to store entries
      Returns:
        this Near Cache config instance

    - #### setInMemoryFormat

          public NearCacheConfig setInMemoryFormat(String inMemoryFormat)

      Deprecated.
      Overrides:
        `setInMemoryFormat` in class `NearCacheConfig`

    - #### setCacheLocalEntries

          public NearCacheConfig setCacheLocalEntries(boolean cacheLocalEntries)

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Sets if local entries are also cached in the Near Cache.

      This is useful when the in-memory format of the Near Cache is different from the backing data structure. This setting has no meaning on Hazelcast clients, since they have no local entries.

      Overrides:
        `setCacheLocalEntries` in class `NearCacheConfig`
      Parameters:
        `cacheLocalEntries` - `true` if local entries are also cached, `false` otherwise
      Returns:
        this Near Cache config instance

    - #### setLocalUpdatePolicy

          public NearCacheConfig setLocalUpdatePolicy(NearCacheConfig.LocalUpdatePolicy localUpdatePolicy)

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Sets the `NearCacheConfig.LocalUpdatePolicy` of this Near Cache.

      This is only implemented for `JCache` data structures.

      Overrides:
        `setLocalUpdatePolicy` in class `NearCacheConfig`
      Parameters:
        `localUpdatePolicy` - the `NearCacheConfig.LocalUpdatePolicy` of this Near Cache
      Returns:
        this Near Cache config instance

    - #### setEvictionConfig

          public NearCacheConfig setEvictionConfig(EvictionConfig evictionConfig)

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Sets the eviction configuration for this Near Cache.
      Overrides:
        `setEvictionConfig` in class `NearCacheConfig`
      Parameters:
        `evictionConfig` - the eviction configuration
      Returns:
        this Near Cache config instance

    - #### getEvictionConfig

          public EvictionConfig getEvictionConfig()

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Returns the eviction configuration for this Near Cache.
      Overrides:
        `getEvictionConfig` in class `NearCacheConfig`
      Returns:
        the eviction configuration

    - #### setPreloaderConfig

          public NearCacheConfig setPreloaderConfig(NearCachePreloaderConfig preloaderConfig)

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Sets the `NearCachePreloaderConfig` of this Near Cache.
      Overrides:
        `setPreloaderConfig` in class `NearCacheConfig`
      Parameters:
        `preloaderConfig` - the `NearCachePreloaderConfig` of this Near Cache
      Returns:
        this Near Cache config instance

    - #### getPreloaderConfig

          public NearCachePreloaderConfig getPreloaderConfig()

      Deprecated.
      Description copied from class: `NearCacheConfig`
      Returns the `NearCachePreloaderConfig` of this Near Cache.
      Overrides:
        `getPreloaderConfig` in class `NearCacheConfig`
      Returns:
        the `NearCachePreloaderConfig` of this Near Cache

    - #### getId

          public int getId()

      Deprecated.
      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Overrides:
        `getId` in class `NearCacheConfig`
      Returns:
        type ID

Copyright © 2019. All rights reserved.