Search in sources :

Example 1 with ApplicationName

use of com.yahoo.config.provision.ApplicationName in project vespa by vespa-engine.

the class ApplicationHandler method createFromRequestSimpleAppId.

// The URL pattern with only tenant and application given
private static ApplicationId createFromRequestSimpleAppId(BindingMatch<?> bm) {
    TenantName tenant = TenantName.from(bm.group(2));
    ApplicationName application = ApplicationName.from(bm.group(3));
    return new ApplicationId.Builder().tenant(tenant).applicationName(application).build();
}
Also used : ApplicationName(com.yahoo.config.provision.ApplicationName) TenantName(com.yahoo.config.provision.TenantName) ApplicationId(com.yahoo.config.provision.ApplicationId)

Example 2 with ApplicationName

use of com.yahoo.config.provision.ApplicationName in project vespa by vespa-engine.

the class HttpConfigRequest method createFromRequestV2SimpleAppId.

// The URL pattern with only tenant and application given
private static HttpConfigRequest createFromRequestV2SimpleAppId(HttpRequest req, BindingMatch<?> bm) {
    String cId;
    String cName;
    String cNamespace;
    TenantName tenant = TenantName.from(bm.group(2));
    ApplicationName application = ApplicationName.from(bm.group(3));
    String conf = bm.group(4);
    if (bm.groupCount() >= 6) {
        cId = bm.group(5);
    } else {
        cId = "";
    }
    Tuple2<String, String> nns = nameAndNamespace(conf);
    cName = nns.first;
    cNamespace = nns.second;
    return new HttpConfigRequest(new ConfigKey<>(cName, cId, cNamespace), new ApplicationId.Builder().applicationName(application).tenant(tenant).build(), req.getBooleanProperty(HTTP_PROPERTY_NOCACHE));
}
Also used : ApplicationName(com.yahoo.config.provision.ApplicationName) TenantName(com.yahoo.config.provision.TenantName)

Example 3 with ApplicationName

use of com.yahoo.config.provision.ApplicationName in project vespa by vespa-engine.

the class HttpListConfigsRequest method createFromListRequestSimpleAppId.

private static HttpListConfigsRequest createFromListRequestSimpleAppId(HttpRequest req, BindingMatch<?> bm) {
    TenantName tenant = TenantName.from(bm.group(2));
    ApplicationName application = ApplicationName.from(bm.group(3));
    return new HttpListConfigsRequest(null, new ApplicationId.Builder().tenant(tenant).applicationName(application).build(), req.getBooleanProperty(HttpConfigRequests.RECURSIVE_QUERY_PROPERTY), false);
}
Also used : ApplicationName(com.yahoo.config.provision.ApplicationName) TenantName(com.yahoo.config.provision.TenantName)

Example 4 with ApplicationName

use of com.yahoo.config.provision.ApplicationName in project vespa by vespa-engine.

the class HttpListConfigsRequest method createFromNamedListRequestSimpleAppId.

private static HttpListConfigsRequest createFromNamedListRequestSimpleAppId(HttpRequest req, BindingMatch<?> bm) {
    TenantName tenant = TenantName.from(bm.group(2));
    ApplicationName application = ApplicationName.from(bm.group(3));
    String conf = bm.group(4);
    String cId;
    String cName;
    String cNamespace;
    if (bm.groupCount() >= 6) {
        cId = bm.group(5);
    } else {
        cId = "";
    }
    Tuple2<String, String> nns = HttpConfigRequest.nameAndNamespace(conf);
    cName = nns.first;
    cNamespace = nns.second;
    ConfigKey<?> key = new ConfigKey<>(cName, cId, cNamespace);
    return new HttpListConfigsRequest(key, new ApplicationId.Builder().tenant(tenant).applicationName(application).build(), req.getBooleanProperty(HttpConfigRequests.RECURSIVE_QUERY_PROPERTY), false);
}
Also used : ApplicationName(com.yahoo.config.provision.ApplicationName) ConfigKey(com.yahoo.vespa.config.ConfigKey) TenantName(com.yahoo.config.provision.TenantName)

Aggregations

ApplicationName (com.yahoo.config.provision.ApplicationName)4 TenantName (com.yahoo.config.provision.TenantName)4 ApplicationId (com.yahoo.config.provision.ApplicationId)1 ConfigKey (com.yahoo.vespa.config.ConfigKey)1