aboutsummaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/main/java/com/yahoo/jdisc/service/BindingSetNotFoundException.java
blob: f904ea53e197bd28b8ce22197a775ff8b8212189 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.service;

import com.yahoo.jdisc.application.BindingSet;

import java.net.URI;

/**
 * This exception is used to signal that a named {@link BindingSet} was not found. An instance of this class will be
 * thrown by the {@link CurrentContainer#newReference(URI)} method when a BindingSet with the specified name does not
 * exist.
 *
 * @author Simon Thoresen Hult
 */
public final class BindingSetNotFoundException extends RuntimeException {

    private final String bindingSet;

    /**
     * Constructs a new instance of this class with a detail message that contains the name of the {@link BindingSet}
     * that was not found.
     *
     * @param bindingSet The name of the {@link BindingSet} that was not found.
     */
    public BindingSetNotFoundException(String bindingSet) {
        super("No binding set named '" + bindingSet + "'.");
        this.bindingSet = bindingSet;
    }

    /**
     * Returns the name of the {@link BindingSet} that was not found.
     *
     * @return The name of the BindingSet.
     */
    public String bindingSet() {
        return bindingSet;
    }
}