Interface DistributedSetCacheClient

All Superinterfaces:
ConfigurableComponent, ControllerService

@Tags({"distributed","client","cluster","set","cache"}) @CapabilityDescription("Provides the ability to communicate with a DistributedSetCacheServer. This allows multiple nodes to coordinate state with a single remote entity.") public interface DistributedSetCacheClient extends ControllerService
This interface defines an API that can be used for interacting with a Distributed Cache that functions similarly to a Set.
  • Method Details

    • addIfAbsent

      <T> boolean addIfAbsent(T value, Serializer<T> serializer) throws IOException
      Adds the specified value to the cache, serializing the value with the given Serializer.
      Type Parameters:
      T - type
      Parameters:
      value - value
      serializer - serializer
      Returns:
      true if the value was added to the cache, false if the value already existed in the cache
      Throws:
      IOException - if unable to communicate with the remote instance
    • contains

      <T> boolean contains(T value, Serializer<T> serializer) throws IOException
      Type Parameters:
      T - type
      Parameters:
      value - value
      serializer - serializer
      Returns:
      if the given value is present in the cache and if so returns true, else returns false
      Throws:
      IOException - if unable to communicate with the remote instance
    • remove

      <T> boolean remove(T value, Serializer<T> serializer) throws IOException
      Removes the given value from the cache, if it is present.
      Type Parameters:
      T - type
      Parameters:
      value - value
      serializer - serializer
      Returns:
      true if the value is removed, false if the value did not exist in the cache
      Throws:
      IOException - ex
    • close

      void close() throws IOException
      Attempts to notify the server that we are finished communicating with it and cleans up resources
      Throws:
      IOException - ex