aboutsummaryrefslogtreecommitdiffstats
path: root/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java
blob: c6190e1e07b8bfab79cf27634c15b6520052f7ad (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.application;

import com.yahoo.config.provision.ApplicationId;
import com.yahoo.transaction.Transaction;

import java.util.List;

/**
 * The applications of a tenant
 *
 * @author lulf
 * @since 5.1
 */
public interface TenantApplications {

    /**
     * List the active applications of a tenant in this config server.
     *
     * @return a list of {@link com.yahoo.config.provision.ApplicationId}s that are active.
     */
    List<ApplicationId> listApplications();

    /**
     * Register active application and adds it to the repo. If it already exists it is overwritten.
     *
     * @param applicationId An {@link com.yahoo.config.provision.ApplicationId} that represents an active application.
     * @param sessionId Id of the session containing the application package for this id.
     */
    Transaction createPutApplicationTransaction(ApplicationId applicationId, long sessionId);

    /**
     * Return the stored session id for a given application.
     *
     * @param  applicationId an {@link ApplicationId}
     * @return session id of given application id.
     * @throws IllegalArgumentException if the application does not exist
     */
    long getSessionIdForApplication(ApplicationId applicationId);

    /**
     * Returns a transaction which deletes this application
     *
     * @param applicationId an {@link ApplicationId} to delete.
     */
    Transaction deleteApplication(ApplicationId applicationId);

    /**
     * Closes the application repo. Once a repo has been closed, it should not be used again.
     */
    void close();

}