aboutsummaryrefslogtreecommitdiffstats
path: root/slobrok/src/vespa/slobrok/server/mock_map_listener.cpp
blob: 60cc1e6ee5940b95594bc7a876f24b142a65c995 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "mock_map_listener.h"

namespace slobrok {

MockMapListener::MockMapListener() = default;
MockMapListener::~MockMapListener() = default;

void MockMapListener::add(const ServiceMapping &mapping) {
    last_event = MockEvent::ADD;
    last_add = mapping;
}

void MockMapListener::remove(const ServiceMapping &mapping) {
    last_event = MockEvent::REMOVE;
    last_remove = mapping;
}

void MockMapListener::update(const ServiceMapping &old_mapping,
                             const ServiceMapping &new_mapping)
{
    last_event = MockEvent::UPDATE;
    last_remove = old_mapping;
    last_add = new_mapping;
}

}