Interface NamedCacheService

All Superinterfaces:
GrpcProxyService
All Known Implementing Classes:
BaseNamedCacheServiceImpl, HelidonNamedCacheService, NettyNamedCacheService

public interface NamedCacheService extends GrpcProxyService
A NamedCache service.
Since:
20.06
Author:
Mahesh Kannan 2019.11.01, Jonathan Knight 2019.11.07
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    The default NamedCacheService.Dependencies implementation.
    static interface 
    The dependencies to configure a NamedCacheService.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The name of the gRPC service.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addIndex(com.oracle.coherence.grpc.AddIndexRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer)
    Add an index to a cache.
    void
    aggregate(com.oracle.coherence.grpc.AggregateRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
    Execute an AggregateRequest against a cache and return the result serialized in a BytesValue.
    void
    clear(com.oracle.coherence.grpc.ClearRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer)
    Clear a cache.
    void
    containsEntry(com.oracle.coherence.grpc.ContainsEntryRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
    Returns true if this map contains a mapping for the specified key to the specified value.
    void
    containsKey(com.oracle.coherence.grpc.ContainsKeyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
    Returns true if this map contains a mapping for the specified key.
    void
    containsValue(com.oracle.coherence.grpc.ContainsValueRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
    Returns true if this map contains a mapping for the specified value.
    createRequestHolder(Req request, String sScope, String sCacheName, String format)
    Create a CacheRequestHolder for a given request.
    void
    destroy(com.oracle.coherence.grpc.DestroyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer)
    Destroy a cache.
    <T> Filter<T>
    ensureFilter(com.google.protobuf.ByteString bytes, Serializer serializer)
    Obtain a Filter from the serialized data in a ByteString.
    void
    entrySet(com.oracle.coherence.grpc.EntrySetRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)
    Stream a set of cache entries to a StreamObserver.
    io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.MapListenerRequest>
    events(io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.MapListenerResponse> observer)
    Add a MapListener to a cache and stream the events received to the StreamObserver.
    void
    get(com.oracle.coherence.grpc.GetRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.OptionalValue> observer)
    Get a value for a given key from a cache.
    void
    getAll(com.oracle.coherence.grpc.GetAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)
    Obtain a stream of mappings of keys to values for all the specified keys.
    <T> Filter<T>
    getFilter(com.google.protobuf.ByteString bytes, Serializer serializer)
    Obtain a Filter from the serialized data in a ByteString.
    void
    invoke(com.oracle.coherence.grpc.InvokeRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
    Invoke an InvocableMap.EntryProcessor against an entry in a cache.
    void
    invokeAll(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)
    Invoke an InvocableMap.EntryProcessor against multiple entries in a cache.
    void
    isEmpty(com.oracle.coherence.grpc.IsEmptyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
    Determine whether a cache is empty.
    void
    isReady(com.oracle.coherence.grpc.IsReadyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
    Determine whether a cache is Ready.
    void
    keySet(com.oracle.coherence.grpc.KeySetRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
    Stream a set of cache keys to a StreamObserver.
    void
    nextEntrySetPage(com.oracle.coherence.grpc.PageRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.EntryResult> observer)
    Obtain the next page of a paged entry set request.
    void
    nextKeySetPage(com.oracle.coherence.grpc.PageRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
    Obtain the next page of a paged key set request.
    void
    put(com.oracle.coherence.grpc.PutRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
    Associate the specified value with the specified key in this cache.
    void
    putAll(com.oracle.coherence.grpc.PutAllRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer)
    Add the specified key value pair mappings to this cache.
    void
    putIfAbsent(com.oracle.coherence.grpc.PutIfAbsentRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
    If the specified key is not already associated with a value (or is mapped to null) associate it with the given value and returns null, else return the current value.
    void
    remove(com.oracle.coherence.grpc.RemoveRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
    Remove the mapping that is associated with the specified key.
    void
    removeIndex(com.oracle.coherence.grpc.RemoveIndexRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer)
    Remove an index from a cache.
    void
    removeMapping(com.oracle.coherence.grpc.RemoveMappingRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
    Remove the mapping that is associated with the specified key only if the mapping exists in the cache.
    void
    replace(com.oracle.coherence.grpc.ReplaceRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
    Replace the entry for the specified key only if it is currently mapped to some value.
    void
    replaceMapping(com.oracle.coherence.grpc.ReplaceMappingRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
    Replace the mapping for the specified key only if currently mapped to the specified value.
    void
    size(com.oracle.coherence.grpc.SizeRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Int32Value> observer)
    Determine the number of entries in a cache.
    void
    truncate(com.oracle.coherence.grpc.TruncateRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer)
    Removes all mappings from this map.
    void
    values(com.oracle.coherence.grpc.ValuesRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
    Stream a set of cache values to a StreamObserver.

    Methods inherited from interface com.oracle.coherence.grpc.proxy.common.GrpcProxyService

    getMetrics
  • Field Details

  • Method Details

    • addIndex

      void addIndex(com.oracle.coherence.grpc.AddIndexRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer)
      Add an index to a cache.
      Parameters:
      request - the AddIndexRequest containing the name of the cache to add the index to, the serialized ValueExtractor to use to create the index and the optional serialized Comparator to sort the index
      observer - the StreamObserver to receive the response
    • aggregate

      void aggregate(com.oracle.coherence.grpc.AggregateRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
      Execute an AggregateRequest against a cache and return the result serialized in a BytesValue.
      Parameters:
      request - the AggregateRequest to execute
      observer - the StreamObserver to receive the response
    • clear

      void clear(com.oracle.coherence.grpc.ClearRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer)
      Clear a cache.
      Parameters:
      request - the ClearRequest to execute
      observer - the StreamObserver to receive the response
      See Also:
    • containsEntry

      void containsEntry(com.oracle.coherence.grpc.ContainsEntryRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
      Returns true if this map contains a mapping for the specified key to the specified value.
      Parameters:
      request - the request which contains the key and value whose presence in this map is to be tested
      observer - the StreamObserver to receive the response
      See Also:
    • containsKey

      void containsKey(com.oracle.coherence.grpc.ContainsKeyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
      Returns true if this map contains a mapping for the specified key.
      Parameters:
      request - the request which contains the key whose presence in this map is to be tested
      observer - the StreamObserver to receive the response
      See Also:
    • containsValue

      void containsValue(com.oracle.coherence.grpc.ContainsValueRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
      Returns true if this map contains a mapping for the specified value.
      Parameters:
      request - the request which contains the value whose presence in this map is to be tested
      observer - the StreamObserver to receive the response
      See Also:
    • destroy

      void destroy(com.oracle.coherence.grpc.DestroyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer)
      Destroy a cache.
      Parameters:
      request - the DestroyRequest containing the name of the cache to destroy
      observer - the StreamObserver to receive the response
    • entrySet

      void entrySet(com.oracle.coherence.grpc.EntrySetRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)
      Stream a set of cache entries to a StreamObserver.
      Parameters:
      request - the EntrySetRequest to execute
      observer - the StreamObserver to stream the entries to
      See Also:
    • events

      io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.MapListenerRequest> events(io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.MapListenerResponse> observer)
      Add a MapListener to a cache and stream the events received to the StreamObserver.
      Parameters:
      observer - the StreamObserver to receive events
      Returns:
      a StreamObserver that will be closed by the client to end event subscription
    • get

      void get(com.oracle.coherence.grpc.GetRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.OptionalValue> observer)
      Get a value for a given key from a cache.
      Parameters:
      request - the GetRequest to execute
      observer - the StreamObserver to receive events
      See Also:
    • getAll

      void getAll(com.oracle.coherence.grpc.GetAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)
      Obtain a stream of mappings of keys to values for all the specified keys.
      Parameters:
      request - the GetAllRequest request containing the cache name and collection of keys to obtain the mappings for
      observer - the StreamObserver to stream the results back to
    • invoke

      void invoke(com.oracle.coherence.grpc.InvokeRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
      Invoke an InvocableMap.EntryProcessor against an entry in a cache.
      Parameters:
      request - the InvokeRequest containing the serialized key of the entry and the serialized InvocableMap.EntryProcessor
      observer - the StreamObserver to stream the results back to
    • invokeAll

      void invokeAll(com.oracle.coherence.grpc.InvokeAllRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.Entry> observer)
      Invoke an InvocableMap.EntryProcessor against multiple entries in a cache.
      Parameters:
      request - the InvokeRequest containing the serialized keys or serialized Filter to use to identify the entries and the serialized InvocableMap.EntryProcessor
      observer - the StreamObserver to observer the invocation results
    • isEmpty

      void isEmpty(com.oracle.coherence.grpc.IsEmptyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
      Determine whether a cache is empty.
      Parameters:
      request - the IsEmptyRequest to execute
      observer - the StreamObserver to observer the invocation results
      See Also:
    • isReady

      void isReady(com.oracle.coherence.grpc.IsReadyRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
      Determine whether a cache is Ready.
      Parameters:
      request - the IsReadyRequest to execute
      observer - the StreamObserver to observer the invocation results
      Since:
      14.1.1.2206.5
      See Also:
    • keySet

      void keySet(com.oracle.coherence.grpc.KeySetRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
      Stream a set of cache keys to a StreamObserver.
      Parameters:
      request - the KeySetRequest to execute
      observer - the StreamObserver to stream the keys to
      See Also:
    • nextEntrySetPage

      void nextEntrySetPage(com.oracle.coherence.grpc.PageRequest request, io.grpc.stub.StreamObserver<com.oracle.coherence.grpc.EntryResult> observer)
      Obtain the next page of a paged entry set request.
      Parameters:
      request - the PageRequest to execute
      observer - the StreamObserver that will receive the responses
    • nextKeySetPage

      void nextKeySetPage(com.oracle.coherence.grpc.PageRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
      Obtain the next page of a paged key set request.
      Parameters:
      request - the PageRequest to execute
      observer - the StreamObserver that will receive the responses
    • put

      void put(com.oracle.coherence.grpc.PutRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
      Associate the specified value with the specified key in this cache. If the cache previously contained a mapping for the key, the old value is replaced by the specified value.
      Parameters:
      request - the PutRequest to execute
      observer - the StreamObserver that will receive the responses
      See Also:
    • putAll

      void putAll(com.oracle.coherence.grpc.PutAllRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer)
      Add the specified key value pair mappings to this cache. If the cache previously contained a mappings for the keys, the old value is replaced by the specified value.
      Parameters:
      request - the PutAllRequest to execute
      observer - the StreamObserver that will receive the responses
      See Also:
    • putIfAbsent

      void putIfAbsent(com.oracle.coherence.grpc.PutIfAbsentRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
      If the specified key is not already associated with a value (or is mapped to null) associate it with the given value and returns null, else return the current value.
      Parameters:
      request - the PutIfAbsentRequest to execute
      observer - the StreamObserver that will receive the responses
      See Also:
    • remove

      void remove(com.oracle.coherence.grpc.RemoveRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
      Remove the mapping that is associated with the specified key.
      Parameters:
      request - the RemoveRequest to execute
      observer - the StreamObserver that will receive the responses
      See Also:
    • removeIndex

      void removeIndex(com.oracle.coherence.grpc.RemoveIndexRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer)
      Remove an index from a cache.
      Parameters:
      request - the RemoveIndexRequest containing the name of the cache to remove the index from, the serialized ValueExtractor that was used to create the index
      observer - the StreamObserver that will receive the responses
    • removeMapping

      void removeMapping(com.oracle.coherence.grpc.RemoveMappingRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
      Remove the mapping that is associated with the specified key only if the mapping exists in the cache.
      Parameters:
      request - the RemoveMappingRequest to execute
      observer - the StreamObserver that will receive the responses
      See Also:
    • replace

      void replace(com.oracle.coherence.grpc.ReplaceRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
      Replace the entry for the specified key only if it is currently mapped to some value.
      Parameters:
      request - the ReplaceRequest to execute
      observer - the StreamObserver that will receive the responses
      See Also:
    • replaceMapping

      void replaceMapping(com.oracle.coherence.grpc.ReplaceMappingRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BoolValue> observer)
      Replace the mapping for the specified key only if currently mapped to the specified value.
      Parameters:
      request - the ReplaceMappingRequest to execute
      observer - the StreamObserver that will receive the responses
      See Also:
    • size

      void size(com.oracle.coherence.grpc.SizeRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Int32Value> observer)
      Determine the number of entries in a cache.
      Parameters:
      request - the SizeRequest to execute
      observer - the StreamObserver that will receive the responses
      See Also:
    • truncate

      void truncate(com.oracle.coherence.grpc.TruncateRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> observer)
      Removes all mappings from this map.

      Note: the removal of entries caused by this truncate operation will not be observable. This includes any registered listeners, triggers, or interceptors. However, a CacheLifecycleEvent is raised to notify subscribers of the execution of this operation.

      Parameters:
      request - the TruncateRequest containing the name of the cache to truncate
      observer - the StreamObserver that will receive the responses
    • values

      void values(com.oracle.coherence.grpc.ValuesRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.BytesValue> observer)
      Stream a set of cache values to a StreamObserver.
      Parameters:
      request - the ValuesRequest to execute
      observer - the StreamObserver to stream the values to
      See Also:
    • createRequestHolder

      <Req> CacheRequestHolder<Req,Void> createRequestHolder(Req request, String sScope, String sCacheName, String format)
      Create a CacheRequestHolder for a given request.
      Type Parameters:
      Req - the type of the request
      Parameters:
      request - the request object to add to the holder
      sScope - the scope name to use to identify the CCF to obtain the cache from
      sCacheName - the name of the cache that the request executes against
      format - the optional serialization format used by requests that contain a payload
      Returns:
      the CacheRequestHolder holding the request
    • ensureFilter

      <T> Filter<T> ensureFilter(com.google.protobuf.ByteString bytes, Serializer serializer)
      Obtain a Filter from the serialized data in a ByteString.

      If the ByteString is null or ByteString.EMPTY then an AlwaysFilter is returned.

      Type Parameters:
      T - the Filter type
      Parameters:
      bytes - the ByteString containing the serialized Filter
      serializer - the serializer to use
      Returns:
      a deserialized Filter
    • getFilter

      <T> Filter<T> getFilter(com.google.protobuf.ByteString bytes, Serializer serializer)
      Obtain a Filter from the serialized data in a ByteString.
      Type Parameters:
      T - the Filter type
      Parameters:
      bytes - the ByteString containing the serialized Filter
      serializer - the serializer to use
      Returns:
      a deserialized Filter or null if no filter is set