aboutsummaryrefslogtreecommitdiffstats
path: root/fileacquirer/src/main/java/com/yahoo/filedistribution/fileacquirer/FileAcquirer.java
blob: 3f25273334a53d506fd6ec1fc6a73f0933ece8ec (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.filedistribution.fileacquirer;

import com.yahoo.config.FileReference;
import com.yahoo.vespa.config.FileReferenceDoesNotExistException;

import java.io.File;
import java.util.concurrent.TimeUnit;

/**
 * Retrieves the path to a file or directory on the local file system
 * that has been transferred with the vespa file distribution
 * mechanism.
 *
 * @author Tony Vaagenes
 */
public interface FileAcquirer {

    /**
     * Returns the path to a file or directory corresponding to the
     * given file reference.  File references are produced by the
     * config system.
     *
     * @throws TimeoutException if the file or directory could not be retrieved in time.
     * @throws FileReferenceDoesNotExistException if the file is no
     *         longer available(due to reloading of config).
     */
    File waitFor(FileReference fileReference, long timeout, TimeUnit timeUnit) throws InterruptedException;

    void shutdown();

}