aboutsummaryrefslogtreecommitdiffstats
path: root/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/MockFileDBHandler.java
blob: d518867407ab8849befc3560a7aafa3043413b41 (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
// 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 Ulf Lilleengen
 */
public class MockFileDBHandler implements FileDistribution {
    public int sendDeployedFilesCalled = 0;
    public int removeDeploymentsThatHaveDifferentApplicationIdCalled = 0;

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

    @Override
    public void startDownload(String hostName, int port, Set<FileReference> fileReferences) {
        throw new UnsupportedOperationException("Not valid for this Filedistribution implementation");
    }

    @Override
    public void reloadDeployFileDistributor() {}

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