# Module lease_list

- Description
- Data Types
- Function Index
- Function Details

lease list in the dht_node_state.

Copyright © 2012-2014 Zuse Institute Berlin,

Version: $Id$

Authors: Florian Schintke (`schintke@zib.de`), Thorsten Schuett (`schuett@zib.de`).

## Description

lease list in the dht_node_state.

## Data Types

### active_lease_t()

    active_lease_t() = l_on_cseq:lease_t() | empty

### lease_list()

    lease_list() =
        #lease_list_t{active = active_lease_t(),
                      passive = [l_on_cseq:lease_t()],
                      next_round_map = next_round_map()}

### next_round_map()

    next_round_map() = [{l_on_cseq:lease_id(), pr:pr()}]

## Function Index

contains_lease/3 |
empty/0 |
get_active_lease/1 |
get_active_range/1 |
get_next_round/2 |
get_passive_leases/1 |
make_lease_list/3 |
remove_lease_from_dht_node_state/4 |
update_lease_in_dht_node_state/4 |
update_next_round/3 |

## Function Details

### empty/0

    empty() -> lease_list()

### make_lease_list/3

    make_lease_list(Active :: active_lease_t(),
                    Passive :: [l_on_cseq:lease_t()],
                    NextRounds :: next_round_map()) ->
                       lease_list()

### get_active_lease/1

    get_active_lease(Lease_list_t :: lease_list()) -> active_lease_t()

### get_active_range/1

    get_active_range(Lease_list_t :: lease_list()) ->
                        intervals:interval()

### get_passive_leases/1

    get_passive_leases(Lease_list_t :: lease_list()) ->
                          [l_on_cseq:lease_t()]

### get_next_round/2

    get_next_round(Id :: l_on_cseq:lease_id(),
                   State :: dht_node_state:state()) ->
                      pr:pr() | failed

### update_next_round/3

    update_next_round(Id :: l_on_cseq:lease_id(),
                      NextRound :: pr:pr(),
                      State :: dht_node_state:state()) ->
                         dht_node_state:state()

### update_lease_in_dht_node_state/4

    update_lease_in_dht_node_state(Lease :: l_on_cseq:lease_t(),
                                   State :: dht_node_state:state(),
                                   Mode :: active | passive,
                                   Reason ::
                                       renew |
                                       received_lease |
                                       unittest |
                                       handover |
                                       takeover |
                                       recover |
                                       merge_reply_step1 |
                                       merge_reply_step2 |
                                       merge_reply_step3 |
                                       split_reply_step1 |
                                       split_reply_step2 |
                                       split_reply_step3 |
                                       split_reply_step4) ->
                                      dht_node_state:state()

### contains_lease/3

    contains_lease(Lease :: l_on_cseq:lease_t(),
                   State :: dht_node_state:state(),
                   Mode :: active | passive) ->
                      boolean()

### remove_lease_from_dht_node_state/4

    remove_lease_from_dht_node_state(Lease :: l_on_cseq:lease_t(),
                                     Id :: l_on_cseq:lease_id(),
                                     State :: dht_node_state:state(),
                                     Mode :: active | passive | any) ->
                                        dht_node_state:state()

Generated by EDoc, Apr 22 2017, 15:58:19.