aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/dns/AbstractNameServiceRequest.java
blob: f4223ad90bc088269025d52ede698938be476b94 (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 Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.dns;

import com.yahoo.vespa.hosted.controller.api.integration.dns.RecordName;
import com.yahoo.vespa.hosted.controller.application.TenantAndApplicationId;

import java.util.Optional;

import static java.util.Objects.requireNonNull;

/**
 * @author jonmv
 */
public abstract class AbstractNameServiceRequest implements NameServiceRequest {

    private final Optional<TenantAndApplicationId> owner;
    private final RecordName name;

    AbstractNameServiceRequest(Optional<TenantAndApplicationId> owner, RecordName name) {
        this.owner = requireNonNull(owner);
        this.name = requireNonNull(name);
    }

    @Override
    public RecordName name() {
        return name;
    }

    @Override
    public Optional<TenantAndApplicationId> owner() {
        return owner;
    }

}