DeleteResult
Date: 2016-02-29

de.zib.scalaris

## Class DeleteResult

- java.lang.Object
- - de.zib.scalaris.DeleteResult

-     public class DeleteResult
      extends Object

  Stores the result of a delete operation.
  Since:
    2.2
  Version:
    3.19
  Author:
    Nico Kruber, kruber@zib.de
  See Also:
    `ReplicatedDHT.delete(String)`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `locks_set` Skipped replicas because locks were set.
    `int` | `ok` Number of successfully deleted replicas.
    `int` | `undef` Skipped replicas because they did not exist.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DeleteResult(OtpErlangList list)` Creates a delete state object by converting the result list returned from erlang.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasDeletedAll(Connection conn)` Checks whether the delete operation has successfully deleted all replicas (replicas which did not exist are counted as successfully deleted as well).

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ok

          public int ok

      Number of successfully deleted replicas.

    - #### locks_set

          public int locks_set

      Skipped replicas because locks were set.

    - #### undef

          public int undef

      Skipped replicas because they did not exist.

  - ### Constructor Detail

    - #### DeleteResult

          public DeleteResult(OtpErlangList list)
                       throws UnknownException

      Creates a delete state object by converting the result list returned from erlang.
      Parameters:
        `list` - the list to convert
      Throws:
        `UnknownException` - is thrown if an unknown reason was encountered

  - ### Method Detail

    - #### hasDeletedAll

          public boolean hasDeletedAll(Connection conn)
                                throws ConnectionException

      Checks whether the delete operation has successfully deleted all replicas (replicas which did not exist are counted as successfully deleted as well). If not, the delete needs to be executed again (see `ReplicatedDHT.delete(com.ericsson.otp.erlang.OtpErlangString, int)`.
      Parameters:
        `conn` - a connection to Scalaris to find out the current replication degree
      Returns:
        whether all replicas were deleted or not
      Throws:
        `ConnectionException` - if the connection is not active or a communication error occurs or an exit signal was received or the remote node sends a message containing an invalid cookie
      Since:
        3.19