Package kvd.client

Interface KvdOperations

    • Method Detail

      • putAsync

        Future<OutputStream> putAsync​(byte[] key)
        Put a new value or replace an existing.
        Parameters:
        key - key with which the specified value is to be associated
        Returns:
        Future that evaluates either to an OutputStream to be used to stream the value in. or fails (e.g. on optimistic lock or deadlock). Close the OutputStream to signal that the value is complete.
      • getAsync

        Future<InputStream> getAsync​(byte[] key)
        Returns the value to which the specified key is mapped
        Parameters:
        key - the key whose associated value is to be returned
        Returns:
        Future that evaluates either to an InputStream for keys that exist or null for keys that don't exist on the server.
      • containsAsync

        Future<Boolean> containsAsync​(byte[] key)
        The returned Future evaluates to true if the key exists on the server, false otherwise
        Parameters:
        key - The key whose presence is to be tested
        Returns:
        Future evaluates to true if the key exists on the server, false otherwise
      • removeAsync

        Future<Boolean> removeAsync​(byte[] key)
        Removes the mapping for the specified key from the server.
        Parameters:
        key - key whose mapping is to be removed
        Returns:
        Future which evaluates to true if the key/value was removed from the server, false otherwise.
      • putAsync

        default Future<OutputStream> putAsync​(String key)
        Put a new value or replace an existing.
        Parameters:
        key - key with which the specified value is to be associated
        Returns:
        Future that evaluates either to an OutputStream to be used to stream the value in. or fails (e.g. on optimistic lock or deadlock). Close the OutputStream to signal that the value is complete.
      • put

        default OutputStream put​(String key)
        Put a new value or replace an existing.
        Parameters:
        key - key with which the specified value is to be associated
        Returns:
        OutputStream to be used to stream the value in. Close the OutputStream to signal that the value is complete.
      • put

        default OutputStream put​(byte[] key)
        Put a new value or replace an existing.
        Parameters:
        key - key with which the specified value is to be associated
        Returns:
        OutputStream to be used to stream the value in. Close the OutputStream to signal that the value is complete.
      • getAsync

        default Future<InputStream> getAsync​(String key)
        Returns the value to which the specified key is mapped
        Parameters:
        key - the key whose associated value is to be returned
        Returns:
        Future that evaluates either to an InputStream for keys that exist or null for keys that don't exist on the server.
      • get

        default InputStream get​(String key)
        Convenience method that calls getAsync(String) and waits for the Future to complete.
        Parameters:
        key - key the key whose associated value is to be returned
        Returns:
        the InputStream for keys that exist or null for keys that don't exist on the server.
      • get

        default InputStream get​(byte[] key)
        Convenience method that calls getAsync(String) and waits for the Future to complete.
        Parameters:
        key - key the key whose associated value is to be returned
        Returns:
        the InputStream for keys that exist or null for keys that don't exist on the server.
      • putString

        default void putString​(String key,
                               String value,
                               String charsetName)
        Convenience method that puts a String value.
        Parameters:
        key - key with which the specified value is to be associated
        value - value to be associated with the specified key. null values are not supported
        charsetName - the name of the requested charset, null means platform default
      • putString

        default void putString​(String key,
                               String value)
        Convenience method that puts a String value. Uses platform default charset
        Parameters:
        key - key with which the specified value is to be associated
        value - value to be associated with the specified key. null values are not supported
      • getString

        default String getString​(String key,
                                 String charsetName)
        Convenience method that gets a String value.
        Parameters:
        key - the key whose associated value is to be returned
        charsetName - the name of the requested charset, null means platform default
        Returns:
        String value that is associated with the key or null if the key does not exist on the server.
      • getString

        default String getString​(String key)
        Convenience method that gets a String value.
        Parameters:
        key - the key whose associated value is to be returned
        Returns:
        String value that is associated with the key or null. Uses platform default charset if the key does not exist on the server.
      • containsAsync

        default Future<Boolean> containsAsync​(String key)
        The returned Future evaluates to true if the key exists on the server, false otherwise
        Parameters:
        key - The key whose presence is to be tested
        Returns:
        Future evaluates to true if the key exists on the server, false otherwise
      • contains

        default boolean contains​(String key)
        Returns true if a mapping for the specified key exists on the server.
        Parameters:
        key - the key whose presence is to be tested
        Returns:
        true if the key exists on the server, false otherwise.
      • contains

        default boolean contains​(byte[] key)
        Returns true if a mapping for the specified key exists on the server.
        Parameters:
        key - the key whose presence is to be tested
        Returns:
        true if the key exists on the server, false otherwise.
      • removeAsync

        default Future<Boolean> removeAsync​(String key)
        Removes the mapping for the specified key from the server.
        Parameters:
        key - key whose mapping is to be removed
        Returns:
        Future which evaluates to true if the key/value was removed from the server, false otherwise.
      • remove

        default boolean remove​(String key)
        Removes the mapping for the specified key from the server.
        Parameters:
        key - key key whose mapping is to be removed
        Returns:
        true if the key/value was removed from the server, false otherwise.
      • remove

        default boolean remove​(byte[] key)
        Removes the mapping for the specified key from the server.
        Parameters:
        key - key key whose mapping is to be removed
        Returns:
        true if the key/value was removed from the server, false otherwise.
      • putBytes

        default void putBytes​(byte[] key,
                              byte[] value)
        Put a byte array key/value pair.
        Parameters:
        key - key with which the specified value is to be associated
        value - value to be associated with the specified key. null values are not supported
      • getBytes

        default byte[] getBytes​(byte[] key)
        Get a byte[] value.
        Parameters:
        key - the key whose associated value is to be returned
        Returns:
        byte[] value that is associated with the key or null if the key does not exist on the server.