summaryrefslogtreecommitdiffstats
path: root/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/MockFileDBHandler.java
blob: 81c777df393ac0864cfb8caa17125e3d7502c316 (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
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.filedistribution;

import com.yahoo.config.FileReference;
import com.yahoo.config.model.api.FileDistribution;

import java.util.Collection;
import java.util.Set;

/**
 * @author lulf
 * @since 5.1
 */
public class MockFileDBHandler implements FileDistribution {
    public int sendDeployedFilesCalled = 0;
    public int reloadDeployFileDistributorCalled = 0;
    public int limitSendingOfDeployedFilesToCalled = 0;
    public int removeDeploymentsThatHaveDifferentApplicationIdCalled = 0;

    @Override
    public void sendDeployedFiles(String hostName, Set<FileReference> fileReferences) {
        sendDeployedFilesCalled++;
    }

    @Override
    public void reloadDeployFileDistributor() {
        reloadDeployFileDistributorCalled++;
    }

    @Override
    public void limitSendingOfDeployedFilesTo(Collection<String> hostNames) {
        limitSendingOfDeployedFilesToCalled++;
    }

    @Override
    public void removeDeploymentsThatHaveDifferentApplicationId(Collection<String> targetHostnames) {
        removeDeploymentsThatHaveDifferentApplicationIdCalled++;
    }
}